com.centrasite.lcmapi
Interface LCMRuntimeManager


public interface LCMRuntimeManager

The LCMRuntimeManager provides all LCM runtime functionality viz., searching for LCModels, finding & setting the LCState of a given registryObject


Method Summary
 void approveStateChange(javax.xml.registry.infomodel.RegistryObject registryObject)
          Approves the state change
 java.util.Collection<LCMNode> findAllLCMNodes()
          Find all LCMNodes
 java.util.Collection<LCModel> findAllLCModels(javax.xml.registry.infomodel.Concept objectType, javax.xml.registry.infomodel.Organization organization)
          Find all active and incative LCModels that are applicable for the given object type/virtual type concept and the given organization.
 java.util.Collection<LCModel> findAllModels()
          Find all LCModels that are currently within the scope (global or organizational specific) of the logged-in user.
 java.util.Collection<LCModel> findAllModels(com.centrasite.resourceaccess.managers.ResourceAccessManager resourceManager)
          Find all LCModels that are currently within the scope (global or organizational specific) of the logged-in user.
 java.util.Collection<javax.xml.registry.infomodel.Concept> findAllTypesApplicableForLCM()
          Returns all types that can be life cycle enabled.
 java.util.Collection<LCModel> findInactiveModels()
          Find all LCModels in the whole system that are not active
 LCModel findLCMForLCM()
          Finds the LCModel for LCModels.
 LCModel findLCModel(javax.xml.registry.infomodel.Concept objectType, javax.xml.registry.infomodel.Organization organization)
          Find the active LCModel that is applicable for the given object type/virtual type concept and the given organization.
 LCModel findLCModel(javax.xml.registry.infomodel.RegistryObject registryObject)
          Find the LCModel that is assigned to the given registryObject
 LCModel findLCModel(java.lang.String typeName)
          Find the LCModel that is active for for the given type If there are two LCModels active for the given type (one global and the other local), the global LCModel will be returned.
 java.util.Collection<LCModel> findLCModels(java.util.Collection<javax.xml.registry.infomodel.Concept> objectTypes, java.util.Collection<javax.xml.registry.infomodel.Organization> organizations)
          Find the active LCModel that is applicable for the given object type/virtual type concept and the given organization.
 java.util.Map<javax.xml.registry.infomodel.Concept,LCModel> getApplicableLCModels(java.util.Collection<javax.xml.registry.infomodel.Concept> objectTypes, javax.xml.registry.infomodel.Organization organization)
          Returns a map containing the object types which have a global or org-specific LC Model applicable to them.
 java.util.Map<javax.xml.registry.infomodel.Concept,LCModel> getApplicableLCModels(java.util.Collection<javax.xml.registry.infomodel.Concept> objectTypes, javax.xml.registry.infomodel.Organization organization, boolean includeNativeType)
           
 LCMNode getLCMNode(java.lang.String nodeKey)
          Find the LCMNode with the given LCMNode key
 java.util.Collection<java.lang.String> getLCMNodeURLsForImport(javax.xml.registry.infomodel.RegistryObject registryObject)
          returns the collection of configuration URLs of nodes(stages) (if any) into which the given registry object can be imported returns an empty collection if this registry object is not LCM enabled or no nodes are specified for the current state of the registry object This method needs to be called before exporting any IRO and if it returns a non empty collection, export operation should include these stages as part of the export archive
 LCModel getLCModel(java.lang.String lcModelKey)
          Get the LCModel with the given key
 java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getLcmRelatedExportObjects(javax.xml.registry.infomodel.RegistryObject objectToExport)
          returns collection of registry objects for export which includes LC model classificationScheme, State Concepts, and their related stages returns an empty collection if the object sent is not a LC model classification scheme
 LCRegistryObjectState getLCState(javax.xml.registry.infomodel.RegistryObject registryObject)
          For the given registryObject return the current state
 LCModel getNewVersion(LCModel oldVersionModel)
          Return the new version of this model which supersedes it, if any.
 boolean isLCModel(javax.xml.registry.infomodel.ClassificationScheme taxonomy)
          Checks if the given taxonomy represents an LCModel taxonomy
 void rejectStateChange(javax.xml.registry.infomodel.RegistryObject registryObject)
          Rejects the state change
 void rejectStateChange(javax.xml.registry.infomodel.RegistryObject registryObject, LCState rejectState)
          Rejects the state change and set the state of the given registry object to the reject state provided there is a valid state transition from the state of the object prior to approval to the reject state.
 void setInitialLCState(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjects, LCState initialState)
          Set the initial states of the each registry object in the collection to the given state
 java.util.Collection<LCStateChangeStatus> setLCState(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjects, LCState targetState)
          Set the given registry objects to the given state
 LCStateChangeStatus setLCState(javax.xml.registry.infomodel.RegistryObject registryObject, LCState targetState)
          Set the given registry object to the given state
 void setLCStateEx(javax.xml.registry.infomodel.RegistryObject registryObject, LCState targetState)
          Set the given registry object to the given state but the difference between setLCState(RegistryObject, LCState) and setLCStateEx(RegistryObject, LCState) is in case of setLCState(RegistryObject, LCState) the policies required to execute & state persisting is happen immediately but in case of setLCStateEx(RegistryObject, LCState) we attach listeners to registry object to perform Pre and Post operations and those listeners invoked by the LifeCycleManager so the state change is happen as part of saveObjects.
 

