com.centrasite.registry.versionmanagementservices
Interface VersionManager

All Known Implementing Classes:
VersionManagerImpl

public interface VersionManager

Version Manager to handle versioning of certain registry objects in CentraSite. The functionality comprises creation of new version objects and purging them. Both interfaces return lists of new/update registry objects. It is up to the user to handle them further (for example saving/deleting) in registry.

The following options can be used (to be set prior to 'createVersion/copy'):

The purge returns only registry objects to be delete, hewever there are also repository objects to delete. So after the user commits the delete of purged objects he should call 'removeRepositoryResources()' which cleans up his repository.

The following options can be used (to be set prior to 'purge'):

 Example 1:   Version a package in DEEP mode (means version also the package members)
 
              RegistryPackage pkg = ...
              JAXRAccessor jaxr = new JAXRAccessor(...)
              VersionManager vm = VersionManagerFactory.getInstance( jaxr );
              Collection versionObjects = vm.createVersion( pkg, VersionCopyMode.DEEP );
              jaxr.getLCMgr().saveObjects( versionObjects );  
 
 
 Example 2:   Version a service in SHALLOW mode (but ignores its associated *.xsd files)
 
              Service service = ...
              JAXRAccessor jaxr = new JAXRAccessor(...)
              WebServiceAdministrator admin = new WebServiceAdministrator( jaxr );
              Collection elinks = admin.getAllExternalLinks( service );
              VersionManager vm = VersionManagerFactory.getInstance( jaxr );
              vm.setXXX();
              Collection versionObjects = vm.createVersion( service, VersionCopyMode.SHALLOW, elinks );
              jaxr.getLCMgr().saveObjects( versionObjects );  
              
              
 Example 3:   Purge all older versions of  a service
 
              Service service = getMaxVersionOfService()
              JAXRAccessor jaxr = new JAXRAccessor(...)
              VersionManager vm = VersionManagerFactory.getInstance( jaxr );
              vm.setXXX();
              Collection deleteObjects = vm.purge( service, 1 );
              jaxr.getLCMgr().deleteObjects( deleteObjects );  
 


Method Summary
 void addVersionObjectListener(VersionObjectListener versionObjectListener)
          Add a object listener.
 java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject)
          Copy the specified registry object (RegistryEntry or RegistryObject).
 java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode)
          Copy the specified registry object (RegistryEntry or RegistryObject).
 java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects)
          Copy the specified registry object (RegistryEntry or RegistryObject).
 java.util.Collection createVersion(javax.xml.registry.infomodel.ExternalLink elink)
          Create a new version of an External Link.
 java.util.Collection createVersion(javax.xml.registry.infomodel.ExternalLink elink, VersionCopyMode copyMode)
          Create a new version of an External Link.
 java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject)
          Create a new version of a registry object (RegistryEntry or RegistryObject).
 java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode)
          Create a new version of a registry object (RegistryEntry or RegistryObject).
 java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects)
          Create a new version of a registry object (RegistryEntry or RegistryObject).
 java.util.Collection createVersion(javax.xml.registry.infomodel.Service serviceObject, java.util.Collection ignoreCopyObjects)
          Create a new version of a Service object.
 java.util.Collection createVersion(javax.xml.registry.infomodel.Service serviceObject, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects)
          Create a new version of a Service object.
 java.util.Collection getAllIgnoredObjects(java.util.Collection ignoredObjects)
          Get the entire list of objects to be ignored.
 javax.xml.registry.infomodel.RegistryObject getMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj)
          Get the maximum version object of an arbitrary given object in a versioning row.
 java.util.List getNewerVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject, java.util.Collection<javax.xml.registry.infomodel.Classification> classifications)
          Get all newer versioned objects based on the object given.
 javax.xml.registry.infomodel.RegistryObject getNewVersionObject(javax.xml.registry.infomodel.RegistryObject registryObject, java.util.Collection<javax.xml.registry.infomodel.RegistryObject> newObjects)
          Get the new version object of the original object out of the collection of new objects
 java.util.List getOlderVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject, java.util.Collection<javax.xml.registry.infomodel.Classification> classifications)
          Get all older versioned objects based on the object given.
 java.util.Collection getVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject)
          Get all versioned objects based on the object given.
 VersionResult getVersionResult()
          Get the version result.
 boolean isMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj)
          Checks if the given object is the maximum (or only) version object
 void overwriteCopyRule(CopyRule copyRule)
          Overwrite a default copy rule.
 java.util.Collection purge(java.util.Collection registryObjects, int keepCount)
          Purge the list of registry objects with the same keep count.
 java.util.Collection purge(javax.xml.registry.infomodel.RegistryObject registryObject)
          Purge older version registry entries and keep only the actual one.
 java.util.Collection purge(javax.xml.registry.infomodel.RegistryObject registryObject, int keepCount)
          Purge older version registry entries.
 void removeRepositoryResources()
          Remove repository resources collected during purge().
 void removeVersionObjectListener(VersionObjectListener versionObjectListener)
          Remove a object listener.
 void setForceTargetPurge(boolean forceTargetPurge)
          Indicates for the purge methods whether to delete objects although they are target of associations.
 void setOnlyComponentObjects()
          Is equivilant to setOnlyComponentObjects(true)
 void setOnlyComponentObjects(boolean onlyComponentObjects)
          Indicate if only component objects to be taken.
 void setOrganization(javax.xml.registry.infomodel.Organization versionOrg)
          Specify the organization which the versioned objects receive.
 void setUserVersion(java.lang.String userVersion)
          Specify a user version for versioned assets.
 

Method Detail

createVersion

java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject)
                                   throws VersionException
Create a new version of a registry object (RegistryEntry or RegistryObject). If this object is associated with other objects and the copy mode is DEEP, then those objects get duplicated if the association rules say this. The object to be versioned must be a top-level versioned and not an intermediate one. The copy mode defaults to NONE.

Parameters:
registryObject - a versionable (or non-versionable) registry object (version top level)
Returns:
a collection of new version objects
Throws:
VersionException

createVersion

java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject,
                                   VersionCopyMode copyMode)
                                   throws VersionException
Create a new version of a registry object (RegistryEntry or RegistryObject). If this object is associated with other objects and the copy mode is DEEP, then those objects get duplicated if the association rules say this. The object to be versioned must be a top-level versioned and not an intermediate one.

Parameters:
registryObject - a versionable (or non-versionable) registry object (version top level)
copyMode - the copy mode (SHALLOW, DEEP, ...)
Returns:
a collection of new version objects
Throws:
VersionException

createVersion

java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject,
                                   VersionCopyMode copyMode,
                                   java.util.Collection ignoreCopyObjects)
                                   throws VersionException
Create a new version of a registry object (RegistryEntry or RegistryObject). If this object is associated with other objects and the copy mode is DEEP, then those objects get duplicated if the association rules say. The object to be versioned must be a top-level versioned and not an intermediate one. The 'ignoreCopyObjects' may contain RegistryObjects (currently only ExternalLink supported) which shouldn't be copied with the DEEP behaviour, but just reused.

Parameters:
registryObject - a versionable (or non-versionable) registry object (version top level)
copyMode - the copy mode (SHALLOW, DEEP, ...)
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
Returns:
a collection of new version objects
Throws:
VersionException

createVersion

java.util.Collection createVersion(javax.xml.registry.infomodel.Service serviceObject,
                                   java.util.Collection ignoreCopyObjects)
                                   throws VersionException
Create a new version of a Service object. The object to be versioned must be a top-level versioned and not an intermediate one. The copy mode defaults to NONE. The 'ignoreCopyObjects' may contain service-embedded RegistryObjects (currently only ExternalLink supported) which shouldn't be copied with the DEEP behaviour, but just reused.

Parameters:
serviceObject - a Service object (version top level)
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
Returns:
a collection of new version objects
Throws:
VersionException

createVersion

java.util.Collection createVersion(javax.xml.registry.infomodel.Service serviceObject,
                                   VersionCopyMode copyMode,
                                   java.util.Collection ignoreCopyObjects)
                                   throws VersionException
Create a new version of a Service object. The object to be versioned must be a top-level versioned and not an intermediate one. The 'ignoreCopyObjects' may contain service-embedded RegistryObjects (currently only ExternalLink supported) which shouldn't be copied with the DEEP behaviour, but just reused.

Parameters:
serviceObject - a Service object (version top level)
copyMode - the copy mode (SHALLOW, DEEP, ...)
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
Returns:
a collection of new version objects
Throws:
VersionException

createVersion

java.util.Collection createVersion(javax.xml.registry.infomodel.ExternalLink elink)
                                   throws VersionException
Create a new version of an External Link. The copy mode defaults to NONE.

Parameters:
elink - the external link
Returns:
a collection of new version objects
Throws:
VersionException

createVersion

java.util.Collection createVersion(javax.xml.registry.infomodel.ExternalLink elink,
                                   VersionCopyMode copyMode)
                                   throws VersionException
Create a new version of an External Link. The DEEP copy mode must only be used for WebDAV resources.

Parameters:
elink - the external link
copyMode - the copy mode (NONE, REMOVE, SHALLOW, DEEP)
Returns:
a collection of new version objects
Throws:
VersionException

copy

java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject)
                          throws VersionException
Copy the specified registry object (RegistryEntry or RegistryObject). If this object is associated with other objects and the copy mode is DEEP, then those objects get duplicated if the association rules say this. The copy mode defaults to NONE.

Parameters:
registryObject - registry object to copy
Returns:
a collection of new version objects
Throws:
VersionException

copy

java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject,
                          VersionCopyMode copyMode)
                          throws VersionException
Copy the specified registry object (RegistryEntry or RegistryObject). If this object is associated with other objects and the copy mode is DEEP, then those objects get duplicated if the association rules say this. The copy mode defaults to NONE.

Parameters:
registryObject - registry object to copy
copyMode - the copy mode (SHALLOW, DEEP, ...)
Returns:
a collection of new version objects
Throws:
VersionException

copy

java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject,
                          VersionCopyMode copyMode,
                          java.util.Collection ignoreCopyObjects)
                          throws VersionException
Copy the specified registry object (RegistryEntry or RegistryObject). If this object is associated with other objects and the copy mode is DEEP, then those objects get duplicated if the association rules say this. The copy mode defaults to NONE. The 'ignoreCopyObjects' may contain RegistryObjects (currently only ExternalLink supported) which shouldn't be copied.

Parameters:
registryObject - registry object to copy
copyMode - the copy mode (SHALLOW, DEEP, ...)
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
Returns:
a collection of new version objects
Throws:
VersionException

overwriteCopyRule

void overwriteCopyRule(CopyRule copyRule)
Overwrite a default copy rule. Can be used prior to 'createVersion' to change the DEEP default copy behaviour defined by the individual associations.

Parameters:
copyRule - the copy rule to be used

addVersionObjectListener

void addVersionObjectListener(VersionObjectListener versionObjectListener)
Add a object listener. The listener will be called for object to be versioned / new objects and objects to be purged.

Parameters:
versionObjectListener - the VersionObjectListener

removeVersionObjectListener

void removeVersionObjectListener(VersionObjectListener versionObjectListener)
Remove a object listener.

Parameters:
versionObjectListener - the VersionObjectListener

purge

java.util.Collection purge(javax.xml.registry.infomodel.RegistryObject registryObject)
                           throws VersionException
Purge older version registry entries and keep only the actual one. The entry specified could be any in the version chain. The following options can be used (to be set prior to 'purge'):
  • setForceTargetPurge()
  • setOnlyComponentObjects()

    Parameters:
    registryObject - a registry object to be purged
    Returns:
    list of Keys of objects to delete
    Throws:
    VersionException

  • purge

    java.util.Collection purge(javax.xml.registry.infomodel.RegistryObject registryObject,
                               int keepCount)
                               throws VersionException
    Purge older version registry entries. The entry specified must could be any in the version chain. The user can specify how much object versions to purge or how much to keep.
     Examples:
         having object versions:  v0 - v1 - v2 - v3 - v4
                  
         1.) purge(v4,1)   :   remove v0,v1,v2,v3
         2.) purge(v2,1)   :   remove v0,v1
         3.) purge(v3,2)   :   remove v0,v1
         4.) purge(v3,-1)  :   remove v0
         5.) purge(v4,0)   :   remove all
         
     
    The following options can be used (to be set prior to 'purge'):
  • setForceTargetPurge()
  • setOnlyComponentObjects()

    Parameters:
    registryObject - a registry object to be purged
    keepCount - > 0 : number of version objects to keep; < 0 : number of old object version to delete; 0 : delete all objects
    Returns:
    list of Keys of objects to delete
    Throws:
    VersionException

  • purge

    java.util.Collection purge(java.util.Collection registryObjects,
                               int keepCount)
                               throws VersionException
    Purge the list of registry objects with the same keep count. The following options can be used (to be set prior to 'purge'):
  • setForceTargetPurge()
  • setOnlyComponentObjects()

    Parameters:
    registryObjects - list of registry objects to be deleted
    keepCount - > 0 : number of version objects to keep; < 0 : number of old object version to delete; 0 : delete all objects
    Returns:
    list of Keys of objects to delete
    Throws:
    VersionException

  • removeRepositoryResources

    void removeRepositoryResources()
    Remove repository resources collected during purge(). Should be called after the registry objects to be purged were physically removed from the registry.


    getVersionObjects

    java.util.Collection getVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject)
                                           throws VersionException
    Get all versioned objects based on the object given. There is no matter which version the given object has. If the registryEntry has no further version objects, then the result contains only this object.

    Parameters:
    registryObject - a registry object (any version)
    Returns:
    list of all version registry objects
    Throws:
    VersionException

    getOlderVersionObjects

    java.util.List getOlderVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject,
                                          java.util.Collection<javax.xml.registry.infomodel.Classification> classifications)
                                          throws VersionException
    Get all older versioned objects based on the object given. The returned list is sorted by the version number in descending order. This means the newest version is the first in the list. If the registry object has no older versions, then an empty list will be returned.

    Parameters:
    registryObject - a (versioned) registry object
    classifications - collection of classifications; if not null and not empty then at least one of the classification must match
    Returns:
    list of all older versions sorted by version number descending
    Throws:
    VersionException

    getNewerVersionObjects

    java.util.List getNewerVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject,
                                          java.util.Collection<javax.xml.registry.infomodel.Classification> classifications)
                                          throws VersionException
    Get all newer versioned objects based on the object given. The returned list is sorted by the version number in descending order. This means the newest version is the first in the list. If the registry object has no older versions, then an empty list will be returned.

    Parameters:
    registryObject - a (versioned) registry object
    classifications - collection of classifications; if not null and not empty then at least one of the classification must match
    Returns:
    list of all newer versions sorted by version number ascending
    Throws:
    VersionException

    getNewVersionObject

    javax.xml.registry.infomodel.RegistryObject getNewVersionObject(javax.xml.registry.infomodel.RegistryObject registryObject,
                                                                    java.util.Collection<javax.xml.registry.infomodel.RegistryObject> newObjects)
                                                                    throws VersionException
    Get the new version object of the original object out of the collection of new objects

    Parameters:
    registryObject - the original object which was versioned
    newObjects - collection of new objects
    Returns:
    the new object, derived from registryObject; null: not found
    Throws:
    VersionException

    getMaxVersionObject

    javax.xml.registry.infomodel.RegistryObject getMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj)
                                                                    throws VersionException
    Get the maximum version object of an arbitrary given object in a versioning row.

    Parameters:
    regObj - any registry object in a versioning row
    Returns:
    the object with the highest version regObj: if no versioning (or already the highest one)
    Throws:
    VersionException

    isMaxVersionObject

    boolean isMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj)
                               throws VersionException
    Checks if the given object is the maximum (or only) version object

    Parameters:
    regObj - a registry object
    Returns:
    true: is the maximum (or only) version object false: its an intermediate version object
    Throws:
    VersionException

    getAllIgnoredObjects

    java.util.Collection getAllIgnoredObjects(java.util.Collection ignoredObjects)
                                              throws VersionException
    Get the entire list of objects to be ignored. Main task is to check the entries for associated ones and add them to the resulting list.

    Parameters:
    ignoredObjects - list of RegistryObject to be ignored
    Returns:
    list of RegistryObject to be ignored + evtl. more
    Throws:
    VersionException

    setForceTargetPurge

    void setForceTargetPurge(boolean forceTargetPurge)
    Indicates for the purge methods whether to delete objects although they are target of associations. The default is false.

    Parameters:
    forceTargetPurge - true: delete objects no matter of target associations; false: reject object delete (implicitely by JAXR) if they are target of associations

    setUserVersion

    void setUserVersion(java.lang.String userVersion)
    Specify a user version for versioned assets.

    Parameters:
    userVersion - the user version (null: not used)

    setOrganization

    void setOrganization(javax.xml.registry.infomodel.Organization versionOrg)
    Specify the organization which the versioned objects receive. Default: the organization of the origin object.

    Parameters:
    versionOrg - the organization for the versioned objects (null: not used)

    getVersionResult

    VersionResult getVersionResult()
    Get the version result. Contains denied object info after any of the createVersion() methods.

    Returns:
    the version result values

    setOnlyComponentObjects

    void setOnlyComponentObjects(boolean onlyComponentObjects)
    Indicate if only component objects to be taken. If set to true then only this object gets versioned. If set to false and there is a collector present for a type then all its composite objects get versioned determined by the collector.
    This option has effect on both 'createVersion' and 'purge'.

    Parameters:
    onlyComponentObjects - true: only the object itself; false: collect composite objects

    setOnlyComponentObjects

    void setOnlyComponentObjects()
    Is equivilant to setOnlyComponentObjects(true)