public class FileRepository extends Object implements Repository
Repository
that reads
from a datasources.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.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
FileRepository.CatalogInfo |
(package private) static class |
FileRepository.DatabaseInfo |
(package private) static class |
FileRepository.ServerInfo |
Constructor and Description |
---|
FileRepository(RepositoryContentFinder repositoryContentFinder,
CatalogLocator locator) |
Modifier and Type | Method and Description |
---|---|
List<String> |
getCatalogNames(RolapConnection connection,
String databaseName)
Returns a list of catalog names found in the repository.
|
(package private) OlapConnection |
getConnection(FileRepository.CatalogInfo catalogInfo,
MondrianServer server,
String roleName,
Properties props) |
OlapConnection |
getConnection(MondrianServer server,
String databaseName,
String catalogName,
String roleName,
Properties props)
Returns an OlapConnection object.
|
List<String> |
getDatabaseNames(RolapConnection connection)
Returns a list of database names found in this repository.
|
List<Map<String,Object>> |
getDatabases(RolapConnection connection)
Returns a list of databases properties collections,
one per database configured on this server.
|
(package private) RepositoryContentFinder |
getRepositoryContentFinder() |
Map<String,RolapSchema> |
getRolapSchemas(RolapConnection connection,
String databaseName,
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.
|
public FileRepository(RepositoryContentFinder repositoryContentFinder, CatalogLocator locator)
public List<Map<String,Object>> getDatabases(RolapConnection connection)
Repository
getDatabases
in interface Repository
connection
- The connection from which to obtain
the metadata. May be null or the Repository implementation
itself might ignore it.public OlapConnection getConnection(MondrianServer server, String databaseName, String catalogName, String roleName, Properties props) throws SQLException
Repository
getConnection
in interface Repository
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.SQLException
- If an error is encountered while
creating the connection.OlapConnection getConnection(FileRepository.CatalogInfo catalogInfo, MondrianServer server, String roleName, Properties props) throws SQLException
SQLException
public void shutdown()
Repository
shutdown
in interface Repository
FileRepository.ServerInfo getServerInfo()
public List<String> getCatalogNames(RolapConnection connection, String databaseName)
Repository
getCatalogNames
in interface Repository
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.public List<String> getDatabaseNames(RolapConnection connection)
Repository
getDatabaseNames
in interface Repository
connection
- A connection object from which to obtain
the metadata. May be null or the Repository implementation
itself might ignore it.public Map<String,RolapSchema> getRolapSchemas(RolapConnection connection, String databaseName, String catalogName)
Repository
getRolapSchemas
in interface Repository
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.RepositoryContentFinder getRepositoryContentFinder()