use of com.google.gwt.json.client.JSONException 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.json.client.JSONException 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.json.client.JSONException 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.json.client.JSONException 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.json.client.JSONException 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;
}
Aggregations