Class MondrianServer
Typically, there is only one instance of Mondrian per JVM. However, you access a MondrianServer via the
forConnection(mondrian.olap.Connection)
method for future expansion.
- Since:
- Jun 25, 2006
- Author:
- jhyde
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Description of the version of the server. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
addConnection
(RolapConnection connection) Called just after a connection has been created.abstract void
addStatement
(Statement statement) Called just after a statement has been created.static MondrianServer
createWithRepository
(RepositoryContentFinder contentFinder, CatalogLocator catalogLocator) Creates a server.static void
Disposes of a server and cleans up everything.static MondrianServer
forConnection
(Connection connection) Returns the MondrianServer that hosts a given connection.static MondrianServer
Returns the server with the given id.abstract AggregationManager
abstract CatalogLocator
abstract RolapConnection
getConnection
(int connectionId) Retrieves a connection.abstract org.olap4j.OlapConnection
getConnection
(String catalogName, String schemaName, String roleName) Gets a Connection given a catalog (and implicitly the catalog's data source) and the name of a user role.abstract org.olap4j.OlapConnection
getConnection
(String catalogName, String schemaName, String roleName, Properties props) Extended version ofgetConnection(String, String, String)
taking a list of properties to pass down to the native connection.getDatabases
(RolapConnection connection) Returns a list of the databases in this server.abstract int
getId()
Returns an integer uniquely identifying this server within its JVM.Returns a list of MDX keywords.abstract LockBox
Returns the lock box that can be used to pass objects via their string key.abstract Monitor
abstract Repository
abstract RolapResultShepherd
int
Returns the schema version of this MondrianServer.getStatements
(String sessionId) Returns the version of this MondrianServer.abstract void
removeConnection
(RolapConnection connection) Called when a connection is closed.abstract void
removeStatement
(Statement statement) Called when a statement is closed.abstract void
shutdown()
Called when the server must terminate all background tasks and cleanup all potential memory leaks.
-
Constructor Details
-
MondrianServer
public MondrianServer()
-
-
Method Details
-
forConnection
Returns the MondrianServer that hosts a given connection.- Parameters:
connection
- Connection (not null)- Returns:
- server this connection belongs to (not null)
-
createWithRepository
public static MondrianServer createWithRepository(RepositoryContentFinder contentFinder, CatalogLocator catalogLocator) Creates a server.When creating a server, the calling code must call the
shutdown()
method to dispose of it.- Parameters:
contentFinder
- Repository content findercatalogLocator
- Catalog locator- Returns:
- Server that reads from the given repository
-
forId
Returns the server with the given id.If id is null, returns the catalog-less server. (The catalog-less server can also be acquired using its id.)
If server is not found, returns null.
- Parameters:
instanceId
- Server instance id- Returns:
- Server, or null if no server with this id
-
dispose
Disposes of a server and cleans up everything.- Parameters:
instanceId
- The instance ID of the server to shutdown gracefully.
-
getId
public abstract int getId()Returns an integer uniquely identifying this server within its JVM.- Returns:
- Server's unique identifier
-
getSchemaVersion
public int getSchemaVersion()Returns the schema version of this MondrianServer.- Returns:
- Server's schema version
-
getVersion
Returns the version of this MondrianServer.- Returns:
- Server's version
-
getKeywords
Returns a list of MDX keywords.- Returns:
- list of MDX keywords
-
getResultShepherd
-
getLockBox
Returns the lock box that can be used to pass objects via their string key.- Returns:
- Lock box for this server
-
getConnection
public abstract org.olap4j.OlapConnection getConnection(String catalogName, String schemaName, String roleName) throws SQLException, SecurityException 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
getLockBox()
and pass in the moniker for the generated lock box entry. The server will retrieve the role from the moniker.- Parameters:
catalogName
- Catalog nameschemaName
- Schema nameroleName
- User role name- Returns:
- Connection
- Throws:
SQLException
- If error occursSecurityException
- If security error occurs
-
getConnection
public abstract org.olap4j.OlapConnection getConnection(String catalogName, String schemaName, String roleName, Properties props) throws SQLException, SecurityException Extended version ofgetConnection(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
getLockBox()
and pass in the moniker for the generated lock box entry. The server will retrieve the role from the moniker.- Parameters:
catalogName
- Catalog nameschemaName
- Schema nameroleName
- User role nameprops
- Properties to pass down to the native driver.- Returns:
- Connection
- Throws:
SQLException
- If error occursSecurityException
- If security error occurs
-
getDatabases
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.- Parameters:
connection
- Connection- Returns:
- List of data source definitions
-
getCatalogLocator
-
shutdown
public abstract void shutdown()Called when the server must terminate all background tasks and cleanup all potential memory leaks. -
addConnection
Called just after a connection has been created.- Parameters:
connection
- Connection
-
removeConnection
Called when a connection is closed.- Parameters:
connection
- Connection
-
getConnection
Retrieves a connection.- Parameters:
connectionId
- Connection id, perRolapConnection.getId()
- Returns:
- Connection, or null if connection is not registered
-
addStatement
Called just after a statement has been created.- Parameters:
statement
- Statement
-
removeStatement
Called when a statement is closed.- Parameters:
statement
- Statement
-
getMonitor
-
getAggregationManager
-
getStatements
-
getRepository
-