public interface RepositoryManager
Provider
s. Magnolia can be configured
to have its workspaces in more than one repository. This is abstracted through this class which maps a set of
"logical" workspace names to their actual "physical" workspace names in a repository.
Configuration of providers and workspace mappings are done in repositories.xml.Provider
,
RepositoryMappingDefinitionReader
Modifier and Type | Method and Description |
---|---|
void |
addWorkspaceMapping(WorkspaceMappingDefinition mapping) |
boolean |
checkIfInitialized()
Verify the initialization state of all the workspaces.
|
boolean |
checkIfInitialized(String logicalWorkspace)
Verifies the initialization state of a workspace.
|
void |
createWorkspace(String repository,
String logicalWorkspaceName)
Registers permanently new workspace and makes it available in Magnolia.
|
javax.jcr.Repository |
getRepository(String repositoryId)
Returns repository instance for a repository.
|
RepositoryDefinition |
getRepositoryDefinition(String repositoryId)
Returns repository mapping as configured, or null if not found.
|
Collection<RepositoryDefinition> |
getRepositoryDefinitions() |
String |
getRepositoryNameForWorkspace(String logicalWorkspaceName) |
Provider |
getRepositoryProvider(String repositoryId)
Returns the provider instance for a repository.
|
javax.jcr.Session |
getSession(String logicalWorkspaceName,
javax.jcr.Credentials credentials) |
javax.jcr.Session |
getSystemSession(String logicalWorkspaceName) |
WorkspaceMappingDefinition |
getWorkspaceMapping(String logicalWorkspaceName) |
Collection<WorkspaceMappingDefinition> |
getWorkspaceMappings() |
Collection<String> |
getWorkspaceNames()
Returns workspace names.
|
boolean |
hasRepository(String repositoryId) |
boolean |
hasWorkspace(String logicalWorkspaceName) |
void |
init()
Initializes by loading configuration from repositories.xml.
|
void |
loadRepository(RepositoryDefinition definition)
Adds a repository definition and instantiates its provider.
|
void |
loadWorkspace(String repositoryId,
String physicalWorkspaceName)
Loads a workspace by registering namespaces and node types on a workspace that has not previously been loaded.
|
void |
reload()
Re-load all configured repositories.
|
void |
shutdown()
Shuts down all repositories (through Provider instances) and clears all mappings.
|
void init()
void shutdown()
void reload()
init()
javax.jcr.Session getSession(String logicalWorkspaceName, javax.jcr.Credentials credentials) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
javax.jcr.Session getSystemSession(String logicalWorkspaceName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
boolean checkIfInitialized() throws javax.jcr.RepositoryException
false
only if
all the workspaces are empty (no node else than the root one).false
if all the workspaces are empty, true
if at least one of them has content.javax.jcr.RepositoryException
- exception while accessing the repositoryboolean checkIfInitialized(String logicalWorkspace) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
void loadRepository(RepositoryDefinition definition) throws RepositoryNotInitializedException, InstantiationException, IllegalAccessException, ClassNotFoundException
void loadWorkspace(String repositoryId, String physicalWorkspaceName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
boolean hasRepository(String repositoryId)
RepositoryDefinition getRepositoryDefinition(String repositoryId)
Provider getRepositoryProvider(String repositoryId)
IllegalArgumentException
- if there is no such repositoryjavax.jcr.Repository getRepository(String repositoryId)
IllegalArgumentException
- if there is no such repositoryvoid addWorkspaceMapping(WorkspaceMappingDefinition mapping)
boolean hasWorkspace(String logicalWorkspaceName)
Collection<WorkspaceMappingDefinition> getWorkspaceMappings()
WorkspaceMappingDefinition getWorkspaceMapping(String logicalWorkspaceName)
Collection<RepositoryDefinition> getRepositoryDefinitions()
Collection<String> getWorkspaceNames()
void createWorkspace(String repository, String logicalWorkspaceName) throws javax.jcr.RepositoryException
repository
- Repository name.logicalWorkspaceName
- Workspace name.javax.jcr.RepositoryException
Copyright © 2003–2017 Magnolia International Ltd.. All rights reserved.