org.apache.jackrabbit.core
Class WorkspaceImpl

java.lang.Object
  extended by org.apache.jackrabbit.commons.AbstractWorkspace
      extended by org.apache.jackrabbit.core.WorkspaceImpl
All Implemented Interfaces:
Workspace, JackrabbitWorkspace, EventStateCollectionFactory
Direct Known Subclasses:
XAWorkspace

public class WorkspaceImpl
extends AbstractWorkspace
implements JackrabbitWorkspace, EventStateCollectionFactory

A WorkspaceImpl ...


Field Summary
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  RepositoryImpl rep
          The repository that created this workspace instance
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  WorkspaceConfig wspConfig
          The configuration of this Workspace
 
Constructor Summary
protected WorkspaceImpl(WorkspaceConfig wspConfig, SharedItemStateManager stateMgr, RepositoryImpl rep, SessionImpl session)
          Protected constructor.
 
Method Summary
 void clone(String srcWorkspace, String srcAbsPath, String destAbsPath, boolean removeExisting)
          
 String clone283(String srcWorkspace, String srcAbsPath, String destAbsPath, boolean removeExisting)
          Clones the subtree at the node srcAbsPath in srcWorkspace to the new location at destAbsPath in this workspace.
 void copy(String srcAbsPath, String destAbsPath)
          
 void copy(String srcWorkspace, String srcAbsPath, String destAbsPath)
          
 String copy283(String srcAbsPath, String destAbsPath)
          This method copies the node at srcAbsPath to the new location at destAbsPath.
 String copy283(String srcWorkspace, String srcAbsPath, String destAbsPath)
          This method copies the subtree at srcAbsPath in srcWorkspace to destAbsPath in this workspace.
 EventStateCollection createEventStateCollection()
          Creates an EventStateCollection.

Implemented in this object and forwarded rather than obsMgr since creation of the latter is lazy.

protected  LocalItemStateManager createItemStateManager(SharedItemStateManager shared)
          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)
          Creates a new Workspace with the specified name initialized with a clone of the content of the workspace srcWorkspace.
 void deleteWorkspace(String name)
          Deletes the workspace with the specified name from the repository, deleting all content within it.
 String[] getAccessibleWorkspaceNames()
          
 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)
          
 LocalItemStateManager getItemStateManager()
          Returns the item state manager associated with the workspace represented by this WorkspaceImpl instance.
 LockManager getLockManager()
          Return the lock manager for this workspace.
 String getName()
          
 NamespaceRegistry getNamespaceRegistry()
          
 NodeTypeManager getNodeTypeManager()
          
 ObservationManager getObservationManager()
          Returns the observation manager of this session.
 QueryManager getQueryManager()
          
 Session getSession()
          
 void move(String srcAbsPath, String destAbsPath)
          
 String move283(String srcAbsPath, String destAbsPath)
          Moves the node at srcAbsPath (and its entire subtree) to the new location at destAbsPath.
 void restore(Version[] versions, boolean removeExisting)
          
 void sanityCheck()
          Performs a sanity check on this workspace and the associated session.
 
Methods inherited from class org.apache.jackrabbit.commons.AbstractWorkspace
importXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Workspace
importXML
 

Field Detail

wspConfig

protected final WorkspaceConfig wspConfig
The configuration of this Workspace


rep

protected final RepositoryImpl rep
The repository that created this workspace instance


stateMgr

protected final LocalItemStateManager stateMgr
The persistent state mgr associated with the workspace represented by this Workspace instance.


hierMgr

protected final CachingHierarchyManager hierMgr
The hierarchy mgr that reflects persistent state only (i.e. that is isolated from transient changes made through the session).


obsMgr

protected ObservationManagerImpl obsMgr
The ObservationManager instance for this session.


queryManager

protected QueryManagerImpl queryManager
The QueryManager for this Workspace.


session

protected final SessionImpl session
the session that was used to acquire this Workspace


lockMgr

protected LockManager lockMgr
The LockManager for this Workspace

Constructor Detail

WorkspaceImpl

protected WorkspaceImpl(WorkspaceConfig wspConfig,
                        SharedItemStateManager stateMgr,
                        RepositoryImpl rep,
                        SessionImpl session)
Protected constructor.

Parameters:
wspConfig - The workspace configuration
stateMgr - The shared item state manager
rep - The repository
session - The session
Method Detail

getHierarchyManager

public HierarchyManager getHierarchyManager()
The hierarchy manager that reflects workspace state only (i.e. that is isolated from transient changes made through the session)

Returns:
the hierarchy manager of this workspace

getItemStateManager

public LocalItemStateManager getItemStateManager()
Returns the item state manager associated with the workspace represented by this WorkspaceImpl instance.

Returns:
the item state manager of this workspace

sanityCheck

public void sanityCheck()
                 throws RepositoryException
Performs a sanity check on this workspace and the associated session.

Throws:
RepositoryException - if this workspace has been rendered invalid for some reason

createWorkspace

public void createWorkspace(String name,
                            String srcWorkspace)
                     throws AccessDeniedException,
                            UnsupportedRepositoryOperationException,
                            RepositoryException
Creates a new Workspace with the specified name initialized with a clone of the content of the workspace srcWorkspace. Semantically, this method is equivalent to creating a new workspace and manually cloning srcWorkspace to it; however, this method may assist some implementations in optimizing subsequent Node.update and Node.merge calls between the new workspace and its source.

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.

Parameters:
name - A String, the name of the new workspace.
srcWorkspace - The name of the workspace from which the new workspace is to be cloned.
Throws:
AccessDeniedException - if the session through which this Workspace object was acquired does not have permission to create the new workspace.
UnsupportedRepositoryOperationException - if the repository does not support the creation of workspaces.
RepositoryException - if another error occurs.
Since:
JCR 2.0

deleteWorkspace

public void deleteWorkspace(String name)
                     throws AccessDeniedException,
                            UnsupportedRepositoryOperationException,
                            RepositoryException
Deletes the workspace with the specified name from the repository, deleting all content within it.

Throws an AccessDeniedException if the session through which this Workspace object was acquired does not have permission to remove the workspace.

Throws an UnsupportedRepositoryOperationException if the repository does not support the removal of workspaces.

Parameters:
name - A String, the name of the workspace to be deleted.
Throws:
AccessDeniedException - if the session through which this Workspace object was acquired does not have permission to remove the workspace.
UnsupportedRepositoryOperationException - if the repository does not support the removal of workspaces.
RepositoryException - if another error occurs.
Since:
JCR 2.0

createWorkspace

public void createWorkspace(String name)
                     throws AccessDeniedException,
                            UnsupportedRepositoryOperationException,
                            RepositoryException
Creates a new 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.

Specified by:
createWorkspace in interface JackrabbitWorkspace
Parameters:
name - A String, the name of the new workspace.
Throws:
AccessDeniedException - if the session through which this Workspace object was acquired does not have permission to create the new workspace.
UnsupportedRepositoryOperationException - if the repository does not support the creation of workspaces.
RepositoryException - if another error occurs.
Since:
JCR 2.0
See Also:
Workspace.getAccessibleWorkspaceNames()

createWorkspace

public void createWorkspace(String workspaceName,
                            InputSource configTemplate)
                     throws AccessDeniedException,
                            RepositoryException
Creates a workspace with the given name and a workspace configuration template.

Specified by:
createWorkspace in interface JackrabbitWorkspace
Parameters:
workspaceName - name of the new workspace
configTemplate - the configuration template of the new workspace
Throws:
AccessDeniedException - if the current session is not allowed to create the workspace
RepositoryException - if a workspace with the given name already exists or if another error occurs
See Also:
getAccessibleWorkspaceNames()

getConfig

public WorkspaceConfig getConfig()
Returns the configuration of this workspace.

Returns:
the workspace configuration

getLockManager

public LockManager getLockManager()
                           throws RepositoryException
Return the lock manager for this workspace. If not already done, creates a new instance.

Returns:
lock manager for this workspace
Throws:
RepositoryException - if an error occurs

getName

public String getName()

Specified by:
getName in interface Workspace

getSession

public Session getSession()

Specified by:
getSession in interface Workspace

getNamespaceRegistry

public NamespaceRegistry getNamespaceRegistry()
                                       throws RepositoryException

Specified by:
getNamespaceRegistry in interface Workspace
Throws:
RepositoryException

getNodeTypeManager

public NodeTypeManager getNodeTypeManager()
                                   throws RepositoryException

Specified by:
getNodeTypeManager in interface Workspace
Throws:
RepositoryException

clone

public void clone(String srcWorkspace,
                  String srcAbsPath,
                  String destAbsPath,
                  boolean removeExisting)
           throws NoSuchWorkspaceException,
                  ConstraintViolationException,
                  VersionException,
                  AccessDeniedException,
                  PathNotFoundException,
                  ItemExistsException,
                  LockException,
                  RepositoryException

Specified by:
clone in interface Workspace
Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

copy

public void copy(String srcAbsPath,
                 String destAbsPath)
          throws ConstraintViolationException,
                 VersionException,
                 AccessDeniedException,
                 PathNotFoundException,
                 ItemExistsException,
                 LockException,
                 RepositoryException

Specified by:
copy in interface Workspace
Throws:
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

copy

public void copy(String srcWorkspace,
                 String srcAbsPath,
                 String destAbsPath)
          throws NoSuchWorkspaceException,
                 ConstraintViolationException,
                 VersionException,
                 AccessDeniedException,
                 PathNotFoundException,
                 ItemExistsException,
                 LockException,
                 RepositoryException

Specified by:
copy in interface Workspace
Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

move

public void move(String srcAbsPath,
                 String destAbsPath)
          throws ConstraintViolationException,
                 VersionException,
                 AccessDeniedException,
                 PathNotFoundException,
                 ItemExistsException,
                 LockException,
                 RepositoryException

Specified by:
move in interface Workspace
Throws:
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

getObservationManager

public ObservationManager getObservationManager()
                                         throws RepositoryException
Returns the observation manager of this session. The observation manager is lazily created if it does not exist yet.

Specified by:
getObservationManager in interface Workspace
Returns:
the observation manager of this session
Throws:
RepositoryException - if a repository error occurs

getQueryManager

public QueryManager getQueryManager()
                             throws RepositoryException

Specified by:
getQueryManager in interface Workspace
Throws:
RepositoryException

restore

public void restore(Version[] versions,
                    boolean removeExisting)
             throws ItemExistsException,
                    UnsupportedRepositoryOperationException,
                    VersionException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException

Specified by:
restore in interface Workspace
Throws:
ItemExistsException
UnsupportedRepositoryOperationException
VersionException
LockException
InvalidItemStateException
RepositoryException

getAccessibleWorkspaceNames

public String[] getAccessibleWorkspaceNames()
                                     throws RepositoryException

Specified by:
getAccessibleWorkspaceNames in interface Workspace
Throws:
RepositoryException

getImportContentHandler

public ContentHandler getImportContentHandler(String parentAbsPath,
                                              int uuidBehavior)
                                       throws PathNotFoundException,
                                              ConstraintViolationException,
                                              VersionException,
                                              LockException,
                                              RepositoryException

Specified by:
getImportContentHandler in interface Workspace
Throws:
PathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryException

createItemStateManager

protected LocalItemStateManager createItemStateManager(SharedItemStateManager shared)
Create the persistent item state manager on top of the shared item state manager. May be overridden by subclasses.

Parameters:
shared - shared item state manager
Returns:
local item state manager

copy283

public String copy283(String srcAbsPath,
                      String destAbsPath)
               throws ConstraintViolationException,
                      VersionException,
                      AccessDeniedException,
                      PathNotFoundException,
                      ItemExistsException,
                      LockException,
                      RepositoryException
This method copies the node at srcAbsPath to the new location at destAbsPath. Returns the path of the node at its new position. Note that the returned path will indicate the resulting same-name sibling index of the destination, if necessary, unlike the supplied destAbsPath parameter (see below).

This operation is performed entirely within the persistent workspace, it does not involve transient storage and therefore does not require a save.

The new copies of nodes are automatically given new identifiers and referenceable nodes in particular are always given new referenceable identifiers.

When the source subtree in a copy operation includes both a reference property (P) and the node to which it refers (N) then not only does the new copy of the referenceable node (N') get a new identifier but the new copy of the reference property (P') is changed so that it points to N', thus preserving the reference within the subtree.

The destAbsPath provided must not have an index on its final element. If it does then a RepositoryException is thrown. Strictly speaking, the destAbsPath parameter is actually an absolute path to the parent node of the new location, appended with the new name desired for the copied node. It does not specify a position within the child node ordering. If ordering is supported by the node type of the parent node of the new location, then the new copy of the node is appended to the end of the child node list. The resulting position within a same-name sibling set can, however, be determined from the path returned by this method, which will include an index if one is required.

This method cannot be used to copy just an individual property by itself. It copies an entire node and its subtree (including, of course, any properties contained therein).

A ConstraintViolationException is thrown if the operation would violate a node-type or other implementation-specific constraint.

A VersionException is thrown if the parent node of destAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in.

An AccessDeniedException is thrown if the current session (i.e. the session that was used to acquire this Workspace object) does not have sufficient access rights to complete the operation.

A PathNotFoundException is thrown if the node at srcAbsPath or the parent of destAbsPath does not exist.

An ItemExistException is thrown if a node already exists at destAbsPath and same-name siblings are not allowed. Note that if a property already exists at destAbsPath, the operation succeeds, since a node may have a child node and property with the same name.

A LockException is thrown if a lock prevents the copy.

Parameters:
srcAbsPath - the path of the node to be copied.
destAbsPath - the location to which the node at srcAbsPath is to be copied.
Returns:
the path of the node at its new position.
Throws:
ConstraintViolationException - if the operation would violate a node-type or other implementation-specific constraint.
VersionException - if the parent node of destAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in.
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation.
PathNotFoundException - if the node at srcAbsPath or the parent of destAbsPath does not exist.
ItemExistsException - if a node already exists at destAbsPath and same-name siblings are not allowed.
LockException - if a lock prevents the copy.
RepositoryException - if the last element of destAbsPath has an index or if another error occurs.

copy283

public String copy283(String srcWorkspace,
                      String srcAbsPath,
                      String destAbsPath)
               throws NoSuchWorkspaceException,
                      ConstraintViolationException,
                      VersionException,
                      AccessDeniedException,
                      PathNotFoundException,
                      ItemExistsException,
                      LockException,
                      RepositoryException
This method copies the subtree at srcAbsPath in srcWorkspace to destAbsPath in this workspace. Returns the path of the node at its new position. Note that the returned path will indicate the resulting same-name sibling index of the destination, if necessary, unlike the supplied destAbsPath parameter (see below).

Unlike clone, this method does assign new referenceable identifiers to the new copies of referenceable nodes. In the case of non-referenceable nodes, this method may assign new identifiers. This operation is performed entirely within the persistent workspace, it does not involve transient storage and therefore does not require a save.

When the source subtree in a copy operation includes both a reference property (P) and the node to which it refers (N) then not only does the new copy of the referenceable node (N') get a new identifier but the new copy of the reference property (P') is changed so that it points to N', thus preserving the reference within the subtree.

The destAbsPath provided must not have an index on its final element. If it does then a RepositoryException is thrown. Strictly speaking, the destAbsPath parameter is actually an absolute path to the parent node of the new location, appended with the new name desired for the copied node. It does not specify a position within the child node ordering. If ordering is supported by the node type of the parent node of the new location, then the new copy of the node is appended to the end of the child node list. The resulting position within a same-name sibling set can, however, be determined from the path returned by this method, which will include an index if one is required.

This method cannot be used to copy just an individual property by itself. It copies an entire node and its subtree (including, of course, any properties contained therein).

A NoSuchWorkspaceException is thrown if srcWorkspace does not exist or if the current Session does not have permission to access it.

A ConstraintViolationException is thrown if the operation would violate a node-type or other implementation-specific constraint.

A VersionException is thrown if the parent node of destAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in.

An AccessDeniedException is thrown if the current session (i.e. the session that was used to acquire this Workspace object) does not have sufficient access rights to complete the operation.

A PathNotFoundException is thrown if the node at srcAbsPath in srcWorkspace or the parent of destAbsPath in this workspace does not exist.

An ItemExistException is thrown if a node already exists at destAbsPath and same-name siblings are not allowed. Note that if a property already exists at destAbsPath, the operation succeeds, since a node may have a child node and property with the same name.

A LockException is thrown if a lock prevents the copy.

