org.ocap.hn
Class NetActionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.ocap.hn.NetActionEvent
All Implemented Interfaces:
Serializable

public class NetActionEvent
extends EventObject

This class represents an event generated in response to an action. NetActionEvent instances can only be created by the implementation.

See Also:
Serialized Form

Field Summary
static int ACTION_CANCELED
          ACTION_CANCELED is returned by getActionStatus() when the action has been canceled.
static int ACTION_COMPLETED
          Action status for a completed action
static int ACTION_FAILED
          ACTION_FAILED is returned by getActionStatus() when the action has failed.
static int ACTION_NEEDS_MORE_TIME
          ACTION_NEEDS_MORE_TIME is returned by getActionStatus() when the action needs more time to complete.
static int ACTION_STATUS_NOT_AVAILABLE
          ACTION_STATUS_NOT_AVAILABLE is returned by getActionStatus() when the transaction has completed successfully or failed sometime before this method was called and the implementation is no longer maintaining a status for it.
static int ERROR_COMMUNICATIONS
          Error code returned when a general communications error occurs.
static int ERROR_INVALID_CRITERIA
          Error code returned when the criteria for an action is not understood or otherwise supported by the target.
static int ERROR_INVALID_PARAMETER
          Error code returned when an action was created with invalid parameters.
static int ERROR_TIMED_OUT
          Error code returned when the operation timed out.
static int ERROR_UNAUTHORIZED
          Error code returned when the requested action couldn't be executed because of missing permissions.
 
Method Summary
 NetActionRequest getActionRequest()
          Returns the ActionRequest which identifies the action instance.
 int getActionStatus()
          Returns the status of the requested action.
 int getError()
          Gets the error value when getActionStatus returns NetActionEvent.ACTION_FAILED.
 Object getResponse()
          Returns the response of the Action.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_TIMED_OUT

public static final int ERROR_TIMED_OUT
Error code returned when the operation timed out.

See Also:
Constant Field Values

ERROR_INVALID_PARAMETER

public static final int ERROR_INVALID_PARAMETER
Error code returned when an action was created with invalid parameters.

See Also:
Constant Field Values

ERROR_UNAUTHORIZED

public static final int ERROR_UNAUTHORIZED
Error code returned when the requested action couldn't be executed because of missing permissions.

See Also:
Constant Field Values

ERROR_COMMUNICATIONS

public static final int ERROR_COMMUNICATIONS
Error code returned when a general communications error occurs.

See Also:
Constant Field Values

ERROR_INVALID_CRITERIA

public static final int ERROR_INVALID_CRITERIA
Error code returned when the criteria for an action is not understood or otherwise supported by the target.

See Also:
Constant Field Values

ACTION_COMPLETED

public static final int ACTION_COMPLETED
Action status for a completed action

See Also:
getActionStatus(), Constant Field Values

ACTION_CANCELED

public static final int ACTION_CANCELED
ACTION_CANCELED is returned by getActionStatus() when the action has been canceled.

See Also:
getActionStatus(), Constant Field Values

ACTION_FAILED

public static final int ACTION_FAILED
ACTION_FAILED is returned by getActionStatus() when the action has failed.

See Also:
getActionStatus(), Constant Field Values

ACTION_NEEDS_MORE_TIME

public static final int ACTION_NEEDS_MORE_TIME
ACTION_NEEDS_MORE_TIME is returned by getActionStatus() when the action needs more time to complete. This event MAY be sent after an implementation specific number of seconds to indicate that the action is still executed but might need more time. It is up to the application to cancel the action or wait.

See Also:
getActionStatus(), Constant Field Values

ACTION_STATUS_NOT_AVAILABLE

public static final int ACTION_STATUS_NOT_AVAILABLE
ACTION_STATUS_NOT_AVAILABLE is returned by getActionStatus() when the transaction has completed successfully or failed sometime before this method was called and the implementation is no longer maintaining a status for it.

See Also:
Constant Field Values
Method Detail

getResponse

public Object getResponse()
Returns the response of the Action. Object is dependent on the Action.

Returns:
The response to an asynchronous action.

getActionRequest

public NetActionRequest getActionRequest()
Returns the ActionRequest which identifies the action instance.

Returns:
the ActionRequest

getActionStatus

public int getActionStatus()
Returns the status of the requested action.

Returns:
the status of the action; for possible return values see ACTION_* constants in this class.

getError

public int getError()
Gets the error value when getActionStatus returns NetActionEvent.ACTION_FAILED. If the action is not in error this method SHALL return -1.

Returns:
The error value; -1 if no error, otherwise see ERROR_* constants in NetActionEvent for possible return values.