public abstract class AbstractOperationDelegate extends java.lang.Object implements IOperationDelegate
IOperationDelegate
. It handles
the onOperationFailed(IOperation)
and
onOperationFinished(IOperation)
and offers
onOperationSuccessful(IOperation)
to easy the handling the operation
result.Constructor and Description |
---|
AbstractOperationDelegate() |
Modifier and Type | Method and Description |
---|---|
void |
onOperationFailed(IOperation operation)
Notifies this listener that the watched
IOperation failed. |
void |
onOperationFinished(IOperation operation)
Notifies this listener that the watched
IOperation finished. |
abstract void |
onOperationSuccessful(IOperation operation)
Is called when the operation executed successfully (i.e.
|
public void onOperationFinished(IOperation operation)
IOperationDelegate
IOperation
finished. IOperation#getResultCode()
to validate the success of the
operation. E.g. for a remote operation:
switch (operation.getResponse().getStatusCode()) { caseHttpConnection.HTTP_OK
: break; caseHttpConnection.HTTP_FORBIDDEN
: break; }
onOperationFinished
in interface IOperationDelegate
operation
- The watched IOperation
.public void onOperationFailed(IOperation operation)
IOperationDelegate
IOperation
failed. This only
indicates an exception during the execution and is independent from the
operation's result code.onOperationFailed
in interface IOperationDelegate
operation
- The watched IOperation
.public abstract void onOperationSuccessful(IOperation operation)
operation
- the successful IOperation
(incl. the result string)