Parameters:
srcWorkspace - the name of the workspace from which the copy is to be made.
srcAbsPath - the path of the node to be copied.
destAbsPath - the location to which the node at srcAbsPath is to be copied in this workspace.
Returns:
the path of the node at its new position.
Throws:
NoSuchWorkspaceException - if srcWorkspace does not exist or if the current Session does not have permission to access it.
ConstraintViolationException - if the operation would violate a node-type or other implementation-specific constraint
VersionException - if the parent node of destAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in.
AccessDeniedException - if the current session does have permission to access srcWorkspace but otherwise does not have sufficient access rights to complete the operation.
PathNotFoundException - if the node at srcAbsPath in srcWorkspace or the parent of destAbsPath in this workspace does not exist.
ItemExistsException - if a node already exists at destAbsPath and same-name siblings are not allowed.
LockException - if a lock prevents the copy.
RepositoryException - if the last element of destAbsPath has an index or if another error occurs.

clone283

public String clone283(String srcWorkspace,
                       String srcAbsPath,
                       String destAbsPath,
                       boolean removeExisting)
                throws NoSuchWorkspaceException,
                       ConstraintViolationException,
                       VersionException,
                       AccessDeniedException,
                       PathNotFoundException,
                       ItemExistsException,
                       LockException,
                       RepositoryException
Clones the subtree at the node srcAbsPath in srcWorkspace to the new location at destAbsPath in this workspace. Returns the path of the node at its new position. Note that the returned path will indicate the resulting same-name sibling index of the destination, if necessary, unlike the supplied destAbsPath parameter (see below).

Unlike the signature of copy that copies between workspaces, this method does not assign new identifiers to the newly cloned nodes but preserves the identifiers of their respective source nodes. This applies to both referenceable and non-referenceable nodes.

In some implementations there may be cases where preservation of a non-referenceable identifier is not possible, due to how non-referenceable identifiers are constructed in that implementation. In such a case this method will throw a RepositoryException.

If removeExisting is true and an existing node in this workspace (the destination workspace) has the same identifier as a node being cloned from srcWorkspace, then the incoming node takes precedence, and the existing node (and its subtree) is removed. If removeExisting is false then an identifier collision causes this method to throw a ItemExistsException and no changes are made.

If successful, the change is persisted immediately, there is no need to call save.

The destAbsPath provided must not have an index on its final element. If it does then a RepositoryException is thrown. Strictly speaking, the destAbsPath parameter is actually an absolute path to the parent node of the new location, appended with the new name desired for the cloned node. It does not specify a position within the child node ordering. If ordering is supported by the node type of the parent node of the new location, then the new clone of the node is appended to the end of the child node list. The resulting position within a same-name sibling set can, however, be determined from the path returned by this method, which will include an index, if one is required.

This method cannot be used to clone just an individual property by itself. It clones an entire node and its subtree (including, of course, any properties contained therein).

A NoSuchWorkspaceException is thrown if srcWorkspace does not exist or if the current Session does not have permission to access it.

A ConstraintViolationException is thrown if the operation would violate a node-type or other implementation-specific constraint or if srcWorkspace is the name of this workspace. In other words, if an attempt is made to clone a subtree into the same workspace.

A VersionException is thrown if the parent node of destAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in. This exception will also be thrown if removeExisting is true, and an identifier conflict occurs that would require the moving and/or altering of a node that is checked-in.

An AccessDeniedException is thrown if the current session (i.e. the session that was used to acquire this Workspace object) does not have sufficient access rights to complete the operation.

A PathNotFoundException is thrown if the node at srcAbsPath in srcWorkspace or the parent of destAbsPath in this workspace does not exist.

An ItemExistsException is thrown if a node or property already exists at destAbsPath

An ItemExistException is thrown if a node already exists at destAbsPath and same-name siblings are not allowed or if removeExisting is false and an identifier conflict occurs.

Note that if a property already exists at destAbsPath, the operation succeeds, since a node may have a child node and property with the same name.

A LockException is thrown if a lock prevents the clone.

