ca.sqlpower.architect.olap
Class OLAPSession

java.lang.Object
  extended by ca.sqlpower.architect.olap.OLAPObject
      extended by ca.sqlpower.architect.olap.OLAPSession

public class OLAPSession
extends OLAPObject

The collection of objects that support editing and use of an OLAP schema. Contains the schema as its one and only child, and belongs to an OLAPRootObject.


Field Summary
 
Fields inherited from class ca.sqlpower.architect.olap.OLAPObject
pcs
 
Constructor Summary
OLAPSession(MondrianModel.Schema schema)
          Creates the OLAP Session for the given schema.
 
Method Summary
 void addChild(OLAPObject child)
          Throws an exception, because you can't add or remove children from this type of OLAP Object.
 boolean allowsChildren()
          Returns true if this type of OLAPObject can ever return a non-empty list from OLAPObject.getChildren(), and false if getChildren() is always empty.
 java.util.List<MondrianModel.Schema> getChildren()
          Returns a list with exactly one entry: this session's schema.
 SQLDatabase getDatabase()
          Returns the SQLDatabase this session's schema works with.
 MondrianModel.Schema getSchema()
          Returns this session's schema.
 boolean removeChild(OLAPObject child)
          Throws an exception, because you can't add or remove children from this type of OLAP Object.
 void setDatabase(SQLDatabase database)
          Sets the SQLDatabase this session's schema works with.
 
Methods inherited from class ca.sqlpower.architect.olap.OLAPObject
addChild, addChildListener, addCompoundEditListener, addPropertyChangeListener, endCompoundEdit, fireChildAdded, fireChildRemoved, getName, getParent, removeChildListener, removeCompoundEditListener, removePropertyChangeListener, startCompoundEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OLAPSession

public OLAPSession(MondrianModel.Schema schema)
Creates the OLAP Session for the given schema. That schema must not already belong to another session.

Parameters:
schema - The schema this session owns.
Method Detail

getDatabase

public SQLDatabase getDatabase()
Returns the SQLDatabase this session's schema works with.

Returns:

setDatabase

public void setDatabase(SQLDatabase database)
Sets the SQLDatabase this session's schema works with.

Note that many parts of the OLAP model refer to tables, columns, views, and so on within one single database connection. Changing which database this session's schema works with is not possible, in general, without a lot of cleanup work. Currently, no effort is made in this method to validate that the new database has the appropriate structure.

Similarly, if the tables and columns within this database change over time, the OLAP schema may become invalid, since it will still be referencing the old objects. It would make sense for this session to attach SQLObjectPreEventListeners to the database and all its children, although this is not currently implemented.

Parameters:
database - The new database to use with this session's schema.

getSchema

public MondrianModel.Schema getSchema()
Returns this session's schema.


allowsChildren

public boolean allowsChildren()
Description copied from class: OLAPObject
Returns true if this type of OLAPObject can ever return a non-empty list from OLAPObject.getChildren(), and false if getChildren() is always empty.

Specified by:
allowsChildren in class OLAPObject

getChildren

public java.util.List<MondrianModel.Schema> getChildren()
Returns a list with exactly one entry: this session's schema.

Specified by:
getChildren in class OLAPObject

addChild

public void addChild(OLAPObject child)
Throws an exception, because you can't add or remove children from this type of OLAP Object.

Overrides:
addChild in class OLAPObject
Parameters:
child - The child to add.

removeChild

public boolean removeChild(OLAPObject child)
Throws an exception, because you can't add or remove children from this type of OLAP Object.

Overrides:
removeChild in class OLAPObject
Parameters:
child - The child to remove.


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca