org.alfresco.repo.action
Class ActionImpl

java.lang.Object
  extended by org.alfresco.repo.action.ParameterizedItemImpl
      extended by org.alfresco.repo.action.ActionImpl
All Implemented Interfaces:
java.io.Serializable, Action, ParameterizedItem
Direct Known Subclasses:
ActionServiceImplTest.CancellableSleepAction, CompositeActionImpl, RenditionDefinitionImpl, ReplicationDefinitionImpl, ScheduledPersistedActionServiceTest.TestAction

public class ActionImpl
extends ParameterizedItemImpl
implements Action

Action implementation

See Also:
Serialized Form

Constructor Summary
ActionImpl(Action action)
           
ActionImpl(Action action, java.lang.String actionDefinitionName)
           
ActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String id, java.lang.String actionDefinitionName)
          Constructor
ActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String id, java.lang.String actionDefinitionName, java.util.Map parameterValues)
          Constructor
 
Method Summary
 void addActionCondition(ActionCondition actionCondition)
          Add an action condition to the action
 void addActionCondition(int index, ActionCondition actionCondition)
          Add an action condition at the given index
 void addParameterValues(java.util.Map values)
          Adds a Map of parameter values to the Action
 java.util.Set getActionChain()
          Get the action chain
 ActionCondition getActionCondition(int index)
          Get the action condition at a given index
 java.util.List getActionConditions()
          Gets a list of the action conditions for this action
 java.lang.String getActionDefinitionName()
          Get the name of the action definition that relates to this action
 Action getCompensatingAction()
          Get the compensating action.
 java.util.Date getCreatedDate()
          Get the date the action was created
 java.lang.String getCreator()
          Get the name of the user that created the action
 java.lang.String getDescription()
          Get the description of the action
 boolean getExecuteAsychronously()
          Gets a value indicating whether the action should be executed asychronously or not.
 java.util.Date getExecutionEndDate()
          Gets the date that the action (last) finished execution at.
 java.lang.String getExecutionFailureMessage()
          Gets the message of the exception which caused the Action execution failure, or null if the Action hasn't failed / has been retried.
 int getExecutionInstance()
          When there is more than one instance of the action executing, both with the same ID, which one is this? This crops up most often with persisted actions, with two copies running, one on each of two different target nodes.
 java.util.Date getExecutionStartDate()
          Gets the date that the action (last) began executing at.
 ActionStatus getExecutionStatus()
          Gets the current execution status of the action, such as Running or Completed.
 java.util.Date getModifiedDate()
          Get the date that the action was last modified
 java.lang.String getModifier()
          Get the name of the user that last modified the action
 org.alfresco.service.cmr.repository.NodeRef getNodeRef()
          Gets the node ref that represents the saved action node.
 java.lang.String getRunAsUser()
           
 java.lang.String getTitle()
          Get the title of the action
 java.lang.Boolean getTrackStatus()
           
 boolean hasActionConditions()
          Indicates whether the action has any conditions specified
 int indexOfActionCondition(ActionCondition actionCondition)
          Gets the index of an action condition
 void removeActionCondition(ActionCondition actionCondition)
          Removes an action condition
 void removeAllActionConditions()
          Removes all action conditions
 void setActionChain(java.util.Set actionChain)
          Set the action chain
 void setActionCondition(int index, ActionCondition actionCondition)
          Replaces the current action condition at the given index with the action condition provided.
 void setCompensatingAction(Action action)
          Set the compensating action.
 void setCreatedDate(java.util.Date createdDate)
          Set the created date
 void setCreator(java.lang.String creator)
          Set the creator
 void setDescription(java.lang.String description)
          Set the description of the action
 void setExecuteAsynchronously(boolean executeAsynchronously)
          Set the value that indicates whether the action should be executed asychronously or not.
 void setExecutionEndDate(java.util.Date endDate)
          Records the date when the action finished execution, normally called by the ActionService when the action completes or fails.
 void setExecutionFailureMessage(java.lang.String message)
          Records the message of the exception which caused the Action to fail, if any.
 void setExecutionInstance(int instance)
          Called by the ActionService when the action begins running.
 void setExecutionStartDate(java.util.Date startDate)
          Records the date when the action began execution, normally called by the ActionService when it starts running the action.
 void setExecutionStatus(ActionStatus status)
          Updates the current execution status.
 void setModifiedDate(java.util.Date modifiedDate)
          Set the modified date
 void setModifier(java.lang.String modifier)
          Set the modifier
 void setNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Set the node reference
 void setRunAsUser(java.lang.String runAsUserName)
           
 void setTitle(java.lang.String title)
          Set the title of the action
 void setTrackStatus(java.lang.Boolean trackStatus)
          Set whether the action should be tracked or not.
 java.lang.String toString()
           
 
Methods inherited from class org.alfresco.repo.action.ParameterizedItemImpl
equals, getId, getParameterValue, getParameterValues, hashCode, setParameterValue, setParameterValues
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.alfresco.service.cmr.action.ParameterizedItem
getId, getParameterValue, getParameterValues, setParameterValue, setParameterValues
 

Constructor Detail

ActionImpl

public ActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                  java.lang.String id,
                  java.lang.String actionDefinitionName)
Constructor

Parameters:
nodeRef - the action node reference (null if not saved)
id - the action id
actionDefinitionName - the name of the action definition

ActionImpl

public ActionImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                  java.lang.String id,
                  java.lang.String actionDefinitionName,
                  java.util.Map parameterValues)
Constructor

Parameters:
nodeRef - the action node reference (null if not saved)
id - the action id
actionDefinitionName - the action definition name
parameterValues - the parameter values

ActionImpl

public ActionImpl(Action action,
                  java.lang.String actionDefinitionName)

ActionImpl

public ActionImpl(Action action)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTitle

public java.lang.String getTitle()
Description copied from interface: Action
Get the title of the action

Specified by:
getTitle in interface Action
Returns:
the title of the action

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: Action
Set the title of the action

Specified by:
setTitle in interface Action
Parameters:
title - the title of the action

getDescription

public java.lang.String getDescription()
Description copied from interface: Action
Get the description of the action

Specified by:
getDescription in interface Action
Returns:
the description of the action

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: Action
Set the description of the action

Specified by:
setDescription in interface Action
Parameters:
description - the description of the action

getTrackStatus

public java.lang.Boolean getTrackStatus()
Specified by:
getTrackStatus in interface Action
Returns:
true if the action must be tracked by the ActionTrackingService, false if it must NOT be tracked or null to use the action definition's default.

setTrackStatus

public void setTrackStatus(java.lang.Boolean trackStatus)
Description copied from interface: Action
Set whether the action should be tracked or not.

The option of tracking can be null i.e. unset, indicating that the defaults of the action definition should be used. This is to allow manual overriding of the property when it becomes supported by the UI.

Specified by:
setTrackStatus in interface Action
Parameters:
trackStatus - true if the action must be tracked by the ActionTrackingService, false if it must NOT be tracked or null to use the action definition's default.

getExecuteAsychronously

public boolean getExecuteAsychronously()
Description copied from interface: Action
Gets a value indicating whether the action should be executed asychronously or not.

The default is to execute the action synchronously.

Specified by:
getExecuteAsychronously in interface Action
Returns:
true if the action is executed asychronously, false otherwise.

setExecuteAsynchronously

public void setExecuteAsynchronously(boolean executeAsynchronously)
Description copied from interface: Action
Set the value that indicates whether the action should be executed asychronously or not.

Specified by:
setExecuteAsynchronously in interface Action
Parameters:
executeAsynchronously - true if the action is to be executed asychronously, false otherwise.

getCompensatingAction

public Action getCompensatingAction()
Description copied from interface: Action
Get the compensating action.

This action is executed if the failure behaviour is to compensate and the action being executed fails.

Specified by:
getCompensatingAction in interface Action
Returns:
the compensating action

setCompensatingAction

public void setCompensatingAction(Action action)
Description copied from interface: Action
Set the compensating action.

Specified by:
setCompensatingAction in interface Action
Parameters:
action - the compensating action

getCreatedDate

public java.util.Date getCreatedDate()
Description copied from interface: Action
Get the date the action was created

Specified by:
getCreatedDate in interface Action
Returns:
action creation date

setCreatedDate

public void setCreatedDate(java.util.Date createdDate)
Set the created date

Parameters:
createdDate - the created date

getCreator

public java.lang.String getCreator()
Description copied from interface: Action
Get the name of the user that created the action

Specified by:
getCreator in interface Action
Returns:
user name

setCreator

public void setCreator(java.lang.String creator)
Set the creator


getModifiedDate

public java.util.Date getModifiedDate()
Description copied from interface: Action
Get the date that the action was last modified

Specified by:
getModifiedDate in interface Action
Returns:
aciton modification date

setModifiedDate

public void setModifiedDate(java.util.Date modifiedDate)
Set the modified date


getModifier

public java.lang.String getModifier()
Description copied from interface: Action
Get the name of the user that last modified the action

Specified by:
getModifier in interface Action
Returns:
user name

setModifier

public void setModifier(java.lang.String modifier)
Set the modifier


getActionDefinitionName

public java.lang.String getActionDefinitionName()
Description copied from interface: Action
Get the name of the action definition that relates to this action

Specified by:
getActionDefinitionName in interface Action
Returns:
the action defintion name

hasActionConditions

public boolean hasActionConditions()
Description copied from interface: Action
Indicates whether the action has any conditions specified

Specified by:
hasActionConditions in interface Action
Returns:
true if the action has any conditions specified, flase otherwise

indexOfActionCondition

public int indexOfActionCondition(ActionCondition actionCondition)
Description copied from interface: Action
Gets the index of an action condition

Specified by:
indexOfActionCondition in interface Action
Parameters:
actionCondition - the action condition
Returns:
the index

getActionConditions

public java.util.List getActionConditions()
Description copied from interface: Action
Gets a list of the action conditions for this action

Specified by:
getActionConditions in interface Action
Returns:
list of action conditions

getActionCondition

public ActionCondition getActionCondition(int index)
Description copied from interface: Action
Get the action condition at a given index

Specified by:
getActionCondition in interface Action
Parameters:
index - the index
Returns:
the action condition

addActionCondition

public void addActionCondition(ActionCondition actionCondition)
Description copied from interface: Action
Add an action condition to the action

Specified by:
addActionCondition in interface Action
Parameters:
actionCondition - an action condition

addActionCondition

public void addActionCondition(int index,
                               ActionCondition actionCondition)
Description copied from interface: Action
Add an action condition at the given index

Specified by:
addActionCondition in interface Action
Parameters:
index - the index
actionCondition - the action condition

setActionCondition

public void setActionCondition(int index,
                               ActionCondition actionCondition)
Description copied from interface: Action
Replaces the current action condition at the given index with the action condition provided.

Specified by:
setActionCondition in interface Action
Parameters:
index - the index
actionCondition - the action condition

removeActionCondition

public void removeActionCondition(ActionCondition actionCondition)
Description copied from interface: Action
Removes an action condition

Specified by:
removeActionCondition in interface Action
Parameters:
actionCondition - an action condition

removeAllActionConditions

public void removeAllActionConditions()
Description copied from interface: Action
Removes all action conditions

Specified by:
removeAllActionConditions in interface Action

setActionChain

public void setActionChain(java.util.Set actionChain)
Set the action chain

Parameters:
actionChain - the list of actions that lead to this action

getActionChain

public java.util.Set getActionChain()
Get the action chain

Returns:
the list of actions that lead to this action

getRunAsUser

public java.lang.String getRunAsUser()

setRunAsUser

public void setRunAsUser(java.lang.String runAsUserName)

getNodeRef

public org.alfresco.service.cmr.repository.NodeRef getNodeRef()
Description copied from interface: Action
Gets the node ref that represents the saved action node. Returns null id unsaved.

Specified by:
getNodeRef in interface Action
Returns:
the action node reference

setNodeRef

public void setNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Set the node reference

Parameters:
nodeRef - the node reference

addParameterValues

public void addParameterValues(java.util.Map values)
Description copied from interface: Action
Adds a Map of parameter values to the Action

Specified by:
addParameterValues in interface Action
Parameters:
values - A map of values to be added

getExecutionInstance

public int getExecutionInstance()
When there is more than one instance of the action executing, both with the same ID, which one is this? This crops up most often with persisted actions, with two copies running, one on each of two different target nodes.


setExecutionInstance

public void setExecutionInstance(int instance)
Called by the ActionService when the action begins running.


getExecutionStartDate

public java.util.Date getExecutionStartDate()
Description copied from interface: Action
Gets the date that the action (last) began executing at. Null if the action has not yet been run. For a saved action, this will be the last time at ran.

Specified by:
getExecutionStartDate in interface Action
Returns:
The date the action (last) began executing at, or null.

setExecutionStartDate

public void setExecutionStartDate(java.util.Date startDate)
Records the date when the action began execution, normally called by the ActionService when it starts running the action.


getExecutionEndDate

public java.util.Date getExecutionEndDate()
Description copied from interface: Action
Gets the date that the action (last) finished execution at. Null if the action has not yet been run, or is currently running. For a saved action, this will normally be the last time it finished running.

Specified by:
getExecutionEndDate in interface Action
Returns:
The date the action last finished exeucting at, or null.

setExecutionEndDate

public void setExecutionEndDate(java.util.Date endDate)
Records the date when the action finished execution, normally called by the ActionService when the action completes or fails.


getExecutionStatus

public ActionStatus getExecutionStatus()
Description copied from interface: Action
Gets the current execution status of the action, such as Running or Completed.

Specified by:
getExecutionStatus in interface Action
Returns:
The current execution status

setExecutionStatus

public void setExecutionStatus(ActionStatus status)
Updates the current execution status. This is normally called by the ActionService as it progresses the Action's execution.


getExecutionFailureMessage

public java.lang.String getExecutionFailureMessage()
Description copied from interface: Action
Gets the message of the exception which caused the Action execution failure, or null if the Action hasn't failed / has been retried.

Specified by:
getExecutionFailureMessage in interface Action
Returns:
The exception message, if the action has failed

setExecutionFailureMessage

public void setExecutionFailureMessage(java.lang.String message)
Records the message of the exception which caused the Action to fail, if any.



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.