public class RolapSchema extends Object implements Schema
RolapSchema is a collection of RolapCubes and
 shared RolapDimensions. It is shared betweeen RolapConnections. It caches MemberReaders, etc.RolapConnection| Modifier and Type | Class and Description | 
|---|---|
(package private) static class  | 
RolapSchema.RolapSchemaFunctionTable
Function table which contains all of the user-defined functions in this
 schema, plus all of the standard functions. 
 | 
class  | 
RolapSchema.RolapStarRegistry
RolapStarRegistry is a registry for RolapStars. | 
| Modifier and Type | Field and Description | 
|---|---|
(package private) SchemaKey | 
key
This is basically a unique identifier for this RolapSchema instance
 used it its equals and hashCode methods. 
 | 
(package private) static org.apache.log4j.Logger | 
LOGGER  | 
(package private) RolapNativeRegistry | 
nativeRegistry  | 
(package private) List<RolapSchemaParameter> | 
parameterList  | 
| Constructor and Description | 
|---|
RolapSchema(SchemaKey key,
           ByteString md5Bytes,
           RolapConnection internalConnection)
Deprecated. 
 
for tests only! 
 | 
RolapSchema(SchemaKey key,
           ByteString md5Bytes,
           String catalogUrl,
           String catalogStr,
           Util.PropertyList connectInfo,
           DataSource dataSource)
Create RolapSchema given the MD5 hash, catalog name and string (content)
 and the connectInfo object. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
addCube(RolapCube cube)
Adds a cube to the cube name map. 
 | 
static boolean | 
cacheContains(RolapSchema rolapSchema)  | 
Cube | 
createCube(String xml)
Creates a cube by parsing an XML string. 
 | 
Dimension | 
createDimension(Cube cube,
               String xml)
Creates a dimension in the given cube by parsing an XML string. 
 | 
(package private) MemberReader | 
createMemberReader(String sharedName,
                  RolapHierarchy hierarchy,
                  String memberReaderClass)
Gets a  
MemberReader with which to read a hierarchy. | 
(package private) Role | 
createUnionRole(MondrianDef.Role xmlRole)  | 
boolean | 
equals(Object o)  | 
(package private) void | 
error(String message,
     mondrian.rolap.RolapSchema.XmlLocation xmlLocation)
Reports an error. 
 | 
protected void | 
finalCleanUp()
Performs a sweep of the JDBC tables caches and the segment data. 
 | 
protected void | 
finalize()  | 
protected void | 
flushJdbcSchema()
Clears the cache of JDBC tables for the aggs. 
 | 
protected void | 
flushSegments()  | 
Map<String,Annotation> | 
getAnnotationMap()
Returns a list of annotations. 
 | 
ByteString | 
getChecksum()
Returns the checksum of this schema. 
 | 
List<RolapCube> | 
getCubeList()  | 
Cube[] | 
getCubes()
Returns a list of all cubes in this schema. 
 | 
List<RolapCube> | 
getCubesWithStar(RolapStar star)  | 
DataSourceChangeListener | 
getDataSourceChangeListener()  | 
Role | 
getDefaultRole()  | 
Dialect | 
getDialect()
Returns this schema's SQL dialect. 
 | 
FunTable | 
getFunTable()
Returns this schema's function table. 
 | 
String | 
getId()
Returns this schema instance unique ID. 
 | 
RolapConnection | 
getInternalConnection()
Connection for purposes of parsing and validation. 
 | 
protected org.apache.log4j.Logger | 
getLogger()  | 
String | 
getName()
Returns the name of this schema. 
 | 
NamedSet | 
getNamedSet(IdentifierSegment segment)  | 
NamedSet | 
getNamedSet(String name)  | 
(package private) RolapNativeRegistry | 
getNativeRegistry()  | 
Parameter[] | 
getParameters()
Returns this schema's parameters. 
 | 
static List<RolapSchema> | 
getRolapSchemas()  | 
RolapSchema.RolapStarRegistry | 
getRolapStarRegistry()  | 
Date | 
getSchemaLoadDate()
Returns when this schema was last loaded. 
 | 
SchemaReader | 
getSchemaReader()
Creates a  
SchemaReader without any access control. | 
Hierarchy[] | 
getSharedHierarchies()
Returns a list of shared dimensions in this schema. 
 | 
(package private) RolapHierarchy | 
getSharedHierarchy(String name)  | 
RolapStar | 
getStar(String factTableName)  | 
Collection<RolapStar> | 
getStars()  | 
List<Exception> | 
getWarnings()
Returns a list of warnings and errors that occurred while loading this
 schema. 
 | 
MondrianDef.Schema | 
getXMLSchema()  | 
(package private) void | 
handleCubeGrant(RoleImpl role,
               MondrianDef.CubeGrant cubeGrant)  | 
(package private) void | 
handleHierarchyGrant(RoleImpl role,
                    RolapCube cube,
                    SchemaReader reader,
                    MondrianDef.HierarchyGrant grant)  | 
(package private) void | 
handleSchemaGrant(RoleImpl role,
                 MondrianDef.SchemaGrant schemaGrant)  | 
int | 
hashCode()  | 
protected void | 
load(String catalogUrl,
    String catalogStr)
Method called by all constructors to load the catalog into DOM and build
 application mdx and sql objects. 
 | 
(package private) mondrian.rolap.RolapSchema.XmlLocation | 
locate(ElementDef node,
      String attributeName)
Returns the location of an element or attribute in an XML document. 
 | 
protected RolapCube | 
lookupCube(String cubeName)
Finds a cube called 'cube' in the current catalog, or return null if no
 cube exists. 
 | 