Parameters:
srcWorkspace - The name of the workspace from which the node is to be copied.
srcAbsPath - the path of the node to be copied in srcWorkspace.
destAbsPath - the location to which the node at srcAbsPath is to be copied in this workspace.
removeExisting - if false then this method throws an ItemExistsException on identifier conflict with an incoming node. If true then a identifier conflict is resolved by removing the existing node from its location in this workspace and cloning (copying in) the one from srcWorkspace.
Returns:
the path of the node at its new position.
Throws:
NoSuchWorkspaceException - if destWorkspace does not exist.
ConstraintViolationException - if the operation would violate a node-type or other implementation-specific constraint.
VersionException - if the parent node of destAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in. This exception will also be thrown if removeExisting is true, and an identifier conflict occurs that would require the moving and/or altering of a node that is checked-in.
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation.
PathNotFoundException - if the node at srcAbsPath in srcWorkspace or the parent of destAbsPath in this workspace does not exist.
ItemExistsException - if a node already exists at destAbsPath and same-name siblings are not allowed or if removeExisting is false and an identifier conflict occurs.
LockException - if a lock prevents the clone.
RepositoryException - if the last element of destAbsPath has an index or if another error occurs.

move283

public String move283(String srcAbsPath,
                      String destAbsPath)
               throws ConstraintViolationException,
                      VersionException,
                      AccessDeniedException,
                      PathNotFoundException,
                      ItemExistsException,
                      LockException,
                      RepositoryException
Moves the node at srcAbsPath (and its entire subtree) to the new location at destAbsPath. Returns the path of the node at its new position. Note that the returned path will indicate the resulting same-name sibling index of the destination, if necessary, unlike the supplied destAbsPath parameter (see below).

If successful, the change is persisted immediately, there is no need to call save. Note that this is in contrast to Session.move(java.lang.String, java.lang.String) which operates within the transient space and hence requires a save.

The identifiers of referenceable nodes must not be changed by a move. The identifiers of non-referenceable nodes may change.

The destAbsPath provided must not have an index on its final element. If it does then a RepositoryException is thrown. Strictly speaking, the destAbsPath parameter is actually an absolute path to the parent node of the new location, appended with the new name desired for the moved node. It does not specify a position within the child node ordering. If ordering is supported by the node type of the parent node of the new location, then the newly moved node is appended to the end of the child node list. The resulting position within a same-name sibling set can, however, be determined from the path returned by this method, which will include an index if one is required.

This method cannot be used to move just an individual property by itself. It moves an entire node and its subtree (including, of course, any properties contained therein).

The identifiers of referenceable nodes must not be changed by a move. The identifiers of non-referenceable nodes may change.

A ConstraintViolationException is thrown if the operation would violate a node-type or other implementation-specific constraint.

A VersionException is thrown if the parent node of destAbsPath or the parent node of srcAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in.

An AccessDeniedException is thrown if the current session (i.e. the session that was used to acquire this Workspace object) does not have sufficient access rights to complete the operation.

A PathNotFoundException is thrown if the node at srcAbsPath or the parent of destAbsPath does not exist.

An ItemExistException is thrown if a node already exists at destAbsPath and same-name siblings are not allowed.

Note that if a property already exists at destAbsPath, the operation succeeds, since a node may have a child node and property with the same name

A LockException if a lock prevents the move.

Parameters:
srcAbsPath - the path of the node to be moved.
destAbsPath - the location to which the node at srcAbsPath is to be moved.
Returns:
the path of the node at its new position.
Throws:
ConstraintViolationException - if the operation would violate a node-type or other implementation-specific constraint
VersionException - if the parent node of destAbsPath or the parent node of srcAbsPath is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in.
AccessDeniedException - if the current session (i.e. the session that was used to aqcuire this Workspace object) does not have sufficient access rights to complete the operation.
PathNotFoundException - if the node at srcAbsPath or the parent of destAbsPath does not exist.
ItemExistsException - if a node already exists at destAbsPath and same-name siblings are not allowed.
LockException - if a lock prevents the move.
RepositoryException - if the last element of destAbsPath has an index or if another error occurs.

createEventStateCollection

public EventStateCollection createEventStateCollection()
                                                throws RepositoryException
Creates an EventStateCollection.

Implemented in this object and forwarded rather than obsMgr since creation of the latter is lazy.

Specified by:
createEventStateCollection in interface EventStateCollectionFactory
Returns:
a new EventStateCollection
Throws:
RepositoryException - if creation fails for some reason


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.