@Singleton public final class DefaultRepositoryManager extends Object implements RepositoryManager
Constructor and Description |
---|
DefaultRepositoryManager()
Deprecated.
since 5.3.11 - use
DefaultRepositoryManager(MagnoliaConfigurationProperties) instead. |
DefaultRepositoryManager(MagnoliaConfigurationProperties magnoliaConfigurationProperties,
WorkspaceMapping workspaceMapping) |
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.
|
boolean |
isClusteredWorkspace(String workspace)
Verify that workspace exists in clustered repository.
|
boolean |
isClusterMaster() |
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.
|
@Deprecated public DefaultRepositoryManager()
DefaultRepositoryManager(MagnoliaConfigurationProperties)
instead.@Inject public DefaultRepositoryManager(MagnoliaConfigurationProperties magnoliaConfigurationProperties, WorkspaceMapping workspaceMapping)
public void init()
RepositoryManager
init
in interface RepositoryManager
public void shutdown()
RepositoryManager
shutdown
in interface RepositoryManager
public boolean checkIfInitialized() throws javax.jcr.RepositoryException
RepositoryManager
false
only if
all the workspaces are empty (no node else than the root one).checkIfInitialized
in interface RepositoryManager
false
if all the workspaces are empty, true
if at least one of them has content.javax.jcr.RepositoryException
- exception while accessing the repositorypublic boolean checkIfInitialized(String logicalWorkspace) throws javax.jcr.RepositoryException
RepositoryManager
checkIfInitialized
in interface RepositoryManager
javax.jcr.RepositoryException
public void reload()
RepositoryManager
reload
in interface RepositoryManager
RepositoryManager.init()
public void loadRepository(RepositoryDefinition definition) throws RepositoryNotInitializedException, InstantiationException, IllegalAccessException, ClassNotFoundException
RepositoryManager
loadRepository
in interface RepositoryManager
RepositoryNotInitializedException
InstantiationException
IllegalAccessException
ClassNotFoundException
public void loadWorkspace(String repositoryId, String physicalWorkspaceName) throws javax.jcr.RepositoryException
RepositoryManager
loadWorkspace
in interface RepositoryManager
javax.jcr.RepositoryException
public javax.jcr.Session getSession(String logicalWorkspaceName, javax.jcr.Credentials credentials) throws javax.jcr.RepositoryException
getSession
in interface RepositoryManager
javax.jcr.RepositoryException
public javax.jcr.Session getSystemSession(String logicalWorkspaceName) throws javax.jcr.RepositoryException
getSystemSession
in interface RepositoryManager
javax.jcr.RepositoryException
public void createWorkspace(String repository, String logicalWorkspaceName) throws javax.jcr.RepositoryException
RepositoryManager
createWorkspace
in interface RepositoryManager
repository
- Repository name.logicalWorkspaceName
- Workspace name.javax.jcr.RepositoryException
public String getRepositoryNameForWorkspace(String logicalWorkspaceName)
getRepositoryNameForWorkspace
in interface RepositoryManager
public boolean hasRepository(String repositoryId)
hasRepository
in interface RepositoryManager
public RepositoryDefinition getRepositoryDefinition(String repositoryId)
RepositoryManager
getRepositoryDefinition
in interface RepositoryManager
public Provider getRepositoryProvider(String repositoryId)
RepositoryManager
getRepositoryProvider
in interface RepositoryManager
public javax.jcr.Repository getRepository(String repositoryId)
RepositoryManager
getRepository
in interface RepositoryManager
public void addWorkspaceMapping(WorkspaceMappingDefinition mapping)
addWorkspaceMapping
in interface RepositoryManager
public boolean hasWorkspace(String logicalWorkspaceName)
hasWorkspace
in interface RepositoryManager
public Collection<WorkspaceMappingDefinition> getWorkspaceMappings()
getWorkspaceMappings
in interface RepositoryManager
public WorkspaceMappingDefinition getWorkspaceMapping(String logicalWorkspaceName)
getWorkspaceMapping
in interface RepositoryManager
public Collection<String> getWorkspaceNames()
RepositoryManager
getWorkspaceNames
in interface RepositoryManager
public Collection<RepositoryDefinition> getRepositoryDefinitions()
getRepositoryDefinitions
in interface RepositoryManager
public boolean isClusteredWorkspace(String workspace)
workspace
- The name of the workspacetrue
if workspace is a shared workspace that is configured in a clustered repositorypublic boolean isClusterMaster()
Copyright © 2003–2017 Magnolia International Ltd.. All rights reserved.