Package mondrian.server
Class FileRepository
- java.lang.Object
-
- mondrian.server.FileRepository
-
- All Implemented Interfaces:
Repository
public class FileRepository extends java.lang.Object implements Repository
Implementation ofRepository
that reads from adatasources.xml
file.Note that for legacy reasons, the datasources.xml file's root element is called DataSource whereas the olap4j standard calls them Databases. This is why those two concepts are linked, as in
getDatabaseNames(RolapConnection)
for example.- Author:
- Julian Hyde, Luc Boudreau
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
FileRepository.CatalogInfo
(package private) static class
FileRepository.DatabaseInfo
(package private) static class
FileRepository.ServerInfo
-
Constructor Summary
Constructors Constructor Description FileRepository(RepositoryContentFinder repositoryContentFinder, CatalogLocator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getCatalogNames(RolapConnection connection, java.lang.String databaseName)
Returns a list of catalog names found in the repository.OlapConnection
getConnection(MondrianServer server, java.lang.String databaseName, java.lang.String catalogName, java.lang.String roleName, java.util.Properties props)
Returns an OlapConnection object.(package private) OlapConnection
getConnection(FileRepository.CatalogInfo catalogInfo, MondrianServer server, java.lang.String roleName, java.util.Properties props)
java.util.List<java.lang.String>
getDatabaseNames(RolapConnection connection)
Returns a list of database names found in this repository.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
getDatabases(RolapConnection connection)
Returns a list of databases properties collections, one per database configured on this server.(package private) RepositoryContentFinder
getRepositoryContentFinder()
java.util.Map<java.lang.String,RolapSchema>
getRolapSchemas(RolapConnection connection, java.lang.String databaseName, java.lang.String catalogName)
Must return a map of schema names and schema objects who are children of the specified datasource and catalog.(package private) FileRepository.ServerInfo
getServerInfo()
void
shutdown()
Shuts down and terminates a repository.
-
-
-
Constructor Detail
-
FileRepository
public FileRepository(RepositoryContentFinder repositoryContentFinder, CatalogLocator locator)
-
-
Method Detail
-
getDatabases
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> getDatabases(RolapConnection connection)
Description copied from interface:Repository
Returns a list of databases properties collections, one per database configured on this server.- Specified by:
getDatabases
in interfaceRepository
- Parameters:
connection
- The connection from which to obtain the metadata. May be null or the Repository implementation itself might ignore it.- Returns:
- A list of databases properties collections
-
getConnection
public OlapConnection getConnection(MondrianServer server, java.lang.String databaseName, java.lang.String catalogName, java.lang.String roleName, java.util.Properties props) throws java.sql.SQLException
Description copied from interface:Repository
Returns an OlapConnection object.- Specified by:
getConnection
in interfaceRepository
- Parameters:
server
- The MondrianServer to use.databaseName
- The database name. Can be null.catalogName
- The catalog name. Can be null.roleName
- The role name. Can be null.props
- Additional connection properties.- Returns:
- An opened olap connection.
- Throws:
java.sql.SQLException
- If an error is encountered while creating the connection.
-
getConnection
OlapConnection getConnection(FileRepository.CatalogInfo catalogInfo, MondrianServer server, java.lang.String roleName, java.util.Properties props) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
shutdown
public void shutdown()
Description copied from interface:Repository
Shuts down and terminates a repository.- Specified by:
shutdown
in interfaceRepository
-
getServerInfo
FileRepository.ServerInfo getServerInfo()
-
getCatalogNames
public java.util.List<java.lang.String> getCatalogNames(RolapConnection connection, java.lang.String databaseName)
Description copied from interface:Repository
Returns a list of catalog names found in the repository.- Specified by:
getCatalogNames
in interfaceRepository
- Parameters:
connection
- A connection object from which to obtain the metadata. May be null or the Repository implementation itself might ignore it.databaseName
- The parent database name of which we want to list the catalogs.- Returns:
- A list of catalog names found in this repository.
-
getDatabaseNames
public java.util.List<java.lang.String> getDatabaseNames(RolapConnection connection)
Description copied from interface:Repository
Returns a list of database names found in this repository.- Specified by:
getDatabaseNames
in interfaceRepository
- Parameters:
connection
- A connection object from which to obtain the metadata. May be null or the Repository implementation itself might ignore it.- Returns:
- A list of database names found in this repository.
-
getRolapSchemas
public java.util.Map<java.lang.String,RolapSchema> getRolapSchemas(RolapConnection connection, java.lang.String databaseName, java.lang.String catalogName)
Description copied from interface:Repository
Must return a map of schema names and schema objects who are children of the specified datasource and catalog.- Specified by:
getRolapSchemas
in interfaceRepository
- Parameters:
connection
- The connection from which to obtain the metadata. May be null or the Repository implementation itself might ignore it.databaseName
- The database name predicate for the list of returned schemas.catalogName
- The catalog name predicate for the list of returned schemas.- Returns:
- A map of schema names associated to schema objects, as found in the repository..
-
getRepositoryContentFinder
RepositoryContentFinder getRepositoryContentFinder()
-
-