org.opends.server.core
Class WorkflowResultCode

java.lang.Object
  extended by org.opends.server.core.WorkflowResultCode

public class WorkflowResultCode
extends java.lang.Object

This class implements the workflow result code. The workflow result code contains an LDAP result code along with an LDAP error message.


Constructor Summary
WorkflowResultCode()
          Creates a new instance of a workflow result.
WorkflowResultCode(ResultCode resultCode, MessageBuilder errorMessage)
          Creates a new instance of a workflow result code and initializes it with a result code and an error message.
 
Method Summary
 boolean elaborateGlobalResultCode(ResultCode newResultCode, MessageBuilder newErrorMessage)
          Elaborates a global result code.
 MessageBuilder errorMessage()
          Returns the global error message.
 ResultCode resultCode()
          Returns the global result code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowResultCode

public WorkflowResultCode()
Creates a new instance of a workflow result. By default the result code is set to UNDEFINED and there is no error message.


WorkflowResultCode

public WorkflowResultCode(ResultCode resultCode,
                          MessageBuilder errorMessage)
Creates a new instance of a workflow result code and initializes it with a result code and an error message.

Parameters:
resultCode - the initial value for the result code
errorMessage - the initial value for the error message
Method Detail

elaborateGlobalResultCode

public boolean elaborateGlobalResultCode(ResultCode newResultCode,
                                         MessageBuilder newErrorMessage)
Elaborates a global result code. A workflow may execute an operation on several subordinate workflows. In such case, the parent workflow has to take into account all the subordinate result codes to elaborate a global result code. Sometimes, a referral result code has to be turned into a reference entry. When such case is occurring the elaborateGlobalResultCode method will return true. The global result code is elaborated as follows:
  -----------+------------+------------+-------------------------------
  new        | current    | resulting  |
  resultCode | resultCode | resultCode | action
  -----------+------------+------------+-------------------------------
  SUCCESS      NO_SUCH_OBJ  SUCCESS      -
               REFERRAL     SUCCESS      send reference entry to client
               other        [unchanged]  -
  ---------------------------------------------------------------------
  NO_SUCH_OBJ  SUCCESS      [unchanged]  -
               REFERRAL     [unchanged]  -
               other        [unchanged]  -
  ---------------------------------------------------------------------
  REFERRAL     SUCCESS      [unchanged]  send reference entry to client
               REFERRAL     SUCCESS      send reference entry to client
               NO_SUCH_OBJ  REFERRAL     -
               other        [unchanged]  send reference entry to client
  ---------------------------------------------------------------------
  others       SUCCESS      other        -
               REFERRAL     other        send reference entry to client
               NO_SUCH_OBJ  other        -
               other2       [unchanged]  -
  ---------------------------------------------------------------------
 

Parameters:
newResultCode - the new result code to take into account
newErrorMessage - the new error message associated to the new error code
Returns:
true if a referral result code must be turned into a reference entry

resultCode

public ResultCode resultCode()
Returns the global result code.

Returns:
the global result code.

errorMessage

public MessageBuilder errorMessage()
Returns the global error message.

Returns:
the global error message.