wt.epm.util
Class EPMOverridableActions.EPMOverridableActionImpl

java.lang.Object
  extended bywt.epm.util.EPMOverridableActions.EPMOverridableActionImpl
All Implemented Interfaces:
EPMOverridableAction, Serializable
Enclosing class:
EPMOverridableActions

public static class EPMOverridableActions.EPMOverridableActionImpl
extends Object
implements EPMOverridableAction, Serializable

See Also:
Serialized Form

Nested Class Summary
(package private)  class EPMOverridableActions.EPMOverridableActionImpl.MsgResolutionsPair
          Helper class which just holds a message/resolutions pair
 
Field Summary
private  ConflictType conflict
           
private  WTMessage m_defaultMessage
           
private  ResolutionType[] m_defaultResolutions
           
private  WTKeyedHashMap mapElements
           
 
Constructor Summary
EPMOverridableActions.EPMOverridableActionImpl(ConflictType conflict)
           
EPMOverridableActions.EPMOverridableActionImpl(ConflictType conflict, ResolutionType resolution)
           
EPMOverridableActions.EPMOverridableActionImpl(ConflictType conflict, ResolutionType resolution, WTMessage message)
           
 
Method Summary
 void addElement(Persistable anElement)
          addElement
 void addElement(Persistable anElement, ResolutionType[] resolutions, WTMessage aMsg)
           
 void addElement(Persistable anElement, WTMessage aMsg)
           
 void addElements(WTCollection elements, ResolutionType[] resolutions, WTMessage aMsg)
           
 EPMConflictType getConflict()
          Gets the value of the attribute: conflict.
 WTMessage getMessage()
          Gets the value of the attribute: message.
 EPMResolutionType getResolution()
          Gets the value of the attribute: resolution.
 boolean hasConflicts()
          Checks wether the conflict is empty or not.
 boolean isActionAllowed(Object target)
          Returns true if action valid for specified target.
 WTCollection isActionAllowed(WTCollection targets)
          Checks if action is valid for specified targets.
 void overrideAction()
          Overrides the action by using the #resolution for specified targets.
 void overrideAction(WTCollection targets)
          Overrides the action by using the #resolution for specified targets.
 void overrideAction(WTCollection targets, ResolutionType resolution)
           
 void removeAllElements()
          Clears all the conflict elements except the default one
 boolean removeElement(Persistable anElement)
           
 String toString()
           
 void validateAction()
          Validates the action for specified targets.
 void validateAction(WTCollection targets)
          Validates the action for specified targets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_defaultResolutions

private ResolutionType[] m_defaultResolutions

m_defaultMessage

private WTMessage m_defaultMessage

conflict

private ConflictType conflict

mapElements

private WTKeyedHashMap mapElements
Constructor Detail

EPMOverridableActions.EPMOverridableActionImpl

public EPMOverridableActions.EPMOverridableActionImpl(ConflictType conflict,
                                                      ResolutionType resolution,
                                                      WTMessage message)

EPMOverridableActions.EPMOverridableActionImpl

public EPMOverridableActions.EPMOverridableActionImpl(ConflictType conflict,
                                                      ResolutionType resolution)

EPMOverridableActions.EPMOverridableActionImpl

public EPMOverridableActions.EPMOverridableActionImpl(ConflictType conflict)
Method Detail

getConflict

public EPMConflictType getConflict()
Gets the value of the attribute: conflict.

Supported API: false

Specified by:
getConflict in interface EPMOverridableAction
Returns:
EPMConflictType

getResolution

public EPMResolutionType getResolution()
Gets the value of the attribute: resolution.

Supported API: false UNSUPPORTED anymore

Specified by:
getResolution in interface EPMOverridableAction
Returns:
EPMResolutionType

getMessage

public WTMessage getMessage()
Gets the value of the attribute: message.

Supported API: false UNSUPPORTED anymore

Specified by:
getMessage in interface EPMOverridableAction
Returns:
WTMessage

validateAction

public void validateAction(WTCollection targets)
                    throws ConflictException,
                           WTException
Validates the action for specified targets. If action is not valid, it throws ConflictException of type #conflict. This ConflictException can be overridden by using #resolution. NOTE: For the conflict exception it uses a message passed to the constructor and ignores all elements added using addElement method.

Supported API: false

Specified by:
validateAction in interface EPMOverridableAction
Parameters:
targets -
Throws:
ConflictException
WTException

validateAction

public void validateAction()
                    throws ConflictException,
                           WTException
Validates the action for specified targets. If action is not valid, it throws ConflictException of type #conflict. This ConflictException can be overridden by using #resolution. NOTE: For the every conflict exception it uses a message passed to the addElement method and ignores the message passed to the constructor.

Supported API: false

Throws:
ConflictException
WTException

isActionAllowed

public boolean isActionAllowed(Object target)
                        throws WTException
Returns true if action valid for specified target.

Supported API: false

Specified by:
isActionAllowed in interface EPMOverridableAction
Parameters:
target -
Returns:
boolean
Throws:
WTException

removeElement

public boolean removeElement(Persistable anElement)

removeAllElements

public void removeAllElements()
Clears all the conflict elements except the default one


addElement

public void addElement(Persistable anElement)
addElement


addElement

public void addElement(Persistable anElement,
                       WTMessage aMsg)

addElement

public void addElement(Persistable anElement,
                       ResolutionType[] resolutions,
                       WTMessage aMsg)

addElements

public void addElements(WTCollection elements,
                        ResolutionType[] resolutions,
                        WTMessage aMsg)
                 throws WTException
Throws:
WTException

hasConflicts

public boolean hasConflicts()
Checks wether the conflict is empty or not.

Returns:
true if conflict is not empty

overrideAction

public void overrideAction()
                    throws WTException
Overrides the action by using the #resolution for specified targets.

Supported API: false

Throws:
WTException

overrideAction

public void overrideAction(WTCollection targets,
                           ResolutionType resolution)
                    throws WTException
Throws:
WTException

overrideAction

public void overrideAction(WTCollection targets)
                    throws WTException
Description copied from interface: EPMOverridableAction
Overrides the action by using the #resolution for specified targets.

Supported API: false

Specified by:
overrideAction in interface EPMOverridableAction
Parameters:
targets -
Throws:
WTException

isActionAllowed

public WTCollection isActionAllowed(WTCollection targets)
                             throws WTException
Checks if action is valid for specified targets. Returns targets for which action is not valid.

Supported API: false

Specified by:
isActionAllowed in interface EPMOverridableAction
Parameters:
targets -
Returns:
WTCollection
Throws:
WTException

toString

public String toString()