com.softwareag.centrasite.appl.framework.lcm.impl
Class LCModelImpl

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.lcm.impl.LCModelImpl
All Implemented Interfaces:
LCModel

public class LCModelImpl
extends java.lang.Object
implements LCModel

This implementation offers CRUD (Create, Read, Update, Delete) functionality for LCState objects, and all the necessary operations for managing a LCmodel object


Constructor Summary
LCModelImpl(com.centrasite.lcmapi.LCModel genericModel, RegistryProvider registryProvider, BeanPool beanPool)
          Constructor for creating LCState objects
 
Method Summary
 boolean activable(LCModelState lcModelState)
          Checks whether this LC Model can be activated
 boolean addEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys)
          Enables the registry types for the given UDDI keys for LCM with this LCModel
 boolean addEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys, boolean enableAsLCMforLCM)
          Enables the registry types for the given UDDI keys for LCM with this LCModel and enables this LCModel as LCM for LCModels if the enableAsLCMforLCM is specified true.
 boolean addStates(java.util.Collection<LCState> states)
          Adds the given states to this LCModel
 LCState createLCState()
          Creates an LCState
 LCModel createVersion()
          Creates a new version of a given LCModel
 java.lang.String getDescription()
          Returns the description of this LCModel
 java.lang.String getDisplayName()
          Returns the displayName of this LCModel
 java.util.Collection<java.lang.String> getEnabledTypes()
          Returns the UDDI keys of the enabled types for LCM with this LCModel
 LCState getInitialState()
          Returns the initialState of this LCModel
 java.lang.String getKey()
          Return the LCModel Key
 LCAwareClassificationScheme getModelClassificationScheme()
          Return the ClassificationScheme
 Organization getOrganization()
          Returns the organization to which the LCModel belongs to
 java.util.Collection<LCState> getStates()
          Returns the states of the LCModel
 boolean isActive()
          Checks whether the model is Active.
 boolean isGlobal()
          Checks whether the model is global.
 boolean isInactive()
          Checks whether the model is Inactive.
 boolean isLCMForLCM()
          Checks whether the model is a LCM for LCM
 boolean isRetired()
          Checks whether the model is Retired.
 boolean isSuperseded()
          Checks whether the model is Superseded.
 boolean removeEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys)
          Removes types for the given UDDI keys for LCM with this LCModel.
 boolean removeEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys, boolean disableAsLCMforLCM)
          Removes the given types for LCM with this LCModel and disables this LCModel as LCM for LCModels if the disableAsLCMforLCM is specified true.
 boolean removeState(LCState state)
          Remove the given state from the LCModel
 void setDescription(java.lang.String description)
          Sets the description for the model
 void setDisplayName(java.lang.String displayName)
          Set the display name of the model
 void setInitialState(LCState state)
          Set the initial state for the LCModel.
 void setLCState(LCState targetState)
          Changes the life cycle state of the LCModel.
 void setModelState(LCModelState lcModelState)
          Deprecated.  
 void setOrganization(Organization organization, boolean global)
          Set the organization for this model
 void validate()
          Validates this LCModel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LCModelImpl

public LCModelImpl(com.centrasite.lcmapi.LCModel genericModel,
                   RegistryProvider registryProvider,
                   BeanPool beanPool)
            throws CSAppFrameworkException
Constructor for creating LCState objects

Parameters:
genericModel -
registryProvider -
beanPool -
Throws:
CSAppFrameworkException
javax.xml.registry.JAXRException
Method Detail

getDisplayName

public java.lang.String getDisplayName()
                                throws CSAppFrameworkException
Description copied from interface: LCModel
Returns the displayName of this LCModel

Specified by:
getDisplayName in interface LCModel
Returns:
displayName of the LCModel
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

getDescription

public java.lang.String getDescription()
                                throws CSAppFrameworkException
Description copied from interface: LCModel
Returns the description of this LCModel

Specified by:
getDescription in interface LCModel
Returns:
description as String
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

getEnabledTypes

public java.util.Collection<java.lang.String> getEnabledTypes()
                                                       throws CSAppFrameworkException
Description copied from interface: LCModel
Returns the UDDI keys of the enabled types for LCM with this LCModel

