com.centrasite.lcmapi
Class VersioningUtil

java.lang.Object
  extended by com.centrasite.lcmapi.VersioningUtil

public class VersioningUtil
extends java.lang.Object

VersioningUtil.java


Constructor Summary
VersioningUtil(com.centrasite.jaxr.CentraSiteConnection conn)
           
 
Method Summary
 javax.xml.registry.infomodel.Concept getNewerActiveModelStateIfApplicable(javax.xml.registry.infomodel.Concept existingStateConcept)
           
 javax.xml.registry.infomodel.RegistryObject getNewerActiveVersion(javax.xml.registry.infomodel.RegistryObject olderVersion)
          Find the first(only) newer version of this registry object which is classified as active there can be utmost only one active newer version
 javax.xml.registry.infomodel.Concept getNewerVersionState(javax.xml.registry.infomodel.Concept olderStateConcept, LCModel newerModel)
          Get the newer version model's LC state concept which supersedes the given older state concept
 javax.xml.registry.infomodel.RegistryObject getOlderActiveVersion(javax.xml.registry.infomodel.RegistryObject newerVersion)
          Find the first(only) older version of this registry object which is classified as active there can be utmost only one active older version
 javax.xml.registry.infomodel.RegistryObject getOlderInactiveVersion(javax.xml.registry.infomodel.RegistryObject newerVersion)
          Find the first(only) older version of this registry object which is classified as inactive there can be utmost only one active older version
 LCState getSupersededNextState(javax.xml.registry.infomodel.RegistryObject olderActiveVersion)
          if the given old version registry object (policy or lc model taxonomy) can be moved to a LC state which will make the old model to be superseded return the first such LCState, else return null
 void setToState(javax.xml.registry.infomodel.RegistryEntry policy, java.lang.String stateName)
          Sets the policy to requested lcm state, if not already set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersioningUtil

public VersioningUtil(com.centrasite.jaxr.CentraSiteConnection conn)
               throws LCMException
Throws:
LCMException
Method Detail

getSupersededNextState

public LCState getSupersededNextState(javax.xml.registry.infomodel.RegistryObject olderActiveVersion)
                               throws LCMException
if the given old version registry object (policy or lc model taxonomy) can be moved to a LC state which will make the old model to be superseded return the first such LCState, else return null

Returns:
if there is a LCState which will mark the older version of this model to superseded, else null
Throws:
LCMException

getOlderActiveVersion

public javax.xml.registry.infomodel.RegistryObject getOlderActiveVersion(javax.xml.registry.infomodel.RegistryObject newerVersion)
                                                                  throws LCMException
Find the first(only) older version of this registry object which is classified as active there can be utmost only one active older version

Parameters:
newerVersion - newer version registry object for which older active version is needed
Returns:
first(only) older version of this registry object which is classified as active
Throws:
LCMException

getOlderInactiveVersion

public javax.xml.registry.infomodel.RegistryObject getOlderInactiveVersion(javax.xml.registry.infomodel.RegistryObject newerVersion)
                                                                    throws LCMException
Find the first(only) older version of this registry object which is classified as inactive there can be utmost only one active older version

Parameters:
newerVersion - newer version registry object for which older inactive version is needed
Returns:
first(only) older version of this registry object which is classified as inactive
Throws:
LCMException

getNewerActiveVersion

public javax.xml.registry.infomodel.RegistryObject getNewerActiveVersion(javax.xml.registry.infomodel.RegistryObject olderVersion)
                                                                  throws LCMException
Find the first(only) newer version of this registry object which is classified as active there can be utmost only one active newer version

Parameters:
olderVersion - older version registry object for which newer active version is needed
Returns:
first(only) newer version of this registry object which is classified as active
Throws:
LCMException

getNewerVersionState

public javax.xml.registry.infomodel.Concept getNewerVersionState(javax.xml.registry.infomodel.Concept olderStateConcept,
                                                                 LCModel newerModel)
                                                          throws LCMException
Get the newer version model's LC state concept which supersedes the given older state concept

Parameters:
olderStateConcept - old state for which newer model state is needed
newerModel - model which supersedes the old state's model
Returns:
newer version model's LC state concept which supersedes the given older state concept
Throws:
LCMException

getNewerActiveModelStateIfApplicable

public javax.xml.registry.infomodel.Concept getNewerActiveModelStateIfApplicable(javax.xml.registry.infomodel.Concept existingStateConcept)
                                                                          throws LCMException,
                                                                                 javax.xml.registry.JAXRException
Throws:
LCMException
javax.xml.registry.JAXRException

setToState

public void setToState(javax.xml.registry.infomodel.RegistryEntry policy,
                       java.lang.String stateName)
                throws java.lang.Exception
Sets the policy to requested lcm state, if not already set.

Parameters:
policy - the policy registry object
stateName - name of the state (e.g. "Productive")
Throws:
java.lang.Exception - the policy is not permitted to set to requested state