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(RegistryObject registryObject)
Copies the specified registry object (RegistryEntry or RegistryObject).
|
void |
copy(RegistryObject registryObject,
VersionCopyMode copyMode)
Copies the specified registry object (RegistryEntry or RegistryObject).
|
void |
createServiceShallowVersion(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(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(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(Service jaxrService)
Creates a new version of a service and update the registry with all the new objects and
associations.
|
void |
createServiceVersion(Service jaxrService,
VersionCopyMode copyMode)
Creates a new version of a service and update the registry with all the new objects and
associations.
|
void |
createServiceVersion(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(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(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(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(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(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<RegistryObject> |
getAndCreateServiceShallowVersion(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<RegistryObject> |
getAndCreateServiceVersion(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(RegistryObject regObj)
Returns the major version number of any registry object.
|
int |
getMinorVersion(RegistryObject regObj)
Returns the minor version number of any registry object.
|
java.lang.String |
getUserVersion(RegistryObject regObj)
Returns the user version of any registry object.
|
RegistryObject |
getVersionObject(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(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(Service jaxrService) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceVersion(Service jaxrService, VersionCopyMode copyMode) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modeJAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceVersion(Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)copyMode
- desired copy modeignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionJAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceVersion(Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning) throws VersionException, 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 serviceJAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceVersion(Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning, java.lang.String userVersion) throws VersionException, 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)JAXRException
- if an internal error occurs on creating service versionVersionException
- if an internal error occurspublic void createServiceVersion(Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning, com.centrasite.jaxr.common.VersioningContext versionContext) throws VersionException, 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 theJAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic java.util.Collection<RegistryObject> getAndCreateServiceVersion(Service jaxrService, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects, boolean propagateVersioning, java.lang.String userVersion) throws VersionException, 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)JAXRException
- if an internal error occurs on creating the service versionVersionException
- if an internal error occurspublic void createServiceShallowVersion(Service jaxrService) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)JAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic void createServiceShallowVersion(Service jaxrService, java.lang.String userVersion) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)userVersion
- the user version (null: no user version)JAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic void createServiceShallowVersion(Service jaxrService, com.centrasite.jaxr.common.VersioningContext versionContext) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)versionContext
- context parameter for the versioningJAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic java.util.Collection<RegistryObject> getAndCreateServiceShallowVersion(Service jaxrService, java.lang.String userVersion) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)userVersion
- the user version (null: no user version)JAXRException
- if an internal error occurs on creating the service shallow versionVersionException
- if an internal error occurspublic void createServiceWithSchemasVersion(Service jaxrService) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)JAXRException
- if an internal error occurs on creating service with the schema versionVersionException
- if an internal error occurspublic void createServiceWithSchemasVersion(Service jaxrService, java.lang.String userVersion) throws VersionException, JAXRException
jaxrService
- an existing service (with the most recent version number)userVersion
- the user version for the objects (null: not used)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, 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 componentsJAXRException
- 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, 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 componentsJAXRException
- 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, JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)copyMode
- desired copy modeuserVersion
- the user version for the objects (null: not used)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, JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)copyMode
- desired copy modeJAXRException
- if an internal error occurs on creating the version objectsVersionException
- if an internal error occurspublic void createShallowVersions(java.util.Collection registryObjects) throws VersionException, JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)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, JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)userVersion
- the user version for the objects (null: not used)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, JAXRException
registryObjects
- list of versionable registry objects (RegistryObject)versionContext
- context parameter for the versioningJAXRException
- if an internal error occurs on creating the shallow version objectsVersionException
- if an internal error occurspublic void purgeServiceVersion(Service jaxrService, int keepCount) throws VersionException, 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 objectsJAXRException
- 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, 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 objectsJAXRException
- if an internal error occurs on purging the version objectsVersionException
- if an internal error occurspublic void copy(RegistryObject registryObject) throws VersionException, JAXRException
registryObject
- registry object to copyJAXRException
- if an internal error occurs on copyVersionException
- if an internal error occurspublic void copy(RegistryObject registryObject, VersionCopyMode copyMode) throws VersionException, JAXRException
registryObject
- registry object to copycopyMode
- the copy mode (SHALLOW, DEEP, ...)JAXRException
- if an internal error occurs on copyVersionException
- if an internal error occurspublic int getMajorVersion(RegistryObject regObj) throws VersionException
regObj
- a registry objectVersionException
- if encounters a JAXR errorpublic int getMinorVersion(RegistryObject regObj) throws VersionException
regObj
- a registry objectVersionException
- if encounters a JAXR errorpublic java.lang.String getUserVersion(RegistryObject regObj) throws VersionException
regObj
- a registry objectVersionException
- if an internal error occurs on retrieving user versionpublic RegistryObject getVersionObject(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.