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 void
addConnection(RolapConnection connection)
Called just after a connection has been created.void
addStatement(Statement statement)
Called just after a statement has been created.protected void
finalize()
AggregationManager
getAggregationManager()
CatalogLocator
getCatalogLocator()
List<String>
getCatalogNames(RolapConnection connection)
Returns a list of catalogs.RolapConnection
getConnection(int connectionId)
Retrieves a connection.OlapConnection
getConnection(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.OlapConnection
getConnection(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.int
getId()
Returns an integer uniquely identifying this server within its JVM.List<String>
getKeywords()
Returns a list of MDX keywords.LockBox
getLockBox()
Returns the lock box that can be used to pass objects via their string key.Monitor
getMonitor()
Map<String,Object>
getPreConfiguredDiscoverDatasourcesResponse()
Returns a map of property name-value pairs with which to populate the response to the DISCOVER_DATASOURCES request.RolapResultShepherd
getResultShepherd()
Map<String,RolapSchema>
getRolapSchemas(RolapConnection connection, String catalogName)
Returns a list of (schema name, schema) pairs in a catalog of a particular name.void
removeConnection(RolapConnection connection)
Called when a connection is closed.void
removeStatement(Statement statement)
Called when a statement is closed.void
shutdown()
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:MondrianServer
Returns an integer uniquely identifying this server within its JVM.- Specified by:
getId
in classMondrianServer
- Returns:
- Server's unique identifier
-
getResultShepherd
public RolapResultShepherd getResultShepherd()
- Specified by:
getResultShepherd
in classMondrianServer
-
getKeywords
public List<String> getKeywords()
Description copied from class:MondrianServer
Returns a list of MDX keywords.- Specified by:
getKeywords
in classMondrianServer
- Returns:
- list of MDX keywords
-
getLockBox
public LockBox getLockBox()
Description copied from class:MondrianServer
Returns the lock box that can be used to pass objects via their string key.- Specified by:
getLockBox
in classMondrianServer
- Returns:
- Lock box for this server
-
getAggregationManager
public AggregationManager getAggregationManager()
- Specified by:
getAggregationManager
in classMondrianServer
-
getConnection
public OlapConnection getConnection(String databaseName, String catalogName, String roleName) throws SQLException
Description copied from class:MondrianServer
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:
getConnection
in 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:MondrianServer
Extended 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:
getConnection
in interfaceXmlaHandler.ConnectionFactory
- Specified by:
getConnection
in 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:CatalogFinder
Returns a list of catalogs.The catalog names occur in the natural order of the repository.
- Specified by:
getCatalogNames
in 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:MondrianServer
Returns 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:
getDatabases
in classMondrianServer
- Parameters:
connection
- Connection- Returns:
- List of data source definitions
-
getCatalogLocator
public CatalogLocator getCatalogLocator()
- Specified by:
getCatalogLocator
in classMondrianServer
-
shutdown
public void shutdown()
Description copied from class:MondrianServer
Called when the server must terminate all background tasks and cleanup all potential memory leaks.- Specified by:
shutdown
in classMondrianServer
-
addConnection
public void addConnection(RolapConnection connection)
Description copied from class:MondrianServer
Called just after a connection has been created.- Specified by:
addConnection
in classMondrianServer
- Parameters:
connection
- Connection
-
removeConnection
public void removeConnection(RolapConnection connection)
Description copied from class:MondrianServer
Called when a connection is closed.- Specified by:
removeConnection
in classMondrianServer
- Parameters:
connection
- Connection
-
getConnection
public RolapConnection getConnection(int connectionId)
Description copied from class:MondrianServer
Retrieves a connection.- Specified by:
getConnection
in 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:MondrianServer
Called just after a statement has been created.- Specified by:
addStatement
in classMondrianServer
- Parameters:
statement
- Statement
-
removeStatement
public void removeStatement(Statement statement)
Description copied from class:MondrianServer
Called when a statement is closed.- Specified by:
removeStatement
in classMondrianServer
- Parameters:
statement
- Statement
-
getMonitor
public Monitor getMonitor()
- Specified by:
getMonitor
in classMondrianServer
-
getRolapSchemas
public Map<String,RolapSchema> getRolapSchemas(RolapConnection connection, String catalogName)
Description copied from interface:CatalogFinder
Returns 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:
getRolapSchemas
in interfaceCatalogFinder
- Parameters:
connection
- Connection to mondriancatalogName
- Name of catalog- Returns:
- List of catalogs
-
getPreConfiguredDiscoverDatasourcesResponse
public Map<String,Object> getPreConfiguredDiscoverDatasourcesResponse()
Description copied from interface:XmlaHandler.ConnectionFactory
Returns 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:
getPreConfiguredDiscoverDatasourcesResponse
in interfaceXmlaHandler.ConnectionFactory
- Returns:
- Column names and values for the DISCOVER_DATASOURCES response
-
-