public class WorkspaceImpl extends AbstractWorkspace implements JackrabbitWorkspace, javax.jcr.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. |
javax.jcr.lock.LockManager |
getLockManager() |
String |
getName() |
javax.jcr.NamespaceRegistry |
getNamespaceRegistry() |
javax.jcr.nodetype.NodeTypeManager |
getNodeTypeManager() |
javax.jcr.observation.ObservationManager |
getObservationManager()
Returns the observation manager of this session.
|
PrivilegeManager |
getPrivilegeManager()
Return the
PrivilegeManager . |
javax.jcr.query.QueryManager |
getQueryManager() |
javax.jcr.Session |
getSession() |
protected SharedItemStateManager |
getSharedItemStateManager()
Returns the shared item state manager of this workspace.
|
javax.jcr.version.VersionManager |
getVersionManager() |
void |
move(String srcAbsPath,
String destAbsPath) |
void |
restore(javax.jcr.version.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 javax.jcr.RepositoryException
context
- component context of this sessionwspConfig
- The workspace configurationjavax.jcr.RepositoryException
- if the workspace can not be accessedpublic HierarchyManager getHierarchyManager()
public LocalItemStateManager getItemStateManager()
WorkspaceImpl
instance.public void sanityCheck() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if this workspace has been rendered invalid
for some reasonpublic void createWorkspace(String name, String srcWorkspace) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
createWorkspace
in interface javax.jcr.Workspace
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException
public void deleteWorkspace(String name) throws javax.jcr.AccessDeniedException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
Always throws UnsupportedRepositoryOperationException
since
removal of workspaces is currently not supported.
deleteWorkspace
in interface javax.jcr.Workspace
javax.jcr.AccessDeniedException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
public javax.jcr.lock.LockManager getLockManager() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
getLockManager
in interface javax.jcr.Workspace
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
Workspace.getLockManager()
,
LockManager
public javax.jcr.version.VersionManager getVersionManager()
getVersionManager
in interface javax.jcr.Workspace
Workspace.getVersionManager()
public void createWorkspace(String name) throws javax.jcr.AccessDeniedException, javax.jcr.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 javax.jcr.Workspace
createWorkspace
in interface JackrabbitWorkspace
name
- A String
, the name of the new workspace.javax.jcr.AccessDeniedException
- if the session through which
this Workspace
object was acquired does not have permission
to create the new workspace.javax.jcr.RepositoryException
- if another error occurs.Workspace.getAccessibleWorkspaceNames()
public void createWorkspace(String workspaceName, InputSource configTemplate) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
createWorkspace
in interface JackrabbitWorkspace
workspaceName
- name of the new workspaceconfigTemplate
- the configuration template of the new workspacejavax.jcr.AccessDeniedException
- if the current session is not allowed to
create the workspacejavax.jcr.RepositoryException
- if a workspace with the given name
already exists or if another error occursgetAccessibleWorkspaceNames()
public PrivilegeManager getPrivilegeManager() throws javax.jcr.RepositoryException
PrivilegeManager
.getPrivilegeManager
in interface JackrabbitWorkspace
javax.jcr.RepositoryException
JackrabbitWorkspace.getPrivilegeManager()
public WorkspaceConfig getConfig()
public LockManager getInternalLockManager() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occurspublic String getName()
getName
in interface javax.jcr.Workspace
public javax.jcr.Session getSession()
getSession
in interface javax.jcr.Workspace
public javax.jcr.NamespaceRegistry getNamespaceRegistry() throws javax.jcr.RepositoryException
getNamespaceRegistry
in interface javax.jcr.Workspace
javax.jcr.RepositoryException
public javax.jcr.nodetype.NodeTypeManager getNodeTypeManager() throws javax.jcr.RepositoryException
getNodeTypeManager
in interface javax.jcr.Workspace
javax.jcr.RepositoryException
public void clone(String srcWorkspace, String srcAbsPath, String destAbsPath, boolean removeExisting) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.version.VersionException, javax.jcr.AccessDeniedException, javax.jcr.PathNotFoundException, javax.jcr.ItemExistsException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
clone
in interface javax.jcr.Workspace
javax.jcr.NoSuchWorkspaceException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public void copy(String srcAbsPath, String destAbsPath) throws javax.jcr.nodetype.ConstraintViolationException, javax.jcr.version.VersionException, javax.jcr.AccessDeniedException, javax.jcr.PathNotFoundException, javax.jcr.ItemExistsException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
copy
in interface javax.jcr.Workspace
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public void copy(String srcWorkspace, String srcAbsPath, String destAbsPath) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.version.VersionException, javax.jcr.AccessDeniedException, javax.jcr.PathNotFoundException, javax.jcr.ItemExistsException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
copy
in interface javax.jcr.Workspace
javax.jcr.NoSuchWorkspaceException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public void move(String srcAbsPath, String destAbsPath) throws javax.jcr.nodetype.ConstraintViolationException, javax.jcr.version.VersionException, javax.jcr.AccessDeniedException, javax.jcr.PathNotFoundException, javax.jcr.ItemExistsException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
move
in interface javax.jcr.Workspace
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
public javax.jcr.observation.ObservationManager getObservationManager()
getObservationManager
in interface javax.jcr.Workspace
public javax.jcr.query.QueryManager getQueryManager() throws javax.jcr.RepositoryException
getQueryManager
in interface javax.jcr.Workspace
javax.jcr.RepositoryException
@Deprecated public void restore(javax.jcr.version.Version[] versions, boolean removeExisting) throws javax.jcr.ItemExistsException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.InvalidItemStateException, javax.jcr.RepositoryException
restore
in interface javax.jcr.Workspace
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
public String[] getAccessibleWorkspaceNames() throws javax.jcr.RepositoryException
getAccessibleWorkspaceNames
in interface javax.jcr.Workspace
javax.jcr.RepositoryException
- if an error occurspublic ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws javax.jcr.PathNotFoundException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
getImportContentHandler
in interface javax.jcr.Workspace
javax.jcr.PathNotFoundException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
protected SharedItemStateManager getSharedItemStateManager() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if the workspace can not be accessedprotected LocalItemStateManager createItemStateManager() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if the workspace can not be accessedpublic EventStateCollection createEventStateCollection() throws javax.jcr.RepositoryException
EventStateCollection
.
Implemented in this object and forwarded rather than obsMgr
since creation of the latter is lazy.
createEventStateCollection
in interface EventStateCollectionFactory
EventStateCollection
javax.jcr.RepositoryException
- if creation fails for some reasonCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.