mondrian.server
Class MondrianServerImpl

java.lang.Object
  extended by mondrian.olap.MondrianServer
      extended by mondrian.server.MondrianServerImpl
All Implemented Interfaces:
CatalogFinder, XmlaHandler.ConnectionFactory

 class MondrianServerImpl
extends MondrianServer
implements CatalogFinder, XmlaHandler.ConnectionFactory

Implementation of MondrianServer.

Since:
Jun 25, 2006
Author:
jhyde

Nested Class Summary
 
Nested classes/interfaces inherited from class mondrian.olap.MondrianServer
MondrianServer.MondrianVersion
 
Constructor Summary
MondrianServerImpl(MondrianServerRegistry registry, Repository repository, CatalogLocator catalogLocator)
          Creates a MondrianServerImpl.
 
Method Summary
 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 of MondrianServer.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
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MondrianServerImpl

MondrianServerImpl(MondrianServerRegistry registry,
                   Repository repository,
                   CatalogLocator catalogLocator)
Creates a MondrianServerImpl.

Parameters:
registry - Registry of all servers in this JVM
repository - Repository of catalogs and schemas
catalogLocator - Catalog locator
Method Detail

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
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 class MondrianServer
Returns:
Server's unique identifier

getResultShepherd

public RolapResultShepherd getResultShepherd()
Specified by:
getResultShepherd in class MondrianServer

getKeywords

public List<String> getKeywords()
Description copied from class: MondrianServer
Returns a list of MDX keywords.

Specified by:
getKeywords in class MondrianServer
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 class MondrianServer
Returns:
Lock box for this server

getAggregationManager

public AggregationManager getAggregationManager()
Specified by:
getAggregationManager in class MondrianServer

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 class MondrianServer
Parameters:
databaseName - Catalog name
catalogName - Schema name
roleName - 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 of MondrianServer.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 interface XmlaHandler.ConnectionFactory
Specified by:
getConnection in class MondrianServer
Parameters:
databaseName - Catalog name
catalogName - Schema name
roleName - User role name
props - 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 interface CatalogFinder
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 class MondrianServer
Parameters:
connection - Connection
Returns:
List of data source definitions

getCatalogLocator

public CatalogLocator getCatalogLocator()
Specified by:
getCatalogLocator in class MondrianServer

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 class MondrianServer

addConnection

public void addConnection(RolapConnection connection)
Description copied from class: MondrianServer
Called just after a connection has been created.

Specified by:
addConnection in class MondrianServer
Parameters:
connection - Connection

removeConnection

public void removeConnection(RolapConnection connection)
Description copied from class: MondrianServer
Called when a connection is closed.

Specified by:
removeConnection in class MondrianServer
Parameters:
connection - Connection

getConnection

public RolapConnection getConnection(int connectionId)
Description copied from class: MondrianServer
Retrieves a connection.

Specified by:
getConnection in class MondrianServer
Parameters:
connectionId - Connection id, per RolapConnection.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 class MondrianServer
Parameters:
statement - Statement

removeStatement

public void removeStatement(Statement statement)
Description copied from class: MondrianServer
Called when a statement is closed.

Specified by:
removeStatement in class MondrianServer
Parameters:
statement - Statement

getMonitor

public Monitor getMonitor()
Specified by:
getMonitor in class MondrianServer

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 interface CatalogFinder
Parameters:
connection - Connection to mondrian
catalogName - 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 interface XmlaHandler.ConnectionFactory
Returns:
Column names and values for the DISCOVER_DATASOURCES response

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads