Package com.hybris.cockpitng.actions
Class ActionResult<O>
- java.lang.Object
-
- com.hybris.cockpitng.actions.ActionResult<O>
-
- Type Parameters:
O- output type of the action
public class ActionResult<O> extends java.lang.ObjectResult object of a cockpit action.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classActionResult.StatusFlag
-
Constructor Summary
Constructors Constructor Description ActionResult(java.lang.String resultCode)Constructor with a result code.ActionResult(java.lang.String resultCode, O data)Constructor with a result code and data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOutputSocketToSend(java.lang.String outputId, java.lang.Object outputData)Adds data to be sent to the output socket with the given ID after the action has performed.voidaddSocketAfterOperation(BackgroundOperationDefinition definition)Registers a background operation.OgetData()Returns the output data returned by the performed action.java.util.Map<java.lang.String,java.lang.Object>getOutputsToSend()Returns socket outputs and data to be sent after the action is has performed.java.lang.StringgetResultCode()Returns the result code of the action.java.lang.StringgetResultMessage()Returns the result message.java.util.List<BackgroundOperationDefinition>getSocketAfterOperation()Retuns all background operations.java.util.EnumSet<ActionResult.StatusFlag>getStatusFlags()voidsetData(O data)Sets the output data of the performed action.voidsetResultCode(java.lang.String resultCode)Sets the result code of the action.voidsetResultMessage(java.lang.String resultMessage)Sets the result message.voidsetStatusFlags(java.util.EnumSet<ActionResult.StatusFlag> statusFlags)
-
-
-
Field Detail
-
SUCCESS
public static final java.lang.String SUCCESS
Result code for success. Means that the action was performed successfully.- See Also:
- Constant Field Values
-
ERROR
public static final java.lang.String ERROR
Result code for error. Means that the action was not performed successfully because of an error.- See Also:
- Constant Field Values
-
-
Method Detail
-
getData
public O getData()
Returns the output data returned by the performed action.- Returns:
- output data returned by the performed action
-
setData
public void setData(O data)
Sets the output data of the performed action.- Parameters:
data- output data of the performed action
-
getResultCode
public java.lang.String getResultCode()
Returns the result code of the action.
-
setResultCode
public void setResultCode(java.lang.String resultCode)
Sets the result code of the action.
-
getResultMessage
public java.lang.String getResultMessage()
Returns the result message.- Returns:
- result message
-
setResultMessage
public void setResultMessage(java.lang.String resultMessage)
Sets the result message.- Parameters:
resultMessage- result message
-
getOutputsToSend
public java.util.Map<java.lang.String,java.lang.Object> getOutputsToSend()
Returns socket outputs and data to be sent after the action is has performed.- Returns:
- socket outputs and data to be sent after the action is has performed. Key of the map is the socket ID, value contains the data to be sent.
-
addOutputSocketToSend
public void addOutputSocketToSend(java.lang.String outputId, java.lang.Object outputData)Adds data to be sent to the output socket with the given ID after the action has performed.- Parameters:
outputId- output ID of the socket through which the data should be sent. It is a socket of the widget the action resides in.outputData- the data to be sent
-
addSocketAfterOperation
public void addSocketAfterOperation(BackgroundOperationDefinition definition)
Registers a background operation.- Parameters:
definition- background operation
-
getSocketAfterOperation
public java.util.List<BackgroundOperationDefinition> getSocketAfterOperation()
Retuns all background operations.- Returns:
- all background operations
-
getStatusFlags
public java.util.EnumSet<ActionResult.StatusFlag> getStatusFlags()
-
setStatusFlags
public void setStatusFlags(java.util.EnumSet<ActionResult.StatusFlag> statusFlags)
-
-