Specified by:
getEnabledTypes in interface LCModel
Returns:
collection of UDDI keys of enabled types, cannot be null
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

getInitialState

public LCState getInitialState()
                        throws CSAppFrameworkException
Description copied from interface: LCModel
Returns the initialState of this LCModel

Specified by:
getInitialState in interface LCModel
Returns:
initialState as LCState object
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

getOrganization

public Organization getOrganization()
                             throws CSAppFrameworkException
Description copied from interface: LCModel
Returns the organization to which the LCModel belongs to

Specified by:
getOrganization in interface LCModel
Returns:
organization the LCModel belongs to
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

getStates

public java.util.Collection<LCState> getStates()
                                        throws CSAppFrameworkException
Description copied from interface: LCModel
Returns the states of the LCModel

Specified by:
getStates in interface LCModel
Returns:
LCStates as a collection, cannot be null
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

setDisplayName

public void setDisplayName(java.lang.String displayName)
                    throws CSAppFrameworkException
Description copied from interface: LCModel
Set the display name of the model

Specified by:
setDisplayName in interface LCModel
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

setDescription

public void setDescription(java.lang.String description)
                    throws CSAppFrameworkException
Description copied from interface: LCModel
Sets the description for the model

Specified by:
setDescription in interface LCModel
Parameters:
description - to be set
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

setOrganization

public void setOrganization(Organization organization,
                            boolean global)
                     throws CSAppFrameworkException
Description copied from interface: LCModel
Set the organization for this model

Specified by:
setOrganization in interface LCModel
Parameters:
organization - for the model
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

addStates

public boolean addStates(java.util.Collection<LCState> states)
                  throws CSAppFrameworkException
Description copied from interface: LCModel
Adds the given states to this LCModel

Specified by:
addStates in interface LCModel
Parameters:
states - to be added to this LCModel
Returns:
true if all the given states are added, false otherwise
Throws:
CSAppFrameworkException

addEnabledTypes

public boolean addEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys)
                        throws CSAppFrameworkException
Description copied from interface: LCModel
Enables the registry types for the given UDDI keys for LCM with this LCModel

Specified by:
addEnabledTypes in interface LCModel
Parameters:
registryTypeKeys - of the types to be enabled for this LCModel
Returns:
true if all the given types are added, false otherwise
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

addEnabledTypes

public boolean addEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys,
                               boolean enableAsLCMforLCM)
                        throws CSAppFrameworkException
Description copied from interface: LCModel
Enables the registry types for the given UDDI keys for LCM with this LCModel and enables this LCModel as LCM for LCModels if the enableAsLCMforLCM is specified true.

Specified by:
addEnabledTypes in interface LCModel
Parameters:
registryTypeKeys - of the types to be enabled for this LCModel
enableAsLCMforLCM - to be enabled as LCM for LCModels
Returns:
true if all the given types are added, false otherwise
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

removeState

public boolean removeState(LCState state)
                    throws CSAppFrameworkException
Description copied from interface: LCModel
Remove the given state from the LCModel

Specified by:
removeState in interface LCModel
Parameters:
state - The LCState that has to be removed from this LCModel
Returns:
true if the given state is successfully removed, false otherwise
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

setInitialState

public void setInitialState(LCState state)
                     throws CSAppFrameworkException
Description copied from interface: LCModel
Set the initial state for the LCModel.

Specified by:
setInitialState in interface LCModel
Parameters:
state - to be set as the initial state for this model
Throws:
CSAppFrameworkException - if the given state is not a part of the model at the time of calling this method

setModelState

public void setModelState(LCModelState lcModelState)
                   throws CSAppFrameworkException
Deprecated. 

Sets the state of the model.

Specified by:
setModelState in interface LCModel
Parameters:
lcModelState - - LCModelState to be set
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

activable

public boolean activable(LCModelState lcModelState)
                  throws CSAppFrameworkException
Description copied from interface: LCModel
Checks whether this LC Model can be activated

Specified by:
activable in interface LCModel
Returns:
true if it can be activated else throws CSAppFrameworkException
Throws:
CSAppFrameworkException

removeEnabledTypes

public boolean removeEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys)
                           throws CSAppFrameworkException
