com.softwareag.centrasite.appl.framework.persistence.revision.impl
Class RevisionManagerImpl

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.persistence.revision.impl.RevisionManagerImpl
All Implemented Interfaces:
RevisionManager

public class RevisionManagerImpl
extends java.lang.Object
implements RevisionManager

Implementation of the RevisionManager interface. Wrapper for the CentraSiteVMS revision manager and administrator.


Constructor Summary
RevisionManagerImpl(javax.xml.registry.Connection connection, ManagedBeanPool beanPool)
          Requires JAXR connection and bean pool instance.
 
Method Summary
 int deleteBeans(java.lang.String checkpointName)
          Delete all revision beans flagged with the checkpoint name.
 void disableRevisioning()
          Disable the revision and checkpoint environment on global level.
 void enableRevisioning()
          Enable the revision and checkpoint environment on global level.
 java.util.Collection<RevisionBean> getAllRevisionBeans(java.lang.String checkpointName)
          Get all revision beans which were created with the given checkpoint name (label).
 java.util.Collection<java.lang.String> getCheckpointNames()
          Get a list of checkpoint names (labels) active in the system.
<T extends RegistryBean>
java.util.Collection<RevisionBean>
getRevisionBeans(java.util.Collection<T> beans, java.lang.String checkpointName)
          Get the revision beans for the specified registry beans and having a checkpoint name (label).
 java.util.Collection<RevisionBean> getRevisionBeans(RegistryBean bean)
          Get revision objects based on a specific registry bean.
 java.util.Collection<RevisionBean> getRevisionBeans(RegistryBean bean, java.lang.String checkpointName)
          Get the revision beans, for the specified registry bean and having a checkpoint name (label).
 boolean isRevisioningEnabled()
          Checks it the revision infrastructure is enabled.
<T extends RegistryBean>
void
restoreBeans(java.util.Collection<T> beans)
          Restore the specified revision beans so that they will become the actual registry beans.
 void setCheckpoint(RegistryBean bean, java.lang.String checkpointName)
          Set a checkpoint name (label) to the registry bean specified.
<T extends RegistryBean>
void
setCheckpoints(java.util.Collection<T> beans, java.lang.String checkpointName)
          Set a checkpoint name (label) to the registry beans specified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RevisionManagerImpl

public RevisionManagerImpl(javax.xml.registry.Connection connection,
                           ManagedBeanPool beanPool)
                    throws CSAppFrameworkException
Requires JAXR connection and bean pool instance.

Parameters:
connection - Used to initialize the CentraSiteVMS revision manager.
beanPool - Used to map revision registry objects to registry beans.
Throws:
CSAppFrameworkException
Method Detail

deleteBeans

public int deleteBeans(java.lang.String checkpointName)
                throws CSAppFrameworkException
Description copied from interface: RevisionManager
Delete all revision beans flagged with the checkpoint name.

Specified by:
deleteBeans in interface RevisionManager
Parameters:
checkpointName - name of checkpoint (label)
Returns:
number of deleted objects
Throws:
CSAppFrameworkException

getCheckpointNames

public java.util.Collection<java.lang.String> getCheckpointNames()
                                                          throws CSAppFrameworkException
Description copied from interface: RevisionManager
Get a list of checkpoint names (labels) active in the system.

Specified by:
getCheckpointNames in interface RevisionManager
Returns:
collection of checkpoint names
Throws:
CSAppFrameworkException

getRevisionBeans

public <T extends RegistryBean> java.util.Collection<RevisionBean> getRevisionBeans(java.util.Collection<T> beans,
                                                                                    java.lang.String checkpointName)
                                                    throws CSAppFrameworkException
Description copied from interface: RevisionManager
Get the revision beans for the specified registry beans and having a checkpoint name (label).

Specified by:
getRevisionBeans in interface RevisionManager
Parameters:
beans - collection of beans
checkpointName - name of checkpoint (label)
Returns:
collection of revision beans
Throws:
CSAppFrameworkException

getAllRevisionBeans

public java.util.Collection<RevisionBean> getAllRevisionBeans(java.lang.String checkpointName)
                                                       throws CSAppFrameworkException
Description copied from interface: RevisionManager
Get all revision beans which were created with the given checkpoint name (label).

Specified by:
getAllRevisionBeans in interface RevisionManager
Parameters:
checkpointName - name of checkpoint (label)
Returns:
collection of revision beans
Throws:
CSAppFrameworkException

getRevisionBeans

public java.util.Collection<RevisionBean> getRevisionBeans(RegistryBean bean)
                                                    throws CSAppFrameworkException
Description copied from interface: RevisionManager
Get revision objects based on a specific registry bean. The result includes the actual object.

Specified by:
getRevisionBeans in interface RevisionManager
Parameters:
bean - a registry bean
Returns:
collection of all RegistryBean revisions
Throws:
CSAppFrameworkException

restoreBeans

public <T extends RegistryBean> void restoreBeans(java.util.Collection<T> beans)
                  throws CSAppFrameworkException
Description copied from interface: RevisionManager
Restore the specified revision beans so that they will become the actual registry beans.

Specified by:
restoreBeans in interface RevisionManager
Parameters:
beans - collection of RegistryBean revisions
Throws:
CSAppFrameworkException

setCheckpoints

public <T extends RegistryBean> void setCheckpoints(java.util.Collection<T> beans,
                                                    java.lang.String checkpointName)
                    throws CSAppFrameworkException
Description copied from interface: RevisionManager
Set a checkpoint name (label) to the registry beans specified.

Specified by:
setCheckpoints in interface RevisionManager
Parameters:
beans - collection of RegistryBean
checkpointName - name of checkpoint (label)
Throws:
CSAppFrameworkException

getRevisionBeans

public java.util.Collection<RevisionBean> getRevisionBeans(RegistryBean bean,
                                                           java.lang.String checkpointName)
                                                    throws CSAppFrameworkException
Description copied from interface: RevisionManager
Get the revision beans, for the specified registry bean and having a checkpoint name (label).

Specified by:
getRevisionBeans in interface RevisionManager
Parameters:
bean - collection of beans
checkpointName - name of checkpoint (label)
Returns:
collection of revision beans
Throws:
CSAppFrameworkException

disableRevisioning

public void disableRevisioning()
                        throws CSAppFrameworkException
Description copied from interface: RevisionManager
Disable the revision and checkpoint environment on global level. This method is intended to be used in separate session with no concurrent modifications on registry objects. The JAXR connection should be with com.centrasite.jaxr.BrowserBehaviour flag set to false.

Specified by:
disableRevisioning in interface RevisionManager
Throws:
CSAppFrameworkException
See Also:
StandaloneRegistryProvider.StandaloneRegistryProvider(String, String, boolean)

enableRevisioning

public void enableRevisioning()
                       throws CSAppFrameworkException
Description copied from interface: RevisionManager
Enable the revision and checkpoint environment on global level. This method is intended to be used in separate session with no concurrent modifications on registry objects. The JAXR connection should be with com.centrasite.jaxr.BrowserBehaviour flag set to false.

Specified by:
enableRevisioning in interface RevisionManager
Throws:
CSAppFrameworkException
See Also:
StandaloneRegistryProvider.StandaloneRegistryProvider(String, String, boolean)

isRevisioningEnabled

public boolean isRevisioningEnabled()
Description copied from interface: RevisionManager
Checks it the revision infrastructure is enabled.

Specified by:
isRevisioningEnabled in interface RevisionManager
Returns:
true: revision is enabled false: disabled

setCheckpoint

public void setCheckpoint(RegistryBean bean,
                          java.lang.String checkpointName)
                   throws CSAppFrameworkException
Description copied from interface: RevisionManager
Set a checkpoint name (label) to the registry bean specified.

Specified by:
setCheckpoint in interface RevisionManager
Parameters:
bean - RegistryBean
checkpointName - name of checkpoint (label)
Throws:
CSAppFrameworkException