Package eu.clarin.sru.client
Interface SRUCallback<V extends eu.clarin.sru.client.SRUAbstractRequest,S extends eu.clarin.sru.client.SRUAbstractResponse<V>>
-
- Type Parameters:
V
- the request typeS
- the response type
public interface SRUCallback<V extends eu.clarin.sru.client.SRUAbstractRequest,S extends eu.clarin.sru.client.SRUAbstractResponse<V>>
A interface for creating asynchronous callbacks for use with theSRUThreadedClient
.NB: the callbacks will be executed by any of worker threads of the client.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onError(V request, SRUClientException error)
Invoked when the request yielded an errorvoid
onSuccess(S response)
Invoked when the request has been completed successfully.
-
-
-
Method Detail
-
onSuccess
void onSuccess(S response)
Invoked when the request has been completed successfully.- Parameters:
response
- the response to the request
-
onError
void onError(V request, SRUClientException error)
Invoked when the request yielded an error- Parameters:
request
- the original requesterror
- the error
-
-