public abstract class MondrianServer extends Object
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.
Modifier and Type | Class and Description |
---|---|
static interface |
MondrianServer.MondrianVersion
Description of the version of the server.
|
Constructor and Description |
---|
MondrianServer() |
Modifier and Type | Method and Description |
---|---|
abstract 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 |
dispose(String instanceId)
Disposes of a server and cleans up everything.
|
static MondrianServer |
forConnection(Connection connection)
Returns the MondrianServer that hosts a given connection.
|
static MondrianServer |
forId(String instanceId)
Returns the server with the given id.
|
abstract AggregationManager |
getAggregationManager() |
abstract CatalogLocator |
getCatalogLocator() |
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 of
getConnection(String, String, String)
taking a list of properties to pass down to the native connection. |
abstract List<Map<String,Object>> |
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.
|
abstract List<String> |
getKeywords()
Returns a list of MDX keywords.
|
abstract LockBox |
getLockBox()
Returns the lock box that can be used to pass objects via their string
key.
|
abstract Monitor |
getMonitor() |
abstract RolapResultShepherd |
getResultShepherd() |
int |
getSchemaVersion()
Returns the schema version of this MondrianServer.
|
MondrianServer.MondrianVersion |
getVersion()
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.
|
public static MondrianServer forConnection(Connection connection)
connection
- Connection (not null)public static MondrianServer createWithRepository(RepositoryContentFinder contentFinder, CatalogLocator catalogLocator)
When creating a server, the calling code must call the
shutdown()
method to dispose of it.
contentFinder
- Repository content findercatalogLocator
- Catalog locatorpublic static MondrianServer forId(String instanceId)
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.
instanceId
- Server instance idpublic static void dispose(String instanceId)
instanceId
- The instance ID of the server
to shutdown gracefully.public abstract int getId()
public int getSchemaVersion()
public MondrianServer.MondrianVersion getVersion()
public abstract List<String> getKeywords()
public abstract RolapResultShepherd getResultShepherd()
public abstract LockBox getLockBox()
public abstract org.olap4j.OlapConnection getConnection(String catalogName, String schemaName, String roleName) throws SQLException, SecurityException
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.
catalogName
- Catalog nameschemaName
- Schema nameroleName
- User role nameSQLException
- If error occursSecurityException
- If security error occurspublic abstract org.olap4j.OlapConnection getConnection(String catalogName, String schemaName, String roleName, Properties props) throws SQLException, SecurityException
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
getLockBox()
and pass in the moniker
for the generated lock box entry. The server will retrieve the role from
the moniker.
catalogName
- Catalog nameschemaName
- Schema nameroleName
- User role nameprops
- Properties to pass down to the native driver.SQLException
- If error occursSecurityException
- If security error occurspublic abstract List<Map<String,Object>> getDatabases(RolapConnection connection)
connection
- Connectionpublic abstract CatalogLocator getCatalogLocator()
public abstract void shutdown()
public abstract void addConnection(RolapConnection connection)
connection
- Connectionpublic abstract void removeConnection(RolapConnection connection)
connection
- Connectionpublic abstract RolapConnection getConnection(int connectionId)
connectionId
- Connection id, per
RolapConnection.getId()
public abstract void addStatement(Statement statement)
statement
- Statementpublic abstract void removeStatement(Statement statement)
statement
- Statementpublic abstract Monitor getMonitor()
public abstract AggregationManager getAggregationManager()
Copyright © 2020 Hitachi Vantara. All rights reserved.