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
Version:
$Id: //open/mondrian/src/main/mondrian/server/MondrianServerImpl.java#5 $
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
 CatalogLocator getCatalogLocator()
           
 List<String> getCatalogNames(RolapConnection connection)
          Returns a list of catalogs.
 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.
 String getId()
          Returns a string 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.
 Map<String,Object> getPreConfiguredDiscoverDatasourcesResponse()
          Returns a map of property name-value pairs with which to populate the response to the DISCOVER_DATASOURCES request.
 Map<String,RolapSchema> getRolapSchemas(RolapConnection connection, String catalogName)
          Returns a list of (schema name, schema) pairs in a catalog of a particular name.
 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, finalize, 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

getId

public String getId()
Description copied from class: MondrianServer
Returns a string uniquely identifying this server within its JVM.

Specified by:
getId in class MondrianServer
Returns:
Server's unique identifier

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

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

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