public class VersionAdministrator
extends java.lang.Object
Holds methods to perform conveniently version actions including saving the changes.
Constructor and Description |
---|
VersionAdministrator(com.centrasite.jaxr.JAXRAccessor jaxr)
Constuct a Version Administrator.
|
Modifier and Type | Method and Description |
---|---|
void |
copy(javax.xml.registry.infomodel.RegistryObject registryObject)
Copies the specified registry object (RegistryEntry or RegistryObject).
|
void |
copy(javax.xml.registry.infomodel.RegistryObject registryObject,
VersionCopyMode copyMode)
Copies the specified registry object (RegistryEntry or RegistryObject).
|
void |
createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Creates 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)
Gets 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)
Purges old versions of the given service.
|
void |
purgeVersions(java.util.Collection registryObjects,
int keepCount)
Purges all registry entries given in the list.
|
public VersionAdministrator(com.centrasite.jaxr.JAXRAccessor jaxr)
jaxr
- opened JAXR connectionpublic void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)javax.xml.registry.JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modejavax.xml.registry.JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modeignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionjavax.xml.registry.JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceVersion(javax.xml.registry.infomodel.Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modeignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionpropagateVersioning
- true: also version related schemas; false: version only the servicejavax.xml.registry.JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic 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
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modeignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionpropagateVersioning
- true: also version related schemas; false: version only the serviceuserVersion
- the user version (null: no user version)javax.xml.registry.JAXRException
- if an internal error occurs on creating service versionVersionException
- if an internal error occurspublic 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
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modeignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionpropagateVersioning
- true: also version related schemas; false: version only the serviceversionContext
- context parameter for the versioning (receives thejavax.xml.registry.JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic 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
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modeignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionpropagateVersioning
- true: also version related schemas; false: version only the serviceuserVersion
- the user version (null: no user version)javax.xml.registry.JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)javax.xml.registry.JAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService, java.lang.String userVersion) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)userVersion
- the user version (null: no user version)javax.xml.registry.JAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic void createServiceShallowVersion(javax.xml.registry.infomodel.Service jaxrService, com.centrasite.jaxr.common.VersioningContext versionContext) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)versionContext
- context parameter for the versioningjavax.xml.registry.JAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic 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
jaxrService
- an existing service (with the most recent version number)userVersion
- the user version (null: no user version)javax.xml.registry.JAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic void createServiceWithSchemasVersion(javax.xml.registry.infomodel.Service jaxrService) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)javax.xml.registry.JAXRException
- if an internal error occurs on creating service with the schema versionVersionException
- if an internal error occurspublic void createServiceWithSchemasVersion(javax.xml.registry.infomodel.Service jaxrService, java.lang.String userVersion) throws VersionException, javax.xml.registry.JAXRException
jaxrService
- an existing service (with the most recent version number)userVersion
- the user version for the objects (null: not used)javax.xml.registry.JAXRException
- if an internal error occurs on creating service with the schema versionVersionException
- if an internal error occurspublic void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode, java.lang.String userVersion, boolean propagateVersioning) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)copyMode
- desired copy modeuserVersion
- the user version for the objects (null: not used)propagateVersioning
- true
version all objects false
version only the componentsjavax.xml.registry.JAXRException
- if an internal error occurs on creating the versionsVersionException
- if an internal error occurspublic void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode, com.centrasite.jaxr.common.VersioningContext versionContext, boolean propagateVersioning) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)copyMode
- desired copy modeversionContext
- context parameter for the versioning (receives the new version objects)propagateVersioning
- true
all objects false
only the componentsjavax.xml.registry.JAXRException
- if an internal error occurs on creating the versionsVersionException
- if an internal error occurspublic void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode, java.lang.String userVersion) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)copyMode
- desired copy modeuserVersion
- the user version for the objects (null: not used)javax.xml.registry.JAXRException
- if an internal error occurs on creating the version objectsVersionException
- if an internal error occurspublic void createVersions(java.util.Collection registryObjects, VersionCopyMode copyMode) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)copyMode
- desired copy modejavax.xml.registry.JAXRException
- if an internal error occurs on creating the version objectsVersionException
- if an internal error occurspublic void createShallowVersions(java.util.Collection registryObjects) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)javax.xml.registry.JAXRException
- if an internal error occurs on creating the shallow version objectsVersionException
- if an internal error occurspublic void createShallowVersions(java.util.Collection registryObjects, java.lang.String userVersion) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)userVersion
- the user version for the objects (null: not used)javax.xml.registry.JAXRException
- if an internal error occurs on creating the shallow version objectsVersionException
- if an internal error occurspublic void createShallowVersions(java.util.Collection registryObjects, com.centrasite.jaxr.common.VersioningContext versionContext) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)versionContext
- context parameter for the versioningjavax.xml.registry.JAXRException
- if an internal error occurs on creating the shallow version objectsVersionException
- if an internal error occurspublic void purgeServiceVersion(javax.xml.registry.infomodel.Service jaxrService, int keepCount) throws VersionException, javax.xml.registry.JAXRException
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 objectsjavax.xml.registry.JAXRException
- if an internal error occurs on purging the service versionVersionException
- if an internal error occurspublic void purgeVersions(java.util.Collection registryObjects, int keepCount) throws VersionException, javax.xml.registry.JAXRException
registryObjects
- list of top-level versioned registry objectskeepCount
- > 0 : number of version objects to keep;
< 0 : number of old object version to delete;
0 : delete all objectsjavax.xml.registry.JAXRException
- if an internal error occurs on purging the version objectsVersionException
- if an internal error occurspublic void copy(javax.xml.registry.infomodel.RegistryObject registryObject) throws VersionException, javax.xml.registry.JAXRException
registryObject
- registry object to copyjavax.xml.registry.JAXRException
- if an internal error occurs on copyVersionException
- if an internal error occurspublic void copy(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode) throws VersionException, javax.xml.registry.JAXRException
registryObject
- registry object to copycopyMode
- the copy mode (SHALLOW, DEEP, ...)javax.xml.registry.JAXRException
- if an internal error occurs on copyVersionException
- if an internal error occurspublic int getMajorVersion(javax.xml.registry.infomodel.RegistryObject regObj) throws VersionException
regObj
- a registry objectVersionException
- if encounters a JAXR errorpublic int getMinorVersion(javax.xml.registry.infomodel.RegistryObject regObj) throws VersionException
regObj
- a registry objectVersionException
- if encounters a JAXR errorpublic java.lang.String getUserVersion(javax.xml.registry.infomodel.RegistryObject regObj) throws VersionException
regObj
- a registry objectVersionException
- if an internal error occurs on retrieving user versionpublic javax.xml.registry.infomodel.RegistryObject getVersionObject(javax.xml.registry.infomodel.RegistryObject regObj, int majorVersion) throws VersionException
regObj
- a registry objectmajorVersion
- the desired version numberVersionException
- if an internal error occurs on retrieving user versionpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- the command line argument.java.lang.Exception
- if an internal error occurs.