public class OlapServiceImpl extends Object implements IOlapService
MondrianCatalogRepositoryHelper as a backend to
store the connection informations and uses DriverManager
to create the connections.
It will also check for the presence of a IConnectionUserRoleMapper
and change the roles accordingly before creating a connection.
This implementation is thread safe. It will use a ReadWriteLock
to manage the access to its metadata.
IOlapService.Catalog, IOlapService.Cube, IOlapService.Schema| Modifier and Type | Field and Description |
|---|---|
static String |
CATALOG_CACHE_REGION |
| Constructor and Description |
|---|
OlapServiceImpl()
Empty constructor.
|
OlapServiceImpl(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repo,
mondrian.olap.MondrianServer server)
Constructor for testing purposes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHostedCatalog(String name,
String dataSourceInfo,
InputStream inputStream,
boolean overwrite,
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 session)
Adds a generic olap4j catalog to this server.
|
void |
flushAll(org.pentaho.platform.api.engine.IPentahoSession session)
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 session)
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 session)
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 name,
org.pentaho.platform.api.engine.IPentahoSession session)
Removes a catalog from this server, whether hosted or remote.
|
void |
setConnectionFilters(Collection<IOlapConnectionFilter> filters) |
void |
setHelper(MondrianCatalogRepositoryHelper helper) |
void |
setMondrianRole(mondrian.olap.Role role) |
public static String CATALOG_CACHE_REGION
public OlapServiceImpl()
PentahoSystem to fetch the IUnifiedRepository
at runtime.public OlapServiceImpl(org.pentaho.platform.api.repository2.unified.IUnifiedRepository repo,
mondrian.olap.MondrianServer server)
public void setHelper(MondrianCatalogRepositoryHelper helper)
public void addHostedCatalog(String name, String dataSourceInfo, InputStream inputStream, boolean overwrite, org.pentaho.platform.api.engine.IPentahoSession session)
IOlapServiceaddHostedCatalog in interface IOlapServicename - NAme of the catalog to createdataSourceInfo - Connection properties. ie: Provider=mondrian;DataSource=SampleData.inputStream - Stream of the mondrian schema's XMLoverwrite - Whether to overwrite a catalog of the same name.session - Pentaho session to perform this task.public void addOlap4jCatalog(String name, String className, String URL, String user, String password, Properties props, boolean overwrite, org.pentaho.platform.api.engine.IPentahoSession session)
IOlapServiceaddOlap4jCatalog in interface IOlapServicename - 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.session - The session to use when creating the connection.public void removeCatalog(String name, org.pentaho.platform.api.engine.IPentahoSession session)
IOlapServiceremoveCatalog in interface IOlapServicename - Name of the catalog to delete.session - Session to use when deleting.public void flushAll(org.pentaho.platform.api.engine.IPentahoSession session)
IOlapServiceflushAll in interface IOlapServicepublic List<String> getCatalogNames(org.pentaho.platform.api.engine.IPentahoSession pentahoSession) throws IOlapServiceException
IOlapServiceThis method is much cheaper to invoke than
IOlapService.getCatalogs(IPentahoSession) since it doesn't
require the connection to be opened.
getCatalogNames in interface IOlapServicepentahoSession - The session asking for catalogs.IOlapServiceExceptionpublic List<IOlapService.Catalog> getCatalogs(org.pentaho.platform.api.engine.IPentahoSession session) throws IOlapServiceException
IOlapServicegetCatalogs in interface IOlapServicesession - The session asking for catalogs.IOlapServiceExceptionpublic List<IOlapService.Schema> getSchemas(String parentCatalog, org.pentaho.platform.api.engine.IPentahoSession session)
IOlapServicegetSchemas in interface IOlapServiceparentCatalog - The catalog to constrain the list of schemas, or null
to return the whole list.session - The session asking for schemas.public List<IOlapService.Cube> getCubes(String parentCatalog, String parentSchema, org.pentaho.platform.api.engine.IPentahoSession pentahoSession)
IOlapServicegetCubes in interface IOlapServiceparentCatalog - 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.public org.olap4j.OlapConnection getConnection(String catalogName, org.pentaho.platform.api.engine.IPentahoSession session) throws IOlapServiceException
IOlapServiceIOlapService.getCatalogs(IPentahoSession).getConnection in interface IOlapServiceIOlapServiceExceptionpublic void setConnectionFilters(Collection<IOlapConnectionFilter> filters)
public void setMondrianRole(mondrian.olap.Role role)