public interface IOlapService
There are two types of connections that you can create. Either
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
use getCatalogs(IPentahoSession)
, getSchemas(String, IPentahoSession)
or getCubes(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.
Modifier and Type | Interface and Description |
---|---|
static class |
IOlapService.Catalog
Representation of a catalog.
|
static class |
IOlapService.Cube
Representation of a Cube with its parent
IOlapService.Schema . |
static class |
IOlapService.Schema
Representation of a schema.
|
Modifier and Type | Method and 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.
|
org.olap4j.OlapConnection getConnection(String catalogName, org.pentaho.platform.api.engine.IPentahoSession session) throws IOlapServiceException
getCatalogs(IPentahoSession)
.IOlapServiceException
void addHostedCatalog(String name, String dataSourceInfo, InputStream inputStream, boolean overwriteInRepossitory, org.pentaho.platform.api.engine.IPentahoSession session) throws IOlapServiceException
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.IOlapServiceException
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
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.IOlapServiceException
List<String> getCatalogNames(org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
This method is much cheaper to invoke than
getCatalogs(IPentahoSession)
since it doesn't
require the connection to be opened.
pentahoSession
- The session asking for catalogs.IOlapServiceException
List<IOlapService.Catalog> getCatalogs(org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
pentahoSession
- The session asking for catalogs.IOlapServiceException
List<IOlapService.Schema> getSchemas(String parentCatalog, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
parentCatalog
- The catalog to constrain the list of schemas, or null
to return the whole list.pentahoSession
- The session asking for schemas.IOlapServiceException
List<IOlapService.Cube> getCubes(String parentCatalog, String parentSchema, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
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.void removeCatalog(String catalogName, org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
catalogName
- Name of the catalog to delete.pentahoSession
- Session to use when deleting.IOlapServiceException
void flushAll(org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
void flush(org.pentaho.platform.api.engine.IPentahoSession pentahoSession, String name)
Copyright © 2021 Hitachi Vantara. All rights reserved.