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 {@link #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 {@link #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 {@link #getCatalogNames(IPentahoSession)} is the cheap and fast method.It will return a list of the catalog names available. For more metadata, one can use {@link #getCatalogs(IPentahoSession)}, {@link #getSchemas(String,IPentahoSession)}or {@link #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.
|
|
|
|
|
|