use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method getPermissions.
public Request getPermissions(GetPermissionsRequest input, AsyncSuccess<GetPermissionsRequest, GetPermissionsResponse> onSuccess, AsyncFailure<GetPermissionsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodGetPermissions, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetPermissionsResponse outputParameter = new GetPermissionsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodGetPermissions, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetPermissions, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetPermissions, input, exception);
}
});
onCallStart(UserService.this, UserMethodGetPermissions, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetPermissions, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method changeUserDetails.
public Request changeUserDetails(ChangeUserDetailsRequest input, AsyncSuccess<ChangeUserDetailsRequest, ChangeUserDetailsResponse> onSuccess, AsyncFailure<ChangeUserDetailsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodChangeUserDetails, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
ChangeUserDetailsResponse outputParameter = new ChangeUserDetailsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodChangeUserDetails, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodChangeUserDetails, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodChangeUserDetails, input, exception);
}
});
onCallStart(UserService.this, UserMethodChangeUserDetails, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodChangeUserDetails, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request 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;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method registerUser.
public Request registerUser(RegisterUserRequest input, AsyncSuccess<RegisterUserRequest, RegisterUserResponse> onSuccess, AsyncFailure<RegisterUserRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodRegisterUser, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
RegisterUserResponse outputParameter = new RegisterUserResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodRegisterUser, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodRegisterUser, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodRegisterUser, input, exception);
}
});
onCallStart(UserService.this, UserMethodRegisterUser, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodRegisterUser, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method forgotPassword.
public Request forgotPassword(ForgotPasswordRequest input, AsyncSuccess<ForgotPasswordRequest, ForgotPasswordResponse> onSuccess, AsyncFailure<ForgotPasswordRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodForgotPassword, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
ForgotPasswordResponse outputParameter = new ForgotPasswordResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodForgotPassword, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodForgotPassword, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodForgotPassword, input, exception);
}
});
onCallStart(UserService.this, UserMethodForgotPassword, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodForgotPassword, input, exception);
}
return handle;
}
Aggregations