Description copied from interface: LCModel
Removes types for the given UDDI keys for LCM with this LCModel. If all LCM-enabled types (including LCM for LCM, if applicable) are being removed from the model with the call to this method, then the model and its states will automatically be deleted thereby making the LCModel unusable.

Specified by:
removeEnabledTypes in interface LCModel
Parameters:
registryTypeKeys - collection of registry type keys that can be removed for LCM
Returns:
true if the LCModel is deleted as a result of the call, false otherwise
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

removeEnabledTypes

public boolean removeEnabledTypes(java.util.Collection<java.lang.String> registryTypeKeys,
                                  boolean disableAsLCMforLCM)
                           throws CSAppFrameworkException
Description copied from interface: LCModel
Removes the given types for LCM with this LCModel and disables this LCModel as LCM for LCModels if the disableAsLCMforLCM is specified true. If all LCM-enabled types (including LCM for LCM, if applicable) are being removed from the model with the call to this method, then the model and its states will automatically be deleted thereby making the LCModel unusable.

Specified by:
removeEnabledTypes in interface LCModel
Parameters:
registryTypeKeys - collection of registry type keys of Types that can be removed for LCM
disableAsLCMforLCM - to be disabled as LCM for LCModels
Returns:
true if the LCModel is deleted as a result of the call, false otherwise
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

isGlobal

public boolean isGlobal()
                 throws CSAppFrameworkException
Description copied from interface: LCModel
Checks whether the model is global. There are two levels of LCModels. A global model attached to the default organization and a local model is the one associated with any other organization

Specified by:
isGlobal in interface LCModel
Returns:
true if the above condition is met, false otherwise
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

isLCMForLCM

public boolean isLCMForLCM()
                    throws CSAppFrameworkException
Description copied from interface: LCModel
Checks whether the model is a LCM for LCM

Specified by:
isLCMForLCM in interface LCModel
Returns:
true if the above condition met, false otherwise
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

validate

public void validate()
              throws CSAppFrameworkException
Description copied from interface: LCModel
Validates this LCModel

Specified by:
validate in interface LCModel
Throws:
CSAppFrameworkException - - if the validation fails or if the LCM provider encounters an internal error

createLCState

public LCState createLCState()
                      throws CSAppFrameworkException
Description copied from interface: LCModel
Creates an LCState

Specified by:
createLCState in interface LCModel
Returns:
the new LCState object
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

createVersion

public LCModel createVersion()
                      throws CSAppFrameworkException
Description copied from interface: LCModel
Creates a new version of a given LCModel

Specified by:
createVersion in interface LCModel
Returns:
the new version of the lcModel
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

isActive

public boolean isActive()
Description copied from interface: LCModel
Checks whether the model is Active.

Specified by:
isActive in interface LCModel
Returns:
true if the model is Active, false otherwise

isInactive

public boolean isInactive()
Description copied from interface: LCModel
Checks whether the model is Inactive.

Specified by:
isInactive in interface LCModel
Returns:
true if the model is Inactive, false otherwise

isRetired

public boolean isRetired()
Description copied from interface: LCModel
Checks whether the model is Retired.

Specified by:
isRetired in interface LCModel
Returns:
true if the model is Retired, false otherwise

isSuperseded

public boolean isSuperseded()
Description copied from interface: LCModel
Checks whether the model is Superseded.

Specified by:
isSuperseded in interface LCModel
Returns:
true if the model is Superseded, false otherwise

getKey

public java.lang.String getKey()
                        throws CSAppFrameworkException
Description copied from interface: LCModel
Return the LCModel Key

Specified by:
getKey in interface LCModel
Returns:
LCModel's key
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

getModelClassificationScheme

public LCAwareClassificationScheme getModelClassificationScheme()
                                                         throws CSAppFrameworkException
Description copied from interface: LCModel
Return the ClassificationScheme

Specified by:
getModelClassificationScheme in interface LCModel
Returns:
LCModel's ClassificationScheme
Throws:
CSAppFrameworkException - - if the LCM provider encounters an internal error

setLCState

public void setLCState(LCState targetState)
                throws CSAppFrameworkException
Description copied from interface: LCModel
Changes the life cycle state of the LCModel. The default states are new, productive and retired.

Specified by:
setLCState in interface LCModel
Throws:
CSAppFrameworkException