public class WorkspaceImpl extends AbstractWorkspace implements org.apache.jackrabbit.api.JackrabbitWorkspace, Workspace, EventStateCollectionFactory
WorkspaceImpl
...Modifier and Type | Field and Description |
---|---|
protected SessionContext |
context
The component context of this session.
|
protected CachingHierarchyManager |
hierMgr
The hierarchy mgr that reflects persistent state only
(i.e.
|
protected LockManager |
lockMgr
The
LockManager for this Workspace |
protected ObservationManagerImpl |
obsMgr
The
ObservationManager instance for this session. |
protected QueryManagerImpl |
queryManager
The
QueryManager for this Workspace . |
protected SessionImpl |
session
the session that was used to acquire this
Workspace |
protected LocalItemStateManager |
stateMgr
The persistent state mgr associated with the workspace represented by this
Workspace instance. |
protected VersionManagerImpl |
versionMgr
The API Version manager for this workspace
|
protected WorkspaceConfig |
wspConfig
The configuration of this
Workspace |
NAME_ACTIVITIES_NODE, NAME_CONFIGURATIONS_NODE, NAME_JCR_XMLCHARACTERS, NAME_JCR_XMLTEXT, NAME_NODE_TYPES_NODE, NAME_SYSTEM_NODE, NAME_UNFILED_NODE, NAME_VERSION_STORAGE_NODE, NAME_WORKSPACE_ROOT, PATH_ACTIVITIES_NODE, PATH_CONFIGURATIONS_NODE, PATH_NODE_TYPES_NODE, PATH_SYSTEM_NODE, PATH_UNFILED_NODE, PATH_VERSION_STORAGE_NODE, PATH_WORKSPACE_ROOT, RELPATH_JCR_XMLCHARACTERS
Constructor and Description |
---|
WorkspaceImpl(SessionContext context,
WorkspaceConfig wspConfig)
Creates a new workspace instance
|
Modifier and Type | Method and Description |
---|---|
void |
clone(String srcWorkspace,
String srcAbsPath,
String destAbsPath,
boolean removeExisting) |
void |
copy(String srcAbsPath,
String destAbsPath) |
void |
copy(String srcWorkspace,
String srcAbsPath,
String destAbsPath) |
EventStateCollection |
createEventStateCollection()
Creates an
EventStateCollection . |
protected LocalItemStateManager |
createItemStateManager()
Create the persistent item state manager on top of the shared item
state manager.
|
void |
createWorkspace(String name)
Creates a new
Workspace with the specified
name . |
void |
createWorkspace(String workspaceName,
InputSource configTemplate)
Creates a workspace with the given name and a workspace configuration
template.
|
void |
createWorkspace(String name,
String srcWorkspace) |
void |
deleteWorkspace(String name) |
String[] |
getAccessibleWorkspaceNames()
Returns the names of all workspaces of this repository with respect of the
access rights of this session.
|
WorkspaceConfig |
getConfig()
Returns the configuration of this workspace.
|
HierarchyManager |
getHierarchyManager()
The hierarchy manager that reflects workspace state only
(i.e.
|
ContentHandler |
getImportContentHandler(String parentAbsPath,
int uuidBehavior) |
LockManager |
getInternalLockManager()
Return the lock manager for this workspace.
|
LocalItemStateManager |
getItemStateManager()
Returns the item state manager associated with the workspace
represented by this
WorkspaceImpl instance. |
LockManager |
getLockManager() |
String |
getName() |
NamespaceRegistry |
getNamespaceRegistry() |
NodeTypeManager |
getNodeTypeManager() |
ObservationManager |
getObservationManager()
Returns the observation manager of this session.
|
org.apache.jackrabbit.api.security.authorization.PrivilegeManager |
getPrivilegeManager()
Return the
PrivilegeManager . |
QueryManager |
getQueryManager() |
Session |
getSession() |
protected SharedItemStateManager |
getSharedItemStateManager()
Returns the shared item state manager of this workspace.
|
VersionManager |
getVersionManager() |
void |
move(String srcAbsPath,
String destAbsPath) |
void |
restore(Version[] versions,
boolean removeExisting)
Deprecated.
|
void |
sanityCheck()
Performs a sanity check on this workspace and the associated session.
|
importXML
protected final SessionContext context
protected final WorkspaceConfig wspConfig
Workspace
protected final LocalItemStateManager stateMgr
Workspace
instance.protected final CachingHierarchyManager hierMgr
protected ObservationManagerImpl obsMgr
ObservationManager
instance for this session.protected QueryManagerImpl queryManager
QueryManager
for this Workspace
.protected final SessionImpl session
Workspace
protected LockManager lockMgr
LockManager
for this Workspace
protected VersionManagerImpl versionMgr
public WorkspaceImpl(SessionContext context, WorkspaceConfig wspConfig) throws RepositoryException
context
- component context of this sessionwspConfig
- The workspace configurationRepositoryException
- if the workspace can not be accessedpublic HierarchyManager getHierarchyManager()
public LocalItemStateManager getItemStateManager()
WorkspaceImpl
instance.public void sanityCheck() throws RepositoryException
RepositoryException
- if this workspace has been rendered invalid
for some reasonpublic void createWorkspace(String name, String srcWorkspace) throws AccessDeniedException, RepositoryException
createWorkspace
in interface Workspace
AccessDeniedException
RepositoryException
public void deleteWorkspace(String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException
Always throws UnsupportedRepositoryOperationException
since
removal of workspaces is currently not supported.
deleteWorkspace
in interface Workspace
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
public LockManager getLockManager() throws UnsupportedRepositoryOperationException, RepositoryException
getLockManager
in interface Workspace
UnsupportedRepositoryOperationException
RepositoryException
Workspace.getLockManager()
,
LockManager
public VersionManager getVersionManager()
getVersionManager
in interface Workspace
Workspace.getVersionManager()
public void createWorkspace(String name) throws AccessDeniedException, RepositoryException
Workspace
with the specified
name
. The new workspace is empty, meaning it contains only
root node.
The new workspace can be accessed through a login
specifying its name.
Throws an AccessDeniedException
if the session through which
this Workspace
object was acquired does not have permission
to create the new workspace.
Throws an UnsupportedRepositoryOperationException
if the repository does
not support the creation of workspaces.
A RepositoryException
is thrown if another error occurs.
createWorkspace
in interface Workspace
createWorkspace
in interface org.apache.jackrabbit.api.JackrabbitWorkspace
name
- A String
, the name of the new workspace.AccessDeniedException
- if the session through which
this Workspace
object was acquired does not have permission
to create the new workspace.RepositoryException
- if another error occurs.public void createWorkspace(String workspaceName, InputSource configTemplate) throws AccessDeniedException, RepositoryException
createWorkspace
in interface org.apache.jackrabbit.api.JackrabbitWorkspace
workspaceName
- name of the new workspaceconfigTemplate
- the configuration template of the new workspaceAccessDeniedException
- if the current session is not allowed to
create the workspaceRepositoryException
- if a workspace with the given name
already exists or if another error occursgetAccessibleWorkspaceNames()
public org.apache.jackrabbit.api.security.authorization.PrivilegeManager getPrivilegeManager() throws RepositoryException
PrivilegeManager
.getPrivilegeManager
in interface org.apache.jackrabbit.api.JackrabbitWorkspace
RepositoryException
JackrabbitWorkspace.getPrivilegeManager()
public WorkspaceConfig getConfig()
public LockManager getInternalLockManager() throws RepositoryException
RepositoryException
- if an error occurspublic Session getSession()
getSession
in interface Workspace
public NamespaceRegistry getNamespaceRegistry() throws RepositoryException
getNamespaceRegistry
in interface Workspace
RepositoryException
public NodeTypeManager getNodeTypeManager() throws RepositoryException
getNodeTypeManager
in interface Workspace
RepositoryException
public void clone(String srcWorkspace, String srcAbsPath, String destAbsPath, boolean removeExisting) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException
clone
in interface Workspace
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
public void copy(String srcAbsPath, String destAbsPath) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException
copy
in interface Workspace
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
public void copy(String srcWorkspace, String srcAbsPath, String destAbsPath) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException
copy
in interface Workspace
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
public void move(String srcAbsPath, String destAbsPath) throws ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, RepositoryException
move
in interface Workspace
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException
public ObservationManager getObservationManager()
getObservationManager
in interface Workspace
public QueryManager getQueryManager() throws RepositoryException
getQueryManager
in interface Workspace
RepositoryException
@Deprecated public void restore(Version[] versions, boolean removeExisting) throws ItemExistsException, UnsupportedRepositoryOperationException, VersionException, LockException, InvalidItemStateException, RepositoryException
restore
in interface Workspace
ItemExistsException
UnsupportedRepositoryOperationException
VersionException
LockException
InvalidItemStateException
RepositoryException
public String[] getAccessibleWorkspaceNames() throws RepositoryException
getAccessibleWorkspaceNames
in interface Workspace
RepositoryException
- if an error occurspublic ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
getImportContentHandler
in interface Workspace
PathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryException
protected SharedItemStateManager getSharedItemStateManager() throws RepositoryException
RepositoryException
- if the workspace can not be accessedprotected LocalItemStateManager createItemStateManager() throws RepositoryException
RepositoryException
- if the workspace can not be accessedpublic EventStateCollection createEventStateCollection() throws RepositoryException
EventStateCollection
.
Implemented in this object and forwarded rather than obsMgr
since creation of the latter is lazy.
createEventStateCollection
in interface EventStateCollectionFactory
EventStateCollection
RepositoryException
- if creation fails for some reasonCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.