Method Detail

findAllModels

java.util.Collection<LCModel> findAllModels(com.centrasite.resourceaccess.managers.ResourceAccessManager resourceManager)
                                            throws LCMException
Find all LCModels that are currently within the scope (global or organizational specific) of the logged-in user.

Returns:
all the LCModels as a collection, must not be null
Throws:
LCMException - - if the LCM provider encounters an internal error

findAllModels

java.util.Collection<LCModel> findAllModels()
                                            throws LCMException
Find all LCModels that are currently within the scope (global or organizational specific) of the logged-in user. Note: Please DO NOT USE this operation in POLICY implementation

Returns:
all the LCModels as a collection, must not be null
Throws:
LCMException - - if the LCM provider encounters an internal error

findInactiveModels

java.util.Collection<LCModel> findInactiveModels()
                                                 throws LCMException
Find all LCModels in the whole system that are not active

Returns:
the LCModels that are not active as a collection, must not be null
Throws:
LCMException - - if the LCM provider encounters an internal error

findLCModel

LCModel findLCModel(java.lang.String typeName)
                    throws LCMException
Find the LCModel that is active for for the given type If there are two LCModels active for the given type (one global and the other local), the global LCModel will be returned.

Parameters:
typeName - the name of the type for which the LCModel has to be found
Returns:
LCModel with the given name, null if no LCModel found
Throws:
LCMException - - if the LCM provider encounters an internal error

findLCModel

LCModel findLCModel(javax.xml.registry.infomodel.RegistryObject registryObject)
                    throws LCMException
Find the LCModel that is assigned to the given registryObject

Parameters:
registryObject - for which the LCModel has to be found
Returns:
LCModel of the registryObject, null if no LCModel found
Throws:
LCMException - - If the LCM provider encounters an internal error

findLCModel

LCModel findLCModel(javax.xml.registry.infomodel.Concept objectType,
                    javax.xml.registry.infomodel.Organization organization)
                    throws LCMException
Find the active LCModel that is applicable for the given object type/virtual type concept and the given organization. If there is an exclusive LCM for the virtual type, that takes the highest priority If there is no exclusive LCM for the virtual type and if the inheritsLCM flag is true, find an LCM for it's base type

Parameters:
objectType - The type for which the LCModel has to be found. Can be a virtual type or base type concept.
organization - The organization for which the model has to be found
Returns:
LCModel for the specified object type/virtual type and the organization, null if no LCModel is found
Throws:
LCMException - - If the LCM provider encounters an internal error

findLCModels

java.util.Collection<LCModel> findLCModels(java.util.Collection<javax.xml.registry.infomodel.Concept> objectTypes,
                                           java.util.Collection<javax.xml.registry.infomodel.Organization> organizations)
                                           throws LCMException
Find the active LCModel that is applicable for the given object type/virtual type concept and the given organization. If there is an exclusive LCM for the virtual type, that takes the highest priority If there is no exclusive LCM for the virtual type and if the inheritsLCM flag is true, find an LCM for it's base type

Parameters:
objectTypes - The type for which the LCModel has to be found. Can be a virtual type or base type concept.
organizations - The organization for which the model has to be found
Returns:
LCModels for the specified object type/virtual type and the organization, null if no LCModel is found
Throws:
LCMException - - If the LCM provider encounters an internal error

findAllLCModels

java.util.Collection<LCModel> findAllLCModels(javax.xml.registry.infomodel.Concept objectType,
                                              javax.xml.registry.infomodel.Organization organization)
                                              throws LCMException
Find all active and incative LCModels that are applicable for the given object type/virtual type concept and the given organization. If there is an exclusive LCM for the virtual type, that takes the highest priority If there is no exclusive LCM for the virtual type and if the inheritsLCM flag is true, find an LCM for it's base type

Parameters:
objectType - The type for which the LCModel has to be found. Can be a virtual type or base type concept.
organization - The organization for which the model has to be found
Returns:
the LCModels that are applicable for the given object type
Throws:
LCMException - - If the LCM provider encounters an internal error

findLCMForLCM

LCModel findLCMForLCM()
                      throws LCMException
Finds the LCModel for LCModels. If two LCModel for LCModels, one local belonging to the organization of the logged in user and the other global are present, the global model is returned

Returns:
LCModel for LCModels
Throws:
LCMException

getLCModel

LCModel getLCModel(java.lang.String lcModelKey)
                   throws LCMException
Get the LCModel with the given key

Parameters:
lcModelKey - the key of the LCModel which LCModel has to be retrieved
Returns:
LCModel with the given key, null if no LCModel found
Throws:
LCMException - - if the LCM provider encounters an internal error

getLCState

LCRegistryObjectState getLCState(javax.xml.registry.infomodel.RegistryObject registryObject)
                                 throws LCMException
For the given registryObject return the current state

Parameters:
registryObject - for which the state is to be found
Returns:
state as a LCRegistryObjectState, null if no state defined
Throws:
LCMException - - if the LCM provider encounters an internal error

setLCState

java.util.Collection<LCStateChangeStatus> setLCState(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjects,
                                                     LCState targetState)
                                                     throws LCMException
Set the given registry objects to the given state

Parameters:
registryObject - of which the state is to be set
targetState - to which the registryObject is to be set
Returns:
LCStateChangeStatus with possible values LCStateChangeStatus.OK / LCStateChangeStatus.PENDING / LCStateChangeStatus.FAILED
Throws:
LCMException - - if the LCM provider encounters an internal error

setLCState

LCStateChangeStatus setLCState(javax.xml.registry.infomodel.RegistryObject registryObject,
                               LCState targetState)
                               throws LCMException
Set the given registry object to the given state

Parameters:
registryObject - of which the state is to be set
targetState - to which the registryObject is to be set
Returns:
LCStateChangeStatus with possible values LCStateChangeStatus.OK / LCStateChangeStatus.PENDING / LCStateChangeStatus.FAILED
Throws:
LCMException - - if the LCM provider encounters an internal error

setLCStateEx

void setLCStateEx(javax.xml.registry.infomodel.RegistryObject registryObject,
                  LCState targetState)
                  throws LCMException
Set the given registry object to the given state but the difference between setLCState(RegistryObject, LCState) and setLCStateEx(RegistryObject, LCState) is in case of setLCState(RegistryObject, LCState) the policies required to execute & state persisting is happen immediately but in case of setLCStateEx(RegistryObject, LCState) we attach listeners to registry object to perform Pre and Post operations and those listeners invoked by the LifeCycleManager so the state change is happen as part of saveObjects.

Parameters:
registryObject - of which the state is to be set
targetState - to which the registryObject is to be set
Throws:
LCMException - throw in case of failed to set the given state to RegistryObject.

approveStateChange

void approveStateChange(javax.xml.registry.infomodel.RegistryObject registryObject)
                        throws LCMException
Approves the state change

Parameters:
registryObject - registryObject for which the change state is triggered
Throws:
LCMException - - if the LCM provider encounters an internal error

rejectStateChange

void rejectStateChange(javax.xml.registry.infomodel.RegistryObject registryObject)
                       throws LCMException
Rejects the state change

Parameters:
registryObject - registryObject for which the change state is triggered
Throws:
LCMException - - if the LCM provider encounters an internal error

rejectStateChange

void rejectStateChange(javax.xml.registry.infomodel.RegistryObject registryObject,
                       LCState rejectState)
                       throws LCMException
Rejects the state change and set the state of the given registry object to the reject state provided there is a valid state transition from the state of the object prior to approval to the reject state. If there is no valid state transition from the state prior to approval to the reject state, the object stays in the state prior to approval.

