use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.
the class NotificationService method setPushToken.
public Request setPushToken(SetPushTokenRequest input, AsyncSuccess<SetPushTokenRequest, SetPushTokenResponse> onSuccess, AsyncFailure<SetPushTokenRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodSetPushToken, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
SetPushTokenResponse outputParameter = new SetPushTokenResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodSetPushToken, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodSetPushToken, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodSetPushToken, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodSetPushToken, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodSetPushToken, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.
the class NotificationService method getMetaNotifications.
public Request getMetaNotifications(GetMetaNotificationsRequest input, AsyncSuccess<GetMetaNotificationsRequest, GetMetaNotificationsResponse> onSuccess, AsyncFailure<GetMetaNotificationsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodGetMetaNotifications, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetMetaNotificationsResponse outputParameter = new GetMetaNotificationsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodGetMetaNotifications, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetMetaNotifications, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetMetaNotifications, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodGetMetaNotifications, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetMetaNotifications, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.
the class NotificationService method getNotificationSettings.
public Request getNotificationSettings(GetNotificationSettingsRequest input, AsyncSuccess<GetNotificationSettingsRequest, GetNotificationSettingsResponse> onSuccess, AsyncFailure<GetNotificationSettingsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodGetNotificationSettings, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetNotificationSettingsResponse outputParameter = new GetNotificationSettingsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodGetNotificationSettings, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotificationSettings, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotificationSettings, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodGetNotificationSettings, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotificationSettings, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.
the class PageService method createPage.
public Request createPage(CreatePageRequest input, AsyncSuccess<CreatePageRequest, CreatePageResponse> onSuccess, AsyncFailure<CreatePageRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodCreatePage, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
CreatePageResponse outputParameter = new CreatePageResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodCreatePage, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodCreatePage, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodCreatePage, input, exception);
}
});
onCallStart(PageService.this, PageMethodCreatePage, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodCreatePage, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestCallback in project pentaho-platform by pentaho.
the class UserRolesAdminPanelController method initializeActionBaseSecurityElements.
private void initializeActionBaseSecurityElements() {
final String url = GWT.getHostPageBaseURL() + "api/userroledao/logicalRoleMap";
RequestBuilder executableTypesRequestBuilder = new RequestBuilder(RequestBuilder.GET, url);
executableTypesRequestBuilder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
executableTypesRequestBuilder.setHeader("accept", "application/json");
try {
executableTypesRequestBuilder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
}
public void onResponseReceived(Request request, Response response) {
String roleMappings = response.getText();
rolesPermissionsPanel.initializeActionBaseSecurityElements(roleMappings);
systemRolesPermissionsPanel.initializeActionBaseSecurityElements(roleMappings);
}
});
} catch (RequestException e) {
// ignored
}
}
Aggregations