use of com.willshex.blogwt.shared.api.user.call.IsAuthorisedResponse in project blogwt by billy1380.
the class UserService method isAuthorised.
public Request isAuthorised(IsAuthorisedRequest input, AsyncSuccess<IsAuthorisedRequest, IsAuthorisedResponse> onSuccess, AsyncFailure<IsAuthorisedRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodIsAuthorised, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
IsAuthorisedResponse outputParameter = new IsAuthorisedResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodIsAuthorised, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodIsAuthorised, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodIsAuthorised, input, exception);
}
});
onCallStart(UserService.this, UserMethodIsAuthorised, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodIsAuthorised, input, exception);
}
return handle;
}
Aggregations