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_IN_PROGRESS
          ACTION_IN_PROGRESS is returned by getActionStatus() when the action is currently on going.
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.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected NetActionEvent(Object request, Object response, int error, int status)
          Two argument constructor.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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_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

ACTION_IN_PROGRESS

public static final int ACTION_IN_PROGRESS
ACTION_IN_PROGRESS is returned by getActionStatus() when the action is currently on going.

See Also:
getActionStatus(), Constant Field Values
Constructor Detail

NetActionEvent

protected NetActionEvent(Object request,
                         Object response,
                         int error,
                         int status)
Two argument constructor.

Parameters:
request - - NetActionRequest that instigated the response.
response - - An object representing the response to the action and which is specific to the action.
error - - error code for this event if action failed
status - - status of the associated net action
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. Error code values are dependent on the underlying network protocol error code values.

Returns:
The error value; -1 if no error.


Copyright © 2011. All Rights Reserved.