org.ocap.hn
Interface NetActionRequest


public interface NetActionRequest

All asynchronous actions in the Home networking API return an NetActionRequest. The NetActionRequest can be used a) to cancel any pending action or b) to identify which Action got completed.

See Also:
NetActionHandler, NetActionEvent

Method Summary
 boolean cancel()
          Cancels the Action associated with this ActionRequest.
 int getActionStatus()
          Gets the current status of the requested action.
 int getError()
          Gets the error value when getActionStatus returns NetActionEvent.ACTION_FAILED.
 float getProgress()
          Gets the progress of the action in percent (0.0 - 1.0).
 

Method Detail

cancel

boolean cancel()
Cancels the Action associated with this ActionRequest. Returns false if the action can't be canceled.

Returns:
false if action can't be cancelled, otherwise returns true.

getProgress

float getProgress()
Gets the progress of the action in percent (0.0 - 1.0). If the progress of an action can't be determined, -1.0 shall be returned.

Returns:
the progress of the action (0.0 - 1.0) or -1.0 if the progress can't be determined.

getActionStatus

int getActionStatus()
Gets the current status of the requested action.

Returns:
the current action status; see ACTION_* constants in NetActionEvent for possible return values.

getError

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.