|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RepositoryManager
Manages JCR repositories. Initialization of a repository is handled by 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
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. |
Method Detail |
---|
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 AccessDeniedException, 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.
AccessDeniedException
- repository authentication failed
javax.jcr.RepositoryException
- exception while accessing the repositoryboolean checkIfInitialized(String logicalWorkspace) throws javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.RepositoryException
AccessDeniedException
void loadRepository(RepositoryDefinition definition) throws RepositoryNotInitializedException, InstantiationException, IllegalAccessException, ClassNotFoundException
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<String> getWorkspaceNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |