public interface IServiceDelegate
IServiceDelegate
is used as a listener for
AbstractRestOperation
's. The user is allowed to provide any number of
IServiceDelegate
's for a specific AbstractRestOperation
.
To register the delegate, use the
AbstractRestOperation.addServiceDelegate(IServiceDelegate)
method.
final IServiceDelegate delegate = ...; AbstractRestOperation.addServiceDelegate(delegate);Use the
AbstractRestOperation.removeServiceDelegate(IServiceDelegate)
method to remove delegates from a desired AbstractRestOperation
.Modifier and Type | Method and Description |
---|---|
void |
onOperationFailed(AbstractRestOperation operation)
Notifies this listener that the watched
AbstractRestOperation
failed. |
void |
onOperationFinished(AbstractRestOperation operation)
Notifies this listener that the watched
AbstractRestOperation
finished. |
void onOperationFailed(AbstractRestOperation operation)
AbstractRestOperation
failed. This only indicates an exception during the communication and
does not represent the HTTP status code.operation
- The watched AbstractRestOperation
.void onOperationFinished(AbstractRestOperation operation)
AbstractRestOperation
finished. AbstractRestOperation.getResponseCode()
to validate the
success of the operation. E.g.:
switch (operation.getResponseCode()) { caseHttpConnection.HTTP_OK
: break; caseHttpConnection.HTTP_FORBIDDEN
: break; }
operation
- The watched AbstractRestOperation
.