com.centrasite.lcmapi
Interface LCState

All Known Subinterfaces:
LCRegistryObjectState

public interface LCState

The LCState provides access to the LCState and state specific operations.


Method Summary
 void addNextStates(java.util.Collection<LCState> nextStates)
          Adds the given collection of states as next states to this LCState Please make sure that this LC state is added to a LC model before adding next states.
 void addPromotionNodes(java.util.Collection<LCMNode> promotionNodes)
          Adds the promotion node for this state.
 javax.xml.registry.infomodel.InternationalString getDescription()
          Returns the description of this LCState
 java.lang.String getName()
          Returns the name of this LCState
 java.util.Collection<LCState> getNextStates()
          Returns the next states of this LCState
 LCState getPreferredNexState()
          Returns the preferred next state to this LCState
 java.util.Collection<LCMNode> getPromotionNodes()
          Returns the promotion nodes
 java.util.Collection getRestrictedTo()
          Returns the collection of user / role / group's for which the transition to this state is restricted.
 javax.xml.registry.infomodel.Concept getStateConcept()
          Returns the underlying State Concept
 boolean isTransitionAllowed()
          Checks if the current logged in user has the sufficient permissions that match restriction criteriion of the state transition
 void removeNextState(LCState nextState)
          Removes the given state as next state to this LCState
 void removePromotionNodes(java.util.Collection<LCMNode> promotionNodes)
          remove the promotion node for this state.
 void restrictTo(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> restrictedFor)
          Allows restricting the state transitions to particular users / roles / groups Note that calling this method will overwrite any existing restrictions for the state
 void setDescription(javax.xml.registry.infomodel.InternationalString description)
          Sets the description for the LCState
 void setName(java.lang.String name)
          Sets the name for the LCState
 void setPreferredNextState(LCState state)
          Sets the preferred next state for this LCState The LCState passed here should be one of the states added as a next state to this LCState via addNextStates() call
 

Method Detail

getName

java.lang.String getName()
                         throws LCMException
Returns the name of this LCState

Returns:
name of the LCState as String
Throws:
LCMException - - if the LCM provider encounters an internal error

getDescription

javax.xml.registry.infomodel.InternationalString getDescription()
                                                                throws LCMException
Returns the description of this LCState

Returns:
description as InternationalString
Throws:
LCMException - - if the LCM provider encounters an internal error

getNextStates

java.util.Collection<LCState> getNextStates()
                                            throws LCMException
Returns the next states of this LCState

Returns:
the next states as a Collection, cannot be null
Throws:
LCMException - - if the LCM provider encounters an internal error

getPreferredNexState

LCState getPreferredNexState()
                             throws LCMException
Returns the preferred next state to this LCState

Returns:
preferred next state as LCState
Throws:
LCMException - - if the LCM provider encounters an internal error

getPromotionNodes

java.util.Collection<LCMNode> getPromotionNodes()
                                                throws LCMException
Returns the promotion nodes

Returns:
promotion nodes as collection of LCMNode objects
Throws:
LCMException - - if the LCM provider encounters an internal error

setName

void setName(java.lang.String name)
             throws LCMException
Sets the name for the LCState

Parameters:
name - as String
Throws:
LCMException - - if the LCM provider encounters an internal error

setDescription

void setDescription(javax.xml.registry.infomodel.InternationalString description)
                    throws LCMException
Sets the description for the LCState

Parameters:
description - to be set
Throws:
LCMException - - if the LCM provider encounters an internal error

addNextStates

void addNextStates(java.util.Collection<LCState> nextStates)
                   throws LCMException
Adds the given collection of states as next states to this LCState Please make sure that this LC state is added to a LC model before adding next states. This is needed to make sure that LC states of one LC model are not added as next states of another LC model

Parameters:
nextStates - collection of states to be added as next states
Throws:
LCMException - - if the LCM provider encounters an internal error

addPromotionNodes

void addPromotionNodes(java.util.Collection<LCMNode> promotionNodes)
                       throws LCMException
Adds the promotion node for this state. A promotion can be defined only on the end states of the LCModel

Parameters:
promotionNodes - the promotion nodes as collection of LCMNode objects
Throws:
LCMException - - if the LCM provider encounters an internal error

removePromotionNodes

void removePromotionNodes(java.util.Collection<LCMNode> promotionNodes)
                          throws LCMException
remove the promotion node for this state.

Parameters:
promotionNodes - the promotion nodes as collection of LCMNode objects
Throws:
LCMException - - if the LCM provider encounters an internal error

removeNextState

void removeNextState(LCState nextState)
                     throws LCMException
Removes the given state as next state to this LCState

Parameters:
nextState - nextState LCState object
Throws:
LCMException - - if the LCM provider encounters an internal error

setPreferredNextState

void setPreferredNextState(LCState state)
                           throws LCMException
Sets the preferred next state for this LCState The LCState passed here should be one of the states added as a next state to this LCState via addNextStates() call

Parameters:
state - the preferred next sate for this LCState
Throws:
LCMException - if the given state is not currently assigned as a next state

restrictTo

void restrictTo(java.util.Collection<javax.xml.registry.infomodel.RegistryObject> restrictedFor)
                throws LCMException
Allows restricting the state transitions to particular users / roles / groups Note that calling this method will overwrite any existing restrictions for the state

Parameters:
restrictedFor - - should be a collection of User objects or a RegistryEntries that are classified as group (OBJECT_TYPE_KEY_Group) or role (OBJECT_TYPE_KEY_ROLE)
Throws:
LCMException - - if the given registry object does not meet the above or if the LCM provider encounters an inernal error

getRestrictedTo

java.util.Collection getRestrictedTo()
                                     throws LCMException
Returns the collection of user / role / group's for which the transition to this state is restricted.

Returns:
the user / role / group as RegistryObjects as a collection, could return empty but not null
Throws:
LCMException - - If the LCM provider encounters an internal error

isTransitionAllowed

boolean isTransitionAllowed()
                            throws LCMException
Checks if the current logged in user has the sufficient permissions that match restriction criteriion of the state transition

Returns:
true if the transition is allowed, false otherwise
Throws:
LCMException - - if the LCM provider encounters an inernal error

getStateConcept

javax.xml.registry.infomodel.Concept getStateConcept()
                                                     throws LCMException
Returns the underlying State Concept

Returns:
State concept
Throws:
LCMException - - if the LCM provider encounters an inernal error