public class VersionManagerImpl extends java.lang.Object implements VersionManager
Constructor and Description |
---|
VersionManagerImpl(com.centrasite.jaxr.JAXRAccessor jaxr)
Constructs the Version Manager Implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
addVersionObjectListener(VersionObjectListener versionObjectListener)
Adds a listener which is notified at registry objects updates.
|
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)
Copies the specified registry object (RegistryEntry or RegistryObject).
|
java.util.Collection |
copy(javax.xml.registry.infomodel.RegistryObject registryObject,
VersionCopyMode copyMode,
java.util.Collection ignoreCopyObjects)
Copies the specified registry object (RegistryEntry or RegistryObject).
|
java.util.Collection |
createVersion(javax.xml.registry.infomodel.ExternalLink elink)
Creates a new version of an External Link.
|
java.util.Collection |
createVersion(javax.xml.registry.infomodel.ExternalLink elink,
VersionCopyMode copyMode)
A new Version of an External link is created with the copy modes described below.
|
java.util.Collection |
createVersion(javax.xml.registry.infomodel.RegistryObject registryObject)
Creates a new version of a registry object (RegistryEntry or RegistryObject).
|
java.util.Collection |
createVersion(javax.xml.registry.infomodel.RegistryObject registryObject,
VersionCopyMode copyMode)
Creates a new version of a any registry object (all implementations of RegistryObject).
|
java.util.Collection |
createVersion(javax.xml.registry.infomodel.RegistryObject registryObject,
VersionCopyMode copyMode,
java.util.Collection ignoreCopyObjects)
Creates a new version of a registry object (RegistryEntry or RegistryObject).
|
java.util.Collection |
createVersion(javax.xml.registry.infomodel.Service serviceObject,
java.util.Collection ignoreCopyObjects)
Creates a new version of a Service object.
|
java.util.Collection |
createVersion(javax.xml.registry.infomodel.Service serviceObject,
VersionCopyMode copyMode,
java.util.Collection ignoreCopyObjects)
Creates a new version of a Service object.
|
java.util.Collection |
getAllIgnoredObjects(java.util.Collection ignoredObjects)
Gets the entire list of objects to be ignored.
|
javax.xml.registry.infomodel.RegistryObject |
getMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj)
Gets 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)
Gets all older 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)
Gets 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)
Gets all newer versioned objects based on the object given.
|
java.util.Collection |
getPurgedWebDAVResources()
Delivers the list of resources purging in WebDAV
|
ICollectorVersioning |
getVersionCollector(javax.xml.registry.infomodel.RegistryObject oldRegistryObj,
boolean recursiveCall)
Gets the version collector depending on the object's type.
|
java.util.Collection |
getVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject)
Gets all versioned objects based on the object given.
|
VersionResult |
getVersionResult()
Gets the version result.
|
boolean |
isForceTargetPurge() |
boolean |
isMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj)
Checks if the given object is the maximum (or only) version object
|
boolean |
isOnlyComponentObjects() |
void |
overwriteCopyRule(CopyRule copyRule)
Overwrites a default copy rule.
|
java.util.Collection |
purge(java.util.Collection registryObjects,
int keepCount)
Purges the list of registry objects with the same keep count.
|
java.util.Collection |
purge(javax.xml.registry.infomodel.RegistryObject registryObject)
Purges older version registry entries and keep only the actual one.
|
java.util.Collection |
purge(javax.xml.registry.infomodel.RegistryObject purgeObject,
int keepCount)
Purges older version registry entries.
|
void |
removeRepositoryResources()
Removes repository resources, collected during purge() methods.
|
void |
removeVersionObjectListener(VersionObjectListener versionObjectListener)
Removes a registered 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)
Implemented in this way:
Service: true: Service+related - false: Service + related + schemas
Schema: true: Schema - false: Schema + all referenced schemas
|
void |
setOrganization(javax.xml.registry.infomodel.Organization versionOrg)
Specifies the organization which the versioned objects receive.
|
void |
setUserVersion(java.lang.String userVersion)
Specifies a user version for versioned assets.
|
public VersionManagerImpl(com.centrasite.jaxr.JAXRAccessor jaxr)
jaxr
- opened JAXR connectionpublic void overwriteCopyRule(CopyRule copyRule)
overwriteCopyRule
in interface VersionManager
copyRule
- the copy rule to be usedpublic void addVersionObjectListener(VersionObjectListener versionObjectListener)
addVersionObjectListener
in interface VersionManager
versionObjectListener
- a implementation of VersionObjectListener
public void removeVersionObjectListener(VersionObjectListener versionObjectListener)
removeVersionObjectListener
in interface VersionManager
versionObjectListener
- a registered VersionObjectListener
public final void setUserVersion(java.lang.String userVersion)
setUserVersion
in interface VersionManager
userVersion
- the user version is null if not used)public final void setOrganization(javax.xml.registry.infomodel.Organization versionOrg)
setOrganization
in interface VersionManager
versionOrg
- the organization for the versioned objectspublic VersionResult getVersionResult()
getVersionResult
in interface VersionManager
public void setOnlyComponentObjects()
VersionManager
setOnlyComponentObjects
in interface VersionManager
setOnlyComponentObjects(boolean)
public void setOnlyComponentObjects(boolean onlyComponentObjects)
setOnlyComponentObjects
in interface VersionManager
onlyComponentObjects
- true
if it is a component objects.public boolean isOnlyComponentObjects()
true
only component objectfalse
everything of the composite objectpublic java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject) throws VersionException
createVersion
in interface VersionManager
registryObject
- a versionable (or non-versionable) registry object (version top level)VersionException
- if an internal error occurs on creating versionpublic java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode) throws VersionException
Specials for certain registry objects:
Depending on the copy mode, the following picture exists:
1) None: +---------------+ +---------------+ | RegistryEntry | <---------- | RegistryEntry | | vers=n | Supersedes | vers=n+1 | +---------------+ +---------------+ | assoc | V object 2) Shallow: +---------------+ +---------------+ | RegistryEntry | <---------- | RegistryEntry | | vers=n | Supersedes | vers=n+1 | +---------------+ +---------------+ | | assoc | | V | object <-------------------' 3) Deep: Depending on the association type the referenced objects get pointed as shown in 'Shallow', or will be also versioned: +---------------+ +---------------+ | RegistryEntry | <---------- | RegistryEntry | | vers=n | Supersedes | vers=n+1 | +---------------+ +---------------+ | | assoc | | V V object (n) object (n+1) Also duplicates associated external links if they are bound to WebDAV resources and the resource itself. 4) Remove Same as 'None' but if the object contains ExternalLink objects they will be removed from the object.
createVersion
in interface VersionManager
registryObject
- a versionable registry entry or a usual registry objectcopyMode
- the copy mode (NONE, SHALLOW, DEEP, REMOVE)VersionException
- if an internal error occurs on creating versionpublic java.util.Collection createVersion(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects) throws VersionException
createVersion
in interface VersionManager
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 versionVersionException
- if an internal error occurs on creating versionpublic java.util.Collection createVersion(javax.xml.registry.infomodel.Service serviceObject, java.util.Collection ignoreCopyObjects) throws VersionException
createVersion
in interface VersionManager
serviceObject
- a Service object (version top level)ignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionVersionException
- if an internal error occurs on creating versionpublic java.util.Collection createVersion(javax.xml.registry.infomodel.Service serviceObject, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects) throws VersionException
createVersion
in interface VersionManager
serviceObject
- a Service object (version top level)copyMode
- the copy mode (SHALLOW, DEEP, ...)ignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionVersionException
- if an internal error occurs on creating versionpublic java.util.Collection createVersion(javax.xml.registry.infomodel.ExternalLink elink) throws VersionException
createVersion
in interface VersionManager
elink
- the external linkVersionException
- if an internal error occurs on creating versionpublic java.util.Collection createVersion(javax.xml.registry.infomodel.ExternalLink elink, VersionCopyMode copyMode) throws VersionException
createVersion
in interface VersionManager
elink
- external link to be duplicatedcopyMode
- copy modeVersionException
- if an internal error occurs on creating version *ExternalLinkVersion
public java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject) throws VersionException
copy
in interface VersionManager
registryObject
- registry object to copyVersionException
- if an internal error occurs on copypublic java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode) throws VersionException
copy
in interface VersionManager
registryObject
- registry object to copycopyMode
- the copy mode (SHALLOW, DEEP, ...)VersionException
- if an internal error occurs on copypublic java.util.Collection copy(javax.xml.registry.infomodel.RegistryObject registryObject, VersionCopyMode copyMode, java.util.Collection ignoreCopyObjects) throws VersionException
copy
in interface VersionManager
registryObject
- registry object to copycopyMode
- the copy mode (SHALLOW, DEEP, ...)ignoreCopyObjects
- list of RegistryObject which shouldn't get a new versionVersionException
- if an internal error occurs on copypublic java.util.Collection purge(java.util.Collection registryObjects, int keepCount) throws VersionException
purge
in interface VersionManager
registryObjects
- list of registry objects to be deletedkeepCount
- > 0 : number of version objects to keep;
< 0 : number of old object version to delete;
0 : delete all objectsVersionException
- if an internal error occurs on purgepublic java.util.Collection purge(javax.xml.registry.infomodel.RegistryObject registryObject) throws VersionException
purge
in interface VersionManager
registryObject
- a registry object to be purgedVersionException
- if an internal error occurs on purgepublic java.util.Collection purge(javax.xml.registry.infomodel.RegistryObject purgeObject, int keepCount) throws VersionException
purge
in interface VersionManager
purgeObject
- a registry object to be purgedkeepCount
- > 0 : number of version objects to keep;
< 0 : number of old object version to delete;
0 : delete all objectsVersionException
- if an internal error occurs on purgepublic void removeRepositoryResources()
removeRepositoryResources
in interface VersionManager
public java.util.Collection getVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject) throws VersionException
Example: +-------------+ supersedes +-------------+ | object (v0) | <---------- | object (v1) | +-------------+ +-------------+
getVersionObjects
in interface VersionManager
registryObject
- a registry object (any version)VersionException
- if an internal error occurs on retrieving the version objectspublic javax.xml.registry.infomodel.RegistryObject getNewVersionObject(javax.xml.registry.infomodel.RegistryObject registryObject, java.util.Collection<javax.xml.registry.infomodel.RegistryObject> newObjects) throws VersionException
getNewVersionObject
in interface VersionManager
registryObject
- the original object which was versionednewObjects
- collection of new objectsVersionException
- if an internal error occurs on retrieving the new versionpublic java.util.List getNewerVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject, java.util.Collection<javax.xml.registry.infomodel.Classification> classifications) throws VersionException
getNewerVersionObjects
in interface VersionManager
registryObject
- a (versioned) registry objectclassifications
- collection of classifications; if not null and not empty
then at least one of the classification must matchVersionException
- if an internal error occurs on new version objectspublic java.util.List getOlderVersionObjects(javax.xml.registry.infomodel.RegistryObject registryObject, java.util.Collection<javax.xml.registry.infomodel.Classification> classifications) throws VersionException
getOlderVersionObjects
in interface VersionManager
registryObject
- a (versioned) registry objectclassifications
- collection of classifications; if not null and not empty
then at least one of the classification must matchVersionException
- if an internal error occurs on old version objectspublic javax.xml.registry.infomodel.RegistryObject getMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj) throws VersionException
getMaxVersionObject
in interface VersionManager
regObj
- any registry object in a versioning rowVersionException
- if an internal error occurs on max version objectpublic boolean isMaxVersionObject(javax.xml.registry.infomodel.RegistryObject regObj) throws VersionException
isMaxVersionObject
in interface VersionManager
regObj
- a registry objectVersionException
- if an internal error occurspublic java.util.Collection getAllIgnoredObjects(java.util.Collection ignoredObjects) throws VersionException
getAllIgnoredObjects
in interface VersionManager
ignoredObjects
- list of RegistryObject to be ignoredVersionException
- if an internal error occurspublic java.util.Collection getPurgedWebDAVResources()
public final void setForceTargetPurge(boolean forceTargetPurge)
setForceTargetPurge
in interface VersionManager
forceTargetPurge
- true
delete objects no matter of target associations;
false
reject object delete (implicitly by JAXR) if they
are target of associationspublic boolean isForceTargetPurge()
true
if target associations of purged objects to be removedpublic ICollectorVersioning getVersionCollector(javax.xml.registry.infomodel.RegistryObject oldRegistryObj, boolean recursiveCall) throws javax.xml.registry.JAXRException, VersionException
oldRegistryObj
- the (old - to be versioned) registry objectrecursiveCall
- true: within recursionjavax.xml.registry.JAXRException
- if an internal error occurs on retrieving the version collectorVersionException
- if an internal error occurs