Interface IOlapService
-
- All Known Implementing Classes:
OlapServiceImpl
public interface IOlapService
This service manages the hosted OLAP connections, implemented with Mondrian, as well as other generic olap4j connections.There are two types of connections that you can create. Either
- Hosted locally by the local Mondrian server instance
- Hosted by some other OLAP server and configured as a generic olap4j connection.
Whether hosted or generic, the OLAP connections must not share the same name.
To create a hosted connection, you must use the method
addHostedCatalog(String, String, InputStream, boolean, IPentahoSession)
. The InputStream parameter must be pointing to a Mondrian schema file.When a hosted connection is added, the service will also attempt to use the IConnectionUserRoleMapper, if one is configured.
To create a generic connection, use the method
addOlap4jCatalog(String, String, String, String, String, Properties, boolean, IPentahoSession)
. The parameters are the standard ones used by JDBC and will be passed to the java.sql.DriverManager as-is.To obtain a list of the configured catalogs, there are a few options. Calling
getCatalogNames(IPentahoSession)
is the cheap and fast method. It will return a list of the catalog names available. For more metadata, one can usegetCatalogs(IPentahoSession)
,getSchemas(String, IPentahoSession)
orgetCubes(String, String, IPentahoSession)
. These alternative methods come at a higher price, since we will need to activate each of the configured connections to populate the metadata.Throughout the API, it is possible to pass a user's session. In that case, only the catalogs which are accessible to the specified user will be available. Passing 'null' as the sesison has the effect of granting root access and will allow access to all catalogs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IOlapService.Catalog
Representation of a catalog.static class
IOlapService.Cube
Representation of a Cube with its parentIOlapService.Schema
.static class
IOlapService.Schema
Representation of a schema.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addHostedCatalog(String name, String dataSourceInfo, InputStream inputStream, boolean overwriteInRepossitory, org.pentaho.platform.api.engine.IPentahoSession session)
Adds a hosted catalog on this server.void
addOlap4jCatalog(String name, String className, String URL, String user, String password, Properties props, boolean overwrite, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Adds a generic olap4j catalog to this server.void
flush(org.pentaho.platform.api.engine.IPentahoSession pentahoSession, String name)
Flushes a single schema from the cache.void
flushAll(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Flushes all schema caches.List<String>
getCatalogNames(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Provides a list of catalog names known to this server, whether local or remote.List<IOlapService.Catalog>
getCatalogs(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Provides a list of catalogs known to this server, whether local or remote.org.olap4j.OlapConnection
getConnection(String catalogName, org.pentaho.platform.api.engine.IPentahoSession session)
Provides olap connections to a named catalog.List<IOlapService.Cube>
getCubes(String parentCatalog, String parentSchema, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Provides a list of the available cubes, whether constrained to a particular catalog and/or schema or not.List<IOlapService.Schema>
getSchemas(String parentCatalog, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Provides a list of the available schemas, whether constrained to a particular catalog or not, represented as a tree of the schema and all of its cubes.void
removeCatalog(String catalogName, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Removes a catalog from this server, whether hosted or remote.
-
-
-
Method Detail
-
getConnection
org.olap4j.OlapConnection getConnection(String catalogName, org.pentaho.platform.api.engine.IPentahoSession session) throws IOlapServiceException
Provides olap connections to a named catalog. For a list of available catalogs, seegetCatalogs(IPentahoSession)
.- Throws:
IOlapServiceException
-
addHostedCatalog
void addHostedCatalog(String name, String dataSourceInfo, InputStream inputStream, boolean overwriteInRepossitory, org.pentaho.platform.api.engine.IPentahoSession session) throws IOlapServiceException
Adds a hosted catalog on this server.- Parameters:
name
- NAme of the catalog to createdataSourceInfo
- Connection properties. ie: Provider=mondrian;DataSource=SampleData.inputStream
- Stream of the mondrian schema's XMLoverwriteInRepossitory
- Whether to overwrite a catalog of the same name.session
- Pentaho session to perform this task.- Throws:
IOlapServiceException
-
addOlap4jCatalog
void addOlap4jCatalog(String name, String className, String URL, String user, String password, Properties props, boolean overwrite, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
Adds a generic olap4j catalog to this server.- Parameters:
name
- Name of the catalog to useclassName
- The class of the driver to use. Must be an implementation of java.sql.Driver.URL
- The URL to use.user
- Username to use when connecting.password
- Password to use when connecting.props
- Extra connection parameters to pass.overwrite
- Whether to overwrite the catalog if it exists.pentahoSession
- The session to use when creating the connection.- Throws:
IOlapServiceException
-
getCatalogNames
List<String> getCatalogNames(org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
Provides a list of catalog names known to this server, whether local or remote.This method is much cheaper to invoke than
getCatalogs(IPentahoSession)
since it doesn't require the connection to be opened.- Parameters:
pentahoSession
- The session asking for catalogs.- Throws:
IOlapServiceException
-
getCatalogs
List<IOlapService.Catalog> getCatalogs(org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
Provides a list of catalogs known to this server, whether local or remote. Returns a tree, rooted at the catalog, representing all of the schemas and cubes included in this catalog.- Parameters:
pentahoSession
- The session asking for catalogs.- Throws:
IOlapServiceException
-
getSchemas
List<IOlapService.Schema> getSchemas(String parentCatalog, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
Provides a list of the available schemas, whether constrained to a particular catalog or not, represented as a tree of the schema and all of its cubes.- Parameters:
parentCatalog
- The catalog to constrain the list of schemas, or null to return the whole list.pentahoSession
- The session asking for schemas.- Returns:
- A list of schemas.
- Throws:
IOlapServiceException
-
getCubes
List<IOlapService.Cube> getCubes(String parentCatalog, String parentSchema, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Provides a list of the available cubes, whether constrained to a particular catalog and/or schema or not.- Parameters:
parentCatalog
- The catalog to constrain the list of cubes, or null to return the whole list.parentSchema
- The schema to constrain the list of cubes, or null to return the whole list.pentahoSession
- The session asking for cubes.- Returns:
- A list of cubes.
-
removeCatalog
void removeCatalog(String catalogName, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
Removes a catalog from this server, whether hosted or remote.- Parameters:
catalogName
- Name of the catalog to delete.pentahoSession
- Session to use when deleting.- Throws:
IOlapServiceException
-
flushAll
void flushAll(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
Flushes all schema caches.
-
flush
void flush(org.pentaho.platform.api.engine.IPentahoSession pentahoSession, String name)
Flushes a single schema from the cache. The schema must be in a hosted catalog.
-
-