use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method changePassword.
public Request changePassword(ChangePasswordRequest input, AsyncSuccess<ChangePasswordRequest, ChangePasswordResponse> onSuccess, AsyncFailure<ChangePasswordRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodChangePassword, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
ChangePasswordResponse outputParameter = new ChangePasswordResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodChangePassword, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodChangePassword, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodChangePassword, input, exception);
}
});
onCallStart(UserService.this, UserMethodChangePassword, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodChangePassword, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method getUsers.
public Request getUsers(GetUsersRequest input, AsyncSuccess<GetUsersRequest, GetUsersResponse> onSuccess, AsyncFailure<GetUsersRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodGetUsers, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetUsersResponse outputParameter = new GetUsersResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodGetUsers, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetUsers, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetUsers, input, exception);
}
});
onCallStart(UserService.this, UserMethodGetUsers, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetUsers, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method login.
public Request login(LoginRequest input, AsyncSuccess<LoginRequest, LoginResponse> onSuccess, AsyncFailure<LoginRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodLogin, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
LoginResponse outputParameter = new LoginResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodLogin, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodLogin, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodLogin, input, exception);
}
});
onCallStart(UserService.this, UserMethodLogin, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodLogin, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method verifyAccount.
public Request verifyAccount(VerifyAccountRequest input, AsyncSuccess<VerifyAccountRequest, VerifyAccountResponse> onSuccess, AsyncFailure<VerifyAccountRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodVerifyAccount, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
VerifyAccountResponse outputParameter = new VerifyAccountResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodVerifyAccount, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodVerifyAccount, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodVerifyAccount, input, exception);
}
});
onCallStart(UserService.this, UserMethodVerifyAccount, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodVerifyAccount, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class UserService method getRoles.
public Request getRoles(GetRolesRequest input, AsyncSuccess<GetRolesRequest, GetRolesResponse> onSuccess, AsyncFailure<GetRolesRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodGetRoles, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetRolesResponse outputParameter = new GetRolesResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodGetRoles, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetRoles, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetRoles, input, exception);
}
});
onCallStart(UserService.this, UserMethodGetRoles, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetRoles, input, exception);
}
return handle;
}
Aggregations