Class MondrianServerImpl
- java.lang.Object
-
- mondrian.olap.MondrianServer
-
- mondrian.server.MondrianServerImpl
-
- All Implemented Interfaces:
CatalogFinder,XmlaHandler.ConnectionFactory
class MondrianServerImpl extends MondrianServer implements CatalogFinder, XmlaHandler.ConnectionFactory
Implementation ofMondrianServer.- Since:
- Jun 25, 2006
- Author:
- jhyde
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class mondrian.olap.MondrianServer
MondrianServer.MondrianVersion
-
-
Constructor Summary
Constructors Constructor Description MondrianServerImpl(MondrianServerRegistry registry, Repository repository, CatalogLocator catalogLocator)Creates a MondrianServerImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnection(RolapConnection connection)Called just after a connection has been created.voidaddStatement(Statement statement)Called just after a statement has been created.protected voidfinalize()AggregationManagergetAggregationManager()CatalogLocatorgetCatalogLocator()List<String>getCatalogNames(RolapConnection connection)Returns a list of catalogs.RolapConnectiongetConnection(int connectionId)Retrieves a connection.OlapConnectiongetConnection(String databaseName, String catalogName, String roleName)Gets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.OlapConnectiongetConnection(String databaseName, String catalogName, String roleName, Properties props)Extended version ofMondrianServer.getConnection(String, String, String)taking a list of properties to pass down to the native connection.List<Map<String,Object>>getDatabases(RolapConnection connection)Returns a list of the databases in this server.intgetId()Returns an integer uniquely identifying this server within its JVM.List<String>getKeywords()Returns a list of MDX keywords.LockBoxgetLockBox()Returns the lock box that can be used to pass objects via their string key.MonitorgetMonitor()Map<String,Object>getPreConfiguredDiscoverDatasourcesResponse()Returns a map of property name-value pairs with which to populate the response to the DISCOVER_DATASOURCES request.RolapResultShepherdgetResultShepherd()Map<String,RolapSchema>getRolapSchemas(RolapConnection connection, String catalogName)Returns a list of (schema name, schema) pairs in a catalog of a particular name.voidremoveConnection(RolapConnection connection)Called when a connection is closed.voidremoveStatement(Statement statement)Called when a statement is closed.voidshutdown()Called when the server must terminate all background tasks and cleanup all potential memory leaks.-
Methods inherited from class mondrian.olap.MondrianServer
createWithRepository, dispose, forConnection, forId, getVersion
-
-
-
-
Constructor Detail
-
MondrianServerImpl
MondrianServerImpl(MondrianServerRegistry registry, Repository repository, CatalogLocator catalogLocator)
Creates a MondrianServerImpl.- Parameters:
registry- Registry of all servers in this JVMrepository- Repository of catalogs and schemascatalogLocator- Catalog locator
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
getId
public int getId()
Description copied from class:MondrianServerReturns an integer uniquely identifying this server within its JVM.- Specified by:
getIdin classMondrianServer- Returns:
- Server's unique identifier
-
getResultShepherd
public RolapResultShepherd getResultShepherd()
- Specified by:
getResultShepherdin classMondrianServer
-
getKeywords
public List<String> getKeywords()
Description copied from class:MondrianServerReturns a list of MDX keywords.- Specified by:
getKeywordsin classMondrianServer- Returns:
- list of MDX keywords
-
getLockBox
public LockBox getLockBox()
Description copied from class:MondrianServerReturns the lock box that can be used to pass objects via their string key.- Specified by:
getLockBoxin classMondrianServer- Returns:
- Lock box for this server
-
getAggregationManager
public AggregationManager getAggregationManager()
- Specified by:
getAggregationManagerin classMondrianServer
-
getConnection
public OlapConnection getConnection(String databaseName, String catalogName, String roleName) throws SQLException
Description copied from class:MondrianServerGets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.If you want to pass in a role object, and you are making the call within the same JVM (i.e. not RPC), register the role using
MondrianServer.getLockBox()and pass in the moniker for the generated lock box entry. The server will retrieve the role from the moniker.- Specified by:
getConnectionin classMondrianServer- Parameters:
databaseName- Catalog namecatalogName- Schema nameroleName- User role name- Returns:
- Connection
- Throws:
SQLException- If error occurs
-
getConnection
public OlapConnection getConnection(String databaseName, String catalogName, String roleName, Properties props) throws SQLException
Description copied from class:MondrianServerExtended version ofMondrianServer.getConnection(String, String, String)taking a list of properties to pass down to the native connection.Gets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.
If you want to pass in a role object, and you are making the call within the same JVM (i.e. not RPC), register the role using
MondrianServer.getLockBox()and pass in the moniker for the generated lock box entry. The server will retrieve the role from the moniker.- Specified by:
getConnectionin interfaceXmlaHandler.ConnectionFactory- Specified by:
getConnectionin classMondrianServer- Parameters:
databaseName- Catalog namecatalogName- Schema nameroleName- User role nameprops- Properties to pass down to the native driver.- Returns:
- Connection
- Throws:
SQLException- If error occurs
-
getCatalogNames
public List<String> getCatalogNames(RolapConnection connection)
Description copied from interface:CatalogFinderReturns a list of catalogs.The catalog names occur in the natural order of the repository.
- Specified by:
getCatalogNamesin interfaceCatalogFinder- Parameters:
connection- Connection to mondrian we want the catalog children.- Returns:
- List of catalogs
-
getDatabases
public List<Map<String,Object>> getDatabases(RolapConnection connection)
Description copied from class:MondrianServerReturns a list of the databases in this server. One element per database, each element a map whose keys are the XMLA fields describing a data source: "DataSourceName", "DataSourceDescription", "URL", etc. Unrecognized fields are ignored.- Specified by:
getDatabasesin classMondrianServer- Parameters:
connection- Connection- Returns:
- List of data source definitions
-
getCatalogLocator
public CatalogLocator getCatalogLocator()
- Specified by:
getCatalogLocatorin classMondrianServer
-
shutdown
public void shutdown()
Description copied from class:MondrianServerCalled when the server must terminate all background tasks and cleanup all potential memory leaks.- Specified by:
shutdownin classMondrianServer
-
addConnection
public void addConnection(RolapConnection connection)
Description copied from class:MondrianServerCalled just after a connection has been created.- Specified by:
addConnectionin classMondrianServer- Parameters:
connection- Connection
-
removeConnection
public void removeConnection(RolapConnection connection)
Description copied from class:MondrianServerCalled when a connection is closed.- Specified by:
removeConnectionin classMondrianServer- Parameters:
connection- Connection
-
getConnection
public RolapConnection getConnection(int connectionId)
Description copied from class:MondrianServerRetrieves a connection.- Specified by:
getConnectionin classMondrianServer- Parameters:
connectionId- Connection id, perRolapConnection.getId()- Returns:
- Connection, or null if connection is not registered
-
addStatement
public void addStatement(Statement statement)
Description copied from class:MondrianServerCalled just after a statement has been created.- Specified by:
addStatementin classMondrianServer- Parameters:
statement- Statement
-
removeStatement
public void removeStatement(Statement statement)
Description copied from class:MondrianServerCalled when a statement is closed.- Specified by:
removeStatementin classMondrianServer- Parameters:
statement- Statement
-
getMonitor
public Monitor getMonitor()
- Specified by:
getMonitorin classMondrianServer
-
getRolapSchemas
public Map<String,RolapSchema> getRolapSchemas(RolapConnection connection, String catalogName)
Description copied from interface:CatalogFinderReturns a list of (schema name, schema) pairs in a catalog of a particular name.The name of the schema may not be the same as the value returned by
RolapSchema.getName(). In fact, a given schema may occur multiple times in the same catalog with different names.The schemas occur in the natural order of the repository.
- Specified by:
getRolapSchemasin interfaceCatalogFinder- Parameters:
connection- Connection to mondriancatalogName- Name of catalog- Returns:
- List of catalogs
-
getPreConfiguredDiscoverDatasourcesResponse
public Map<String,Object> getPreConfiguredDiscoverDatasourcesResponse()
Description copied from interface:XmlaHandler.ConnectionFactoryReturns a map of property name-value pairs with which to populate the response to the DISCOVER_DATASOURCES request.Properties correspond to the columns of that request: ""DataSourceName", et cetera.
Returns null if there is no pre-configured response; in which case, the driver will have to connect to get a response.
- Specified by:
getPreConfiguredDiscoverDatasourcesResponsein interfaceXmlaHandler.ConnectionFactory- Returns:
- Column names and values for the DISCOVER_DATASOURCES response
-
-