Package mondrian.rolap
Class RolapSchema
- java.lang.Object
-
- mondrian.rolap.RolapSchema
-
public class RolapSchema extends Object implements Schema
ARolapSchemais a collection ofRolapCubes and sharedRolapDimensions. It is shared betweeenRolapConnections. It cachesMemberReaders, etc.- Since:
- 26 July, 2001
- Author:
- jhyde
- See Also:
RolapConnection
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRolapSchema.RolapStarRegistryRolapStarRegistryis a registry forRolapStars.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddCube(RolapCube cube)Adds a cube to the cube name map.static booleancacheContains(RolapSchema rolapSchema)static StringcalcMemberFqName(MondrianDef.CalculatedMember xmlCalcMember)CubecreateCube(String xml)Creates a cube by parsing an XML string.DimensioncreateDimension(Cube cube, String xml)Creates a dimension in the given cube by parsing an XML string.booleanequals(Object o)protected voidfinalCleanUp()Performs a sweep of the JDBC tables caches and the segment data.protected voidfinalize()protected voidflushJdbcSchema()Clears the cache of JDBC tables for the aggs.protected voidflushSegments()Map<String,Annotation>getAnnotationMap()Returns a list of annotations.ByteStringgetChecksum()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)DataSourceChangeListenergetDataSourceChangeListener()RolegetDefaultRole()DialectgetDialect()Returns this schema's SQL dialect.FunTablegetFunTable()Returns this schema's function table.StringgetId()Returns this schema instance unique ID.RolapConnectiongetInternalConnection()Connection for purposes of parsing and validation.SchemaKeygetKey()Returns this schema instance unique key.protected org.apache.logging.log4j.LoggergetLogger()StringgetName()Returns the name of this schema.NamedSetgetNamedSet(String name)NamedSetgetNamedSet(org.olap4j.mdx.IdentifierSegment segment)Parameter[]getParameters()Returns this schema's parameters.static List<RolapSchema>getRolapSchemas()RolapSchema.RolapStarRegistrygetRolapStarRegistry()DategetSchemaLoadDate()Returns when this schema was last loaded.SchemaReadergetSchemaReader()Creates aSchemaReaderwithout any access control.Hierarchy[]getSharedHierarchies()Returns a list of shared dimensions in this schema.RolapStargetStar(String factTableName)RolapStargetStar(List<String> starKey)Collection<RolapStar>getStars()List<Exception>getWarnings()Returns a list of warnings and errors that occurred while loading this schema.MondrianDef.SchemagetXMLSchema()inthashCode()protected voidload(String catalogUrl, String catalogStr)Deprecated.API changed to also pass Mondrian connection propertiesprotected voidload(String catalogUrl, String catalogStr, Util.PropertyList connectInfo)Method called by all constructors to load the catalog into DOM and build application mdx and sql objects.protected RolapCubelookupCube(String cubeName)Finds a cube called 'cube' in the current catalog, or return null if no cube exists.CubelookupCube(String cube, boolean failIfNotFound)Finds a cube calledcubein this schema; if no cube exists,failIfNotFoundcontrols whether to raise an error or returnnull.RolelookupRole(String role)Finds a role with a given name in the current catalog, or returnsnullif no such role exists.protected MondrianDef.CalculatedMemberlookupXmlCalculatedMember(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.booleanremoveCube(String cubeName)Removes a cube.Set<String>roleNames()voidsetDataSourceChangeListener(DataSourceChangeListener dataSourceChangeListener)
-
-
-
Method Detail
-
flushSegments
protected void flushSegments()
-
flushJdbcSchema
protected void flushJdbcSchema()
Clears the cache of JDBC tables for the aggs.
-
finalCleanUp
protected void finalCleanUp()
Performs a sweep of the JDBC tables caches and the segment data. Only called internally when a schema and it's data must be refreshed.
-
finalize
protected void finalize() throws Throwable
-
getLogger
protected org.apache.logging.log4j.Logger getLogger()
-
load
@Deprecated protected void load(String catalogUrl, String catalogStr)
Deprecated.API changed to also pass Mondrian connection properties- Parameters:
catalogUrl- URL of catalogcatalogStr- Text of catalog, or null
-
load
protected void load(String catalogUrl, String catalogStr, Util.PropertyList connectInfo)
Method called by all constructors to load the catalog into DOM and build application mdx and sql objects.- Parameters:
catalogUrl- URL of catalogcatalogStr- Text of catalog, or nullconnectInfo- Mondrian connection properties
-
getSchemaLoadDate
public Date getSchemaLoadDate()
Description copied from interface:SchemaReturns when this schema was last loaded.- Specified by:
getSchemaLoadDatein interfaceSchema- Returns:
- Date and time when this schema was last loaded
-
getWarnings
public List<Exception> getWarnings()
Description copied from interface:SchemaReturns a list of warnings and errors that occurred while loading this schema.- Specified by:
getWarningsin interfaceSchema- Returns:
- list of warnings
-
getDefaultRole
public Role getDefaultRole()
-
getXMLSchema
public MondrianDef.Schema getXMLSchema()
-
getName
public String getName()
Description copied from interface:SchemaReturns the name of this schema.
-
getId
public String getId()
Returns this schema instance unique ID.
-
getAnnotationMap
public Map<String,Annotation> getAnnotationMap()
Description copied from interface:AnnotatedReturns a list of annotations.The map may be empty, never null.
- Specified by:
getAnnotationMapin interfaceAnnotated- Returns:
- Map from annotation name to annotations.
-
getDialect
public Dialect getDialect()
Returns this schema's SQL dialect.NOTE: This method is not cheap. The implementation gets a connection from the connection pool.
- Returns:
- dialect
-
createDimension
public Dimension createDimension(Cube cube, String xml)
Description copied from interface:SchemaCreates a dimension in the given cube by parsing an XML string. The XML string must be either a <Dimension> or a <DimensionUsage>. Returns the dimension created.- Specified by:
createDimensionin interfaceSchema
-
createCube
public Cube createCube(String xml)
Description copied from interface:SchemaCreates a cube by parsing an XML string. Returns the cube created.- Specified by:
createCubein interfaceSchema
-
getRolapSchemas
public static List<RolapSchema> getRolapSchemas()
-
cacheContains
public static boolean cacheContains(RolapSchema rolapSchema)
-
lookupCube
public Cube lookupCube(String cube, boolean failIfNotFound)
Description copied from interface:SchemaFinds a cube calledcubein this schema; if no cube exists,failIfNotFoundcontrols whether to raise an error or returnnull.- Specified by:
lookupCubein interfaceSchema
-
lookupCube
protected RolapCube lookupCube(String cubeName)
Finds a cube called 'cube' in the current catalog, or return null if no cube exists.
-
lookupXmlCalculatedMember
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.
-
calcMemberFqName
public static String calcMemberFqName(MondrianDef.CalculatedMember xmlCalcMember)
-
addCube
protected void addCube(RolapCube cube)
Adds a cube to the cube name map.- See Also:
lookupCube(String)
-
removeCube
public boolean removeCube(String cubeName)
Description copied from interface:SchemaRemoves a cube.- Specified by:
removeCubein interfaceSchema- Returns:
- Whether cube was removed
-
getCubes
public Cube[] getCubes()
Description copied from interface:SchemaReturns a list of all cubes in this schema.
-
getSharedHierarchies
public Hierarchy[] getSharedHierarchies()
Description copied from interface:SchemaReturns a list of shared dimensions in this schema.- Specified by:
getSharedHierarchiesin interfaceSchema
-
getNamedSet
public NamedSet getNamedSet(org.olap4j.mdx.IdentifierSegment segment)
-
lookupRole
public Role lookupRole(String role)
Description copied from interface:SchemaFinds a role with a given name in the current catalog, or returnsnullif no such role exists.- Specified by:
lookupRolein interfaceSchema
-
getFunTable
public FunTable getFunTable()
Description copied from interface:SchemaReturns this schema's function table.- Specified by:
getFunTablein interfaceSchema
-
getParameters
public Parameter[] getParameters()
Description copied from interface:SchemaReturns this schema's parameters.- Specified by:
getParametersin interfaceSchema
-
getSchemaReader
public SchemaReader getSchemaReader()
Description copied from interface:SchemaCreates aSchemaReaderwithout any access control.- Specified by:
getSchemaReaderin interfaceSchema
-
getChecksum
public ByteString getChecksum()
Returns the checksum of this schema. ReturnsnullifRolapConnectionProperties.UseContentChecksumis set to false.- Returns:
- MD5 checksum of this schema
-
getInternalConnection
public RolapConnection getInternalConnection()
Connection for purposes of parsing and validation. Careful! It won't have the correct locale or access-control profile.
-
getRolapStarRegistry
public RolapSchema.RolapStarRegistry getRolapStarRegistry()
-
getStars
public Collection<RolapStar> getStars()
-
getDataSourceChangeListener
public DataSourceChangeListener getDataSourceChangeListener()
- Returns:
- Returns the dataSourceChangeListener.
-
setDataSourceChangeListener
public void setDataSourceChangeListener(DataSourceChangeListener dataSourceChangeListener)
- Parameters:
dataSourceChangeListener- The dataSourceChangeListener to set.
-
-