Cube | 
lookupCube(String cube,
          boolean failIfNotFound)
Finds a cube called  
cube in this schema; if no cube
 exists, failIfNotFound controls whether to raise an error
 or return null. | 
Role | 
lookupRole(String role)
Finds a role with a given name in the current catalog, or returns
  
null if no such role exists. | 
protected MondrianDef.CalculatedMember | 
lookupXmlCalculatedMember(String calcMemberName,
                         String cubeName)
Returns an xmlCalculatedMember called 'calcMemberName' in the
 cube called 'cubeName' or return null if no calculatedMember or
 xmlCube by those name exists. 
 | 
boolean | 
removeCube(String cubeName)
Removes a cube. 
 | 
Set<String> | 
roleNames()  | 
void | 
setDataSourceChangeListener(DataSourceChangeListener dataSourceChangeListener)  | 
(package private) static Scripts.ScriptDefinition | 
toScriptDef(MondrianDef.Script script)  | 
static final org.apache.log4j.Logger LOGGER
final SchemaKey key
final List<RolapSchemaParameter> parameterList
final RolapNativeRegistry nativeRegistry
RolapSchema(SchemaKey key, ByteString md5Bytes, String catalogUrl, String catalogStr, Util.PropertyList connectInfo, DataSource dataSource)
md5Bytes - may be nullcatalogUrl - URL of catalogcatalogStr - may be nullconnectInfo - Connection properties@Deprecated RolapSchema(SchemaKey key, ByteString md5Bytes, RolapConnection internalConnection)
protected void flushSegments()
protected void flushJdbcSchema()
protected void finalCleanUp()
protected void finalize()
                 throws Throwable
protected org.apache.log4j.Logger getLogger()
protected void load(String catalogUrl, String catalogStr)
catalogUrl - URL of catalogcatalogStr - Text of catalog, or nullpublic Date getSchemaLoadDate()
SchemagetSchemaLoadDate in interface Schemapublic List<Exception> getWarnings()
SchemagetWarnings in interface Schemapublic Role getDefaultRole()
public MondrianDef.Schema getXMLSchema()
public String getName()
Schemapublic String getId()
public Map<String,Annotation> getAnnotationMap()
AnnotatedThe map may be empty, never null.
getAnnotationMap in interface Annotatedpublic Dialect getDialect()
NOTE: This method is not cheap. The implementation gets a connection from the connection pool.
static Scripts.ScriptDefinition toScriptDef(MondrianDef.Script script)
mondrian.rolap.RolapSchema.XmlLocation locate(ElementDef node, String attributeName)
TODO: modify eigenbase-xom parser to return position info
node - NodeattributeName - Attribute name, or nullvoid error(String message, mondrian.rolap.RolapSchema.XmlLocation xmlLocation)
RolapConnectionProperties.Ignore), adds
 it to the stack, overwise throws. A thrown exception will typically
 abort the attempt to create the exception.message - MessagexmlLocation - Location of XML element or attribute that caused
 the error, or nullRole createUnionRole(MondrianDef.Role xmlRole)
void handleSchemaGrant(RoleImpl role, MondrianDef.SchemaGrant schemaGrant)
void handleCubeGrant(RoleImpl role, MondrianDef.CubeGrant cubeGrant)
void handleHierarchyGrant(RoleImpl role, RolapCube cube, SchemaReader reader, MondrianDef.HierarchyGrant grant)
public Dimension createDimension(Cube cube, String xml)
SchemacreateDimension in interface Schemapublic Cube createCube(String xml)
SchemacreateCube in interface Schemapublic static List<RolapSchema> getRolapSchemas()
public static boolean cacheContains(RolapSchema rolapSchema)
public Cube lookupCube(String cube, boolean failIfNotFound)
Schemacube in this schema; if no cube
 exists, failIfNotFound controls whether to raise an error
 or return null.lookupCube in interface Schemaprotected RolapCube lookupCube(String cubeName)
protected MondrianDef.CalculatedMember lookupXmlCalculatedMember(String calcMemberName, String cubeName)
protected void addCube(RolapCube cube)
lookupCube(String)public boolean removeCube(String cubeName)
SchemaremoveCube in interface Schemapublic Cube[] getCubes()
Schemapublic Hierarchy[] getSharedHierarchies()
SchemagetSharedHierarchies in interface SchemaRolapHierarchy getSharedHierarchy(String name)
public NamedSet getNamedSet(IdentifierSegment segment)
public Role lookupRole(String role)
Schemanull if no such role exists.lookupRole in interface Schemapublic FunTable getFunTable()
SchemagetFunTable in interface Schemapublic Parameter[] getParameters()
SchemagetParameters in interface SchemaMemberReader createMemberReader(String sharedName, RolapHierarchy hierarchy, String memberReaderClass)
MemberReader with which to read a hierarchy. If the
 hierarchy is shared (sharedName is not null), looks up
 a reader from a cache, or creates one if necessary.
 Synchronization: thread safe
public SchemaReader getSchemaReader()
SchemaSchemaReader without any access control.getSchemaReader in interface Schemapublic ByteString getChecksum()
null if RolapConnectionProperties.UseContentChecksum
 is set to false.public RolapConnection getInternalConnection()
public RolapSchema.RolapStarRegistry getRolapStarRegistry()
public Collection<RolapStar> getStars()
RolapNativeRegistry getNativeRegistry()
public DataSourceChangeListener getDataSourceChangeListener()
public void setDataSourceChangeListener(DataSourceChangeListener dataSourceChangeListener)
dataSourceChangeListener - The dataSourceChangeListener to set.