Parameters:
registryObject - registryObject for which the change state is triggered
rejectState - state to which the registry object is to be set
Throws:
LCMException - - if the LCM provider encounters an internal error

isLCModel

boolean isLCModel(javax.xml.registry.infomodel.ClassificationScheme taxonomy)
                  throws LCMException
Checks if the given taxonomy represents an LCModel taxonomy

Returns:
true if the above condition met, false otherwise
Throws:
LCMException - - if the LCM provider encounters an internal error

findAllTypesApplicableForLCM

java.util.Collection<javax.xml.registry.infomodel.Concept> findAllTypesApplicableForLCM()
                                                                                        throws LCMException
Returns all types that can be life cycle enabled. The objects returned here meet the condition that Only object types that are classified as Assets can be LCM enabled, plus Policies (= PolicyInstances).

Returns:
collection of types
Throws:
LCMException - - if the LCM provider encounters an internal error

findAllLCMNodes

java.util.Collection<LCMNode> findAllLCMNodes()
                                              throws LCMException
Find all LCMNodes

Returns:
collection of LCMNodes
Throws:
LCMException - - if the LCM provider encounters an internal error

getLCMNode

LCMNode getLCMNode(java.lang.String nodeKey)
                   throws LCMException
Find the LCMNode with the given LCMNode key

Parameters:
nodeKey - the key of the LCMNode to be retrieved
Returns:
LCMNode with the given key
Throws:
LCMException - - if the LCM provider encounters an internal error

getNewVersion

LCModel getNewVersion(LCModel oldVersionModel)
                      throws LCMException
Return the new version of this model which supersedes it, if any.

Parameters:
oldVersionModel -
Returns:
LCModel which supersedes the given old model, null if there is none.
Throws:
LCMException

getApplicableLCModels

java.util.Map<javax.xml.registry.infomodel.Concept,LCModel> getApplicableLCModels(java.util.Collection<javax.xml.registry.infomodel.Concept> objectTypes,
                                                                                  javax.xml.registry.infomodel.Organization organization)
                                                                                  throws LCMException
Returns a map containing the object types which have a global or org-specific LC Model applicable to them. Please note that the map will not contain object types which do not have any LC Model applicable to them.

Parameters:
objectTypes - for which LC Models are to be found
organization - for which the model has to be found
Returns:
Map with key as the object type concept and value as the corresponding LC Model.
Throws:
LCMException

getApplicableLCModels

java.util.Map<javax.xml.registry.infomodel.Concept,LCModel> getApplicableLCModels(java.util.Collection<javax.xml.registry.infomodel.Concept> objectTypes,
                                                                                  javax.xml.registry.infomodel.Organization organization,
                                                                                  boolean includeNativeType)
                                                                                  throws LCMException
Parameters:
objectTypes - for which LC Models are to be found
organization - for which the model has to be found
includeNativeType - - Wherther the native type has to be considered or not
Returns:
Map with key as the object type concept and value as the corresponding LC Model.
Throws:
LCMException

getLcmRelatedExportObjects

java.util.Collection<javax.xml.registry.infomodel.RegistryObject> getLcmRelatedExportObjects(javax.xml.registry.infomodel.RegistryObject objectToExport)
                                                                                             throws LCMException
returns collection of registry objects for export which includes LC model classificationScheme, State Concepts, and their related stages returns an empty collection if the object sent is not a LC model classification scheme

Parameters:
objectToExport - the possible LC model object for which export related objects have to be return
Throws:
LCMException - - if the LCM provider encounters an internal error

getLCMNodeURLsForImport

java.util.Collection<java.lang.String> getLCMNodeURLsForImport(javax.xml.registry.infomodel.RegistryObject registryObject)
                                                               throws LCMException
returns the collection of configuration URLs of nodes(stages) (if any) into which the given registry object can be imported returns an empty collection if this registry object is not LCM enabled or no nodes are specified for the current state of the registry object This method needs to be called before exporting any IRO and if it returns a non empty collection, export operation should include these stages as part of the export archive

Parameters:
registryObject -
Returns:
collection of configuration URLs of nodes(stages)(if any) into which the given registry object can be imported
Throws:
LCMException

setInitialLCState

void setInitialLCState(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> registryObjects,
                       LCState initialState)
                       throws LCMException
Set the initial states of the each registry object in the collection to the given state

Parameters:
registryObjects -
initialState -
Throws:
LCMException