|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.repository.DefaultRepositoryManager
@Singleton public final class DefaultRepositoryManager
Manages all used Repositories.
Constructor Summary | |
---|---|
DefaultRepositoryManager()
|
Method Summary | |
---|---|
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. |
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultRepositoryManager()
Method Detail |
---|
public void init()
RepositoryManager
init
in interface RepositoryManager
public void shutdown()
RepositoryManager
shutdown
in interface RepositoryManager
public boolean checkIfInitialized() throws AccessDeniedException, 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.
AccessDeniedException
- repository authentication failed
javax.jcr.RepositoryException
- exception while accessing the repositorypublic boolean checkIfInitialized(String logicalWorkspace) throws javax.jcr.RepositoryException, AccessDeniedException
RepositoryManager
checkIfInitialized
in interface RepositoryManager
javax.jcr.RepositoryException
AccessDeniedException
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 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |