com.centrasite.registry.versionmanagementservices
Class VersionAdministrator

java.lang.Object
  extended by com.centrasite.registry.versionmanagementservices.VersionAdministrator

public class VersionAdministrator
extends java.lang.Object

Version Administrator.

Holds methods to perform conveniently version actions including saving the changes.


Constructor Summary
VersionAdministrator(com.centrasite.jaxr.JAXRAccessor jaxr)
          Constuct a Version Administrator.
 
Method Summary
 void copy(javax.xml.registry.infomodel.RegistryObject registryObject)
          Copy the specified registry object (RegistryEntry or RegistryObject).
 void copy(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode)
          Copy the specified registry object (RegistryEntry or RegistryObject).
 void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService)
          Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations.
 void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService, java.lang.String userVersion)
          Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations.
 void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService, com.centrasite.jaxr.common.VersioningContext versionContext)
          Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations.
 void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService)
          Create a new version of a service and update the registry with all the new objects and associations.
 void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode)
          Create a new version of a service and update the registry with all the new objects and associations.
 void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects)
          Create a new version of a service and update the registry with all the new objects and associations.
 void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning)
          Create a new version of a service and update the registry with all the new objects and associations.
 void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning, java.lang.String userVersion)
          Create a new version of a service and update the registry with all the new objects and associations.
 void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning, com.centrasite.jaxr.common.VersioningContext versionContext)
          Create a new version of a service and update the registry with all the new objects and associations.
 void createServiceWithSchemasVersion(javax.xml.registry.infomodel.Service jaxrService)
          Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations.
 void createServiceWithSchemasVersion(javax.xml.registry.infomodel.Service jaxrService, java.lang.String userVersion)
          Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations.
 void createShallowVersions(java.util.Collection registryObjects)
          Create new versions in SHALLOW mode of objects given by 'registryEntries' and store them all in the registry.
 void createShallowVersions(java.util.Collection registryObjects, java.lang.String userVersion)
          Create new versions in SHALLOW mode of objects given by 'registryEntries' and store them all in the registry.
 void createShallowVersions(java.util.Collection registryObjects, com.centrasite.jaxr.common.VersioningContext versionContext)
          Create new versions in SHALLOW mode of objects given by 'registryEntries' and store them all in the registry.
 void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode)
          Create new versions of objects given by 'registryEntries' and store them all in the registry.
 void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode, java.lang.String userVersion)
          Create new versions of objects given by 'registryEntries' and store them all in the registry.
 void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode, java.lang.String userVersion, boolean propagateVersioning)
          Create new versions of objects given by 'registryEntries' and store them all in the registry.
 void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode, com.centrasite.jaxr.common.VersioningContext versionContext, boolean propagateVersioning)
          Create new versions of objects given by 'registryEntries' and store them all in the registry.
 java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getAndCreateServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService, java.lang.String userVersion)
          Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations.
 java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getAndCreateServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning, java.lang.String userVersion)
          Create a new version of a service and update the registry with all the new objects and associations.
 int getMajorVersion(javax.xml.registry.infomodel.RegistryObject regObj)
          Returns the major version number of any registry object.
 int getMinorVersion(javax.xml.registry.infomodel.RegistryObject regObj)
          Returns the minor version number of any registry object.
 java.lang.String getUserVersion(javax.xml.registry.infomodel.RegistryObject regObj)
          Returns the user version of any registry object.
 javax.xml.registry.infomodel.RegistryObject getVersionObject(javax.xml.registry.infomodel.RegistryObject regObj, int majorVersion)
          Get the object with the desired version number of the specified registry object (which is assumed to be within a version chain)
static void main(java.lang.String[] args)
          For Versioning on command line.
 void purgeServiceVersion(javax.xml.registry.infomodel.Service jaxrService, int keepCount)
          Purge old versions of the given service.
 void purgeVersions(java.util.Collection registryObjects, int keepCount)
          Purge all registry entries given in the list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionAdministrator

public VersionAdministrator(com.centrasite.jaxr.JAXRAccessor jaxr)
Constuct a Version Administrator.

Parameters:
jaxr - opened JAXR connection
Method Detail

createServiceVersion

public void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService)
                          throws VersionException,
                                 javax.xml.registry.JAXRException
Create a new version of a service and update the registry with all the new objects and associations. The copy mode is NONE.

Parameters:
jaxrService - an existing service (with the most recent version number)
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceVersion

public void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService,
                                 VersionCopyMode copyMode)
                          throws VersionException,
                                 javax.xml.registry.JAXRException
Create a new version of a service and update the registry with all the new objects and associations.

Parameters:
jaxrService - an existing service (with the most recent version number)
copyMode - desired copy mode
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceVersion

public void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService,
                                 VersionCopyMode copyMode,
                                 java.util.Collection ignoreCopyObjects)
                          throws VersionException,
                                 javax.xml.registry.JAXRException
Create a new version of a service and update the registry with all the new objects and associations.

Parameters:
jaxrService - an existing service (with the most recent version number)
copyMode - desired copy mode ¶m ignoreCopyObjects list of RegistryObject which shouldn't get a new version
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceVersion

public void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService,
                                 VersionCopyMode copyMode,
                                 java.util.Collection ignoreCopyObjects,
                                 boolean propagateVersioning)
                          throws VersionException,
                                 javax.xml.registry.JAXRException
Create a new version of a service and update the registry with all the new objects and associations.

Parameters:
jaxrService - an existing service (with the most recent version number)
copyMode - desired copy mode
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
propagateVersioning - true: also version related schemas; false: version only the service
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceVersion

public void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService,
                                 VersionCopyMode copyMode,
                                 java.util.Collection ignoreCopyObjects,
                                 boolean propagateVersioning,
                                 java.lang.String userVersion)
                          throws VersionException,
                                 javax.xml.registry.JAXRException
Create a new version of a service and update the registry with all the new objects and associations.

Parameters:
jaxrService - an existing service (with the most recent version number)
copyMode - desired copy mode
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
propagateVersioning - true: also version related schemas; false: version only the service
userVersion - the user version (null: no user version)
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceVersion

public void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService,
                                 VersionCopyMode copyMode,
                                 java.util.Collection ignoreCopyObjects,
                                 boolean propagateVersioning,
                                 com.centrasite.jaxr.common.VersioningContext versionContext)
                          throws VersionException,
                                 javax.xml.registry.JAXRException
Create a new version of a service and update the registry with all the new objects and associations.

Parameters:
jaxrService - an existing service (with the most recent version number)
copyMode - desired copy mode
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
propagateVersioning - true: also version related schemas; false: version only the service
versionContext - context parameter for the versioning (receives the
Throws:
VersionException
javax.xml.registry.JAXRException

getAndCreateServiceVersion

public java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getAndCreateServiceVersion(javax.xml.registry.infomodel.Service jaxrService,
                                                                                                    VersionCopyMode copyMode,
                                                                                                    java.util.Collection ignoreCopyObjects,
                                                                                                    boolean propagateVersioning,
                                                                                                    java.lang.String userVersion)
                                                                                             throws VersionException,
                                                                                                    javax.xml.registry.JAXRException
Create a new version of a service and update the registry with all the new objects and associations.

Parameters:
jaxrService - an existing service (with the most recent version number)
copyMode - desired copy mode
ignoreCopyObjects - list of RegistryObject which shouldn't get a new version
propagateVersioning - true: also version related schemas; false: version only the service
userVersion - the user version (null: no user version)
Returns:
collection of new created version objects
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceShallowVersion

public void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService)
                                 throws VersionException,
                                        javax.xml.registry.JAXRException
Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations. Do not create a new version of schema objects and sub-wsdls.

Parameters:
jaxrService - an existing service (with the most recent version number)
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceShallowVersion

public void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService,
                                        java.lang.String userVersion)
                                 throws VersionException,
                                        javax.xml.registry.JAXRException
Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations. Do not create a new version of schema objects and sub-wsdls.

Parameters:
jaxrService - an existing service (with the most recent version number)
userVersion - the user version (null: no user version)
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceShallowVersion

public void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService,
                                        com.centrasite.jaxr.common.VersioningContext versionContext)
                                 throws VersionException,
                                        javax.xml.registry.JAXRException
Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations. Do not create a new version of schema objects and sub-wsdls.

Parameters:
jaxrService - an existing service (with the most recent version number)
versionContext - context parameter for the versioning
Throws:
VersionException
javax.xml.registry.JAXRException

getAndCreateServiceShallowVersion

public java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getAndCreateServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService,
                                                                                                           java.lang.String userVersion)
                                                                                                    throws VersionException,
                                                                                                           javax.xml.registry.JAXRException
Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations. Do not create a new version of schema objects and sub-wsdls.

Parameters:
jaxrService - an existing service (with the most recent version number)
userVersion - the user version (null: no user version)
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceWithSchemasVersion

public void createServiceWithSchemasVersion(javax.xml.registry.infomodel.Service jaxrService)
                                     throws VersionException,
                                            javax.xml.registry.JAXRException
Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations. Also a new version of schema objects and sub-wsdls are created.

Parameters:
jaxrService - an existing service (with the most recent version number)
Throws:
VersionException
javax.xml.registry.JAXRException

createServiceWithSchemasVersion

public void createServiceWithSchemasVersion(javax.xml.registry.infomodel.Service jaxrService,
                                            java.lang.String userVersion)
                                     throws VersionException,
                                            javax.xml.registry.JAXRException
Create a new version (in shallow mode) of a service and update the registry with all the new objects and associations. Also a new version of schema objects and sub-wsdls are created.

Parameters:
jaxrService - an existing service (with the most recent version number)
userVersion - the user version for the objects (null: not used)
Throws:
VersionException
javax.xml.registry.JAXRException

createVersions

public void createVersions(java.util.Collection registryObjects,
                           VersionCopyMode copyMode,
                           java.lang.String userVersion,
                           boolean propagateVersioning)
                    throws VersionException,
                           javax.xml.registry.JAXRException
Create new versions of objects given by 'registryEntries' and store them all in the registry. Note that the objects presented in the input list must only contain versionable registry objects or External Links. The objects will receive the calling user's organization.

Parameters:
registryObjects - list of versionable registry objects (RegistryObject)
copyMode - desired copy mode
userVersion - the user version for the objects (null: not used)
propagateVersioning - true: version all objects, false: version only the components
Throws:
VersionException
javax.xml.registry.JAXRException

createVersions

public void createVersions(java.util.Collection registryObjects,
                           VersionCopyMode copyMode,
                           com.centrasite.jaxr.common.VersioningContext versionContext,
                           boolean propagateVersioning)
                    throws VersionException,
                           javax.xml.registry.JAXRException
Create new versions of objects given by 'registryEntries' and store them all in the registry. Note that the objects presented in the input list must only contain versionable registry objects or External Links.

Parameters:
registryObjects - list of versionable registry objects (RegistryObject)
copyMode - desired copy mode
versionContext - context parameter for the versioning (receives the new version objects)
propagateVersioning - true: all objects, false: only the components
Throws:
VersionException
javax.xml.registry.JAXRException

createVersions

public void createVersions(java.util.Collection registryObjects,
                           VersionCopyMode copyMode,
                           java.lang.String userVersion)
                    throws VersionException,
                           javax.xml.registry.JAXRException
Create new versions of objects given by 'registryEntries' and store them all in the registry. Note that the objects presented in the input list must only contain versionable registry objects or External Links.

Parameters:
registryObjects - list of versionable registry objects (RegistryObject)
copyMode - desired copy mode
userVersion - the user version for the objects (null: not used)
Throws:
VersionException
javax.xml.registry.JAXRException

createVersions

public void createVersions(java.util.Collection registryObjects,
                           VersionCopyMode copyMode)
                    throws VersionException,
                           javax.xml.registry.JAXRException
Create new versions of objects given by 'registryEntries' and store them all in the registry. Note that the objects presented in the input list must only contain versionable registry objects or External Links.

Parameters:
registryObjects - list of versionable registry objects (RegistryObject)
copyMode - desired copy mode
Throws:
VersionException
javax.xml.registry.JAXRException

createShallowVersions

public void createShallowVersions(java.util.Collection registryObjects)
                           throws VersionException,
                                  javax.xml.registry.JAXRException
Create new versions in SHALLOW mode of objects given by 'registryEntries' and store them all in the registry. Note that the objects presented in the input list must only contain versionable registry objects or External Links.

Parameters:
registryObjects - list of versionable registry objects (RegistryObject)
Throws:
VersionException
javax.xml.registry.JAXRException

createShallowVersions

public void createShallowVersions(java.util.Collection registryObjects,
                                  java.lang.String userVersion)
                           throws VersionException,
                                  javax.xml.registry.JAXRException
Create new versions in SHALLOW mode of objects given by 'registryEntries' and store them all in the registry. Note that the objects presented in the input list must only contain versionable registry objects or External Links.

Parameters:
registryObjects - list of versionable registry objects (RegistryObject)
userVersion - the user version for the objects (null: not used)
Throws:
VersionException
javax.xml.registry.JAXRException

createShallowVersions

public void createShallowVersions(java.util.Collection registryObjects,
                                  com.centrasite.jaxr.common.VersioningContext versionContext)
                           throws VersionException,
                                  javax.xml.registry.JAXRException
Create new versions in SHALLOW mode of objects given by 'registryEntries' and store them all in the registry. Note that the objects presented in the input list must only contain versionable registry objects or External Links.

Parameters:
registryObjects - list of versionable registry objects (RegistryObject)
versionContext - context parameter for the versioning
Throws:
VersionException
javax.xml.registry.JAXRException

purgeServiceVersion

public void purgeServiceVersion(javax.xml.registry.infomodel.Service jaxrService,
                                int keepCount)
                         throws VersionException,
                                javax.xml.registry.JAXRException
Purge old versions of the given service. Delete all associated objects from registry and repository.

Parameters:
jaxrService - an existing service (with the most recent version number)
keepCount - > 0 : number of version objects to keep; < 0 : number of old object version to delete; 0 : delete all objects
Throws:
VersionException
javax.xml.registry.JAXRException

purgeVersions

public void purgeVersions(java.util.Collection registryObjects,
                          int keepCount)
                   throws VersionException,
                          javax.xml.registry.JAXRException
Purge all registry entries given in the list. Note that the list members must be top-level versionable registry objects. It performs the update in the registry and removes unused resources from the repository.

Parameters:
registryObjects - list of top-level versioned registry objects
keepCount - > 0 : number of version objects to keep; < 0 : number of old object version to delete; 0 : delete all objects
Throws:
VersionException
javax.xml.registry.JAXRException

copy

public void copy(javax.xml.registry.infomodel.RegistryObject registryObject)
          throws VersionException,
                 javax.xml.registry.JAXRException
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
Throws:
VersionException
javax.xml.registry.JAXRException

copy

public void copy(javax.xml.registry.infomodel.RegistryObject registryObject,
                 VersionCopyMode copyMode)
          throws VersionException,
                 javax.xml.registry.JAXRException
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, ...)
Throws:
VersionException
javax.xml.registry.JAXRException

getMajorVersion

public int getMajorVersion(javax.xml.registry.infomodel.RegistryObject regObj)
                    throws VersionException
Returns the major version number of any registry object. If the object was never versioned then 0 gets returned.

Parameters:
regObj - a registry object
Returns:
the major version
Throws:
VersionException - JAXR error

getMinorVersion

public int getMinorVersion(javax.xml.registry.infomodel.RegistryObject regObj)
                    throws VersionException
Returns the minor version number of any registry object. If the object was never versioned then 0 gets returned.

Parameters:
regObj - a registry object
Returns:
the minor version
Throws:
VersionException - JAXR error

getUserVersion

public java.lang.String getUserVersion(javax.xml.registry.infomodel.RegistryObject regObj)
                                throws VersionException
Returns the user version of any registry object. If the object was never versioned then "" gets returned.

Parameters:
regObj - a registry object
Returns:
the user version
Throws:
VersionException - JAXR error

getVersionObject

public javax.xml.registry.infomodel.RegistryObject getVersionObject(javax.xml.registry.infomodel.RegistryObject regObj,
                                                                    int majorVersion)
                                                             throws VersionException
Get the object with the desired version number of the specified registry object (which is assumed to be within a version chain)

Parameters:
regObj - a registry object
majorVersion - the desired version number
Returns:
the object with the requested major version number null: version element not found
Throws:
VersionException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
For Versioning on command line.

Parameters:
args -
Throws:
java.lang.Exception