org.priha.core
Class WorkspaceImpl

java.lang.Object
  extended by org.priha.core.WorkspaceImpl

public class WorkspaceImpl
extends java.lang.Object

Implements a JCR Workspace. This class mostly functions as a facade for ProviderManager, which takes care of the actual repository management.


Constructor Summary
WorkspaceImpl(SessionImpl session, java.lang.String name, ProviderManager mgr)
          Create a new Workspace instance.
 
Method Summary
 void clone(java.lang.String srcWorkspace, java.lang.String srcAbsPath, java.lang.String destAbsPath, boolean removeExisting)
          
protected  void copy(SessionImpl srcSession, java.lang.String srcAbsPath, java.lang.String destAbsPath, boolean preserveUUIDs)
          Performs the actual copy, but does not save.
 void copy(java.lang.String srcAbsPath, java.lang.String destAbsPath)
          
 void copy(java.lang.String srcWorkspace, java.lang.String srcAbsPath, java.lang.String destAbsPath)
          
 PropertyImpl createPropertyImpl(Path path)
          Creates a new property implementation without a property definition.
 java.lang.String[] getAccessibleWorkspaceNames()
          
 org.xml.sax.ContentHandler getImportContentHandler(java.lang.String parentAbsPath, int uuidBehavior)
          
 java.lang.String getName()
          
 NamespaceRegistryImpl getNamespaceRegistry()
          
 QNodeTypeManager.Impl getNodeTypeManager()
          
 ObservationManagerImpl.Impl getObservationManager()
          Unsupported at the moment.
 PrihaQueryManager getQueryManager()
          
 SessionImpl getSession()
          
 void importXML(java.lang.String parentAbsPath, java.io.InputStream in, int uuidBehavior)
          
protected  boolean isCheckedIn(NodeImpl n)
          Checks if the node or any of its parents are checked in.
 void logout()
          Performs a logout; to be called by SessionImpl only.
 void move(java.lang.String srcAbsPath, java.lang.String destAbsPath)
          Implemented simply by starting a new Session, which then performs the copy, and then calling save() on it.
 boolean nodeExists(Path path)
          Checks directly from the repository if an item exists.
 void restore(Version[] versions, boolean removeExisting)
          Unsupported at the moment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkspaceImpl

public WorkspaceImpl(SessionImpl session,
                     java.lang.String name,
                     ProviderManager mgr)
              throws RepositoryException
Create a new Workspace instance.

Parameters:
session - The SessionImpl to which this Workspace is tied to
name - The name of the Workspace
mgr - The ProviderManager instance which owns the repository.
Throws:
RepositoryException - If a NodeTypeManager cannot be instantiated.
Method Detail

createPropertyImpl

public PropertyImpl createPropertyImpl(Path path)
                                throws RepositoryException
Creates a new property implementation without a property definition. This is meant for providers to create an "empty" property definition, which the WorkspaceImpl will then update later on.

Parameters:
path -
Returns:
Throws:
RepositoryException

clone

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

Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

copy

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

Throws:
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

copy

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

Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

isCheckedIn

protected boolean isCheckedIn(NodeImpl n)
                       throws RepositoryException
Checks if the node or any of its parents are checked in.

Parameters:
n -
Returns:
Throws:
RepositoryException

copy

protected void copy(SessionImpl srcSession,
                    java.lang.String srcAbsPath,
                    java.lang.String destAbsPath,
                    boolean preserveUUIDs)
             throws NoSuchWorkspaceException,
                    ConstraintViolationException,
                    VersionException,
                    AccessDeniedException,
                    PathNotFoundException,
                    ItemExistsException,
                    LockException,
                    RepositoryException
Performs the actual copy, but does not save.

Parameters:
srcSession -
srcAbsPath -
destAbsPath -
Throws:
NoSuchWorkspaceException
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

getAccessibleWorkspaceNames

public java.lang.String[] getAccessibleWorkspaceNames()
                                               throws RepositoryException

Throws:
RepositoryException

getImportContentHandler

public org.xml.sax.ContentHandler getImportContentHandler(java.lang.String parentAbsPath,
                                                          int uuidBehavior)
                                                   throws PathNotFoundException,
                                                          ConstraintViolationException,
                                                          VersionException,
                                                          LockException,
                                                          AccessDeniedException,
                                                          RepositoryException

Throws:
PathNotFoundException
ConstraintViolationException
VersionException
LockException
AccessDeniedException
RepositoryException

getName

public java.lang.String getName()


getNamespaceRegistry

public NamespaceRegistryImpl getNamespaceRegistry()
                                           throws RepositoryException

Throws:
RepositoryException

getNodeTypeManager

public QNodeTypeManager.Impl getNodeTypeManager()
                                         throws RepositoryException

Throws:
RepositoryException

getObservationManager

public ObservationManagerImpl.Impl getObservationManager()
                                                  throws UnsupportedRepositoryOperationException,
                                                         RepositoryException
Unsupported at the moment.

Throws:
UnsupportedRepositoryOperationException
RepositoryException

getQueryManager

public PrihaQueryManager getQueryManager()
                                  throws RepositoryException

Throws:
RepositoryException

getSession

public SessionImpl getSession()


importXML

public void importXML(java.lang.String parentAbsPath,
                      java.io.InputStream in,
                      int uuidBehavior)
               throws java.io.IOException,
                      PathNotFoundException,
                      ItemExistsException,
                      ConstraintViolationException,
                      InvalidSerializedDataException,
                      LockException,
                      AccessDeniedException,
                      RepositoryException

Throws:
java.io.IOException
PathNotFoundException
ItemExistsException
ConstraintViolationException
InvalidSerializedDataException
LockException
AccessDeniedException
RepositoryException

move

public void move(java.lang.String srcAbsPath,
                 java.lang.String destAbsPath)
          throws ConstraintViolationException,
                 VersionException,
                 AccessDeniedException,
                 PathNotFoundException,
                 ItemExistsException,
                 LockException,
                 RepositoryException
Implemented simply by starting a new Session, which then performs the copy, and then calling save() on it.

Throws:
ConstraintViolationException
VersionException
AccessDeniedException
PathNotFoundException
ItemExistsException
LockException
RepositoryException

restore

public void restore(Version[] versions,
                    boolean removeExisting)
             throws ItemExistsException,
                    UnsupportedRepositoryOperationException,
                    VersionException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException
Unsupported at the moment.

Throws:
ItemExistsException
UnsupportedRepositoryOperationException
VersionException
LockException
InvalidItemStateException
RepositoryException

logout

public void logout()
Performs a logout; to be called by SessionImpl only.


nodeExists

public boolean nodeExists(Path path)
                   throws RepositoryException
Checks directly from the repository if an item exists.

Parameters:
path -
Returns:
Throws:
InvalidPathException
RepositoryException