use of com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationRequest in project blogwt by billy1380.
the class NotificationService method getMetaNotification.
public Request getMetaNotification(GetMetaNotificationRequest input, AsyncSuccess<GetMetaNotificationRequest, GetMetaNotificationResponse> onSuccess, AsyncFailure<GetMetaNotificationRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodGetMetaNotification, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetMetaNotificationResponse outputParameter = new GetMetaNotificationResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodGetMetaNotification, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetMetaNotification, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetMetaNotification, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodGetMetaNotification, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetMetaNotification, input, exception);
}
return handle;
}
use of com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationRequest in project blogwt by billy1380.
the class NotificationJsonServlet method processAction.
@Override
protected String processAction(String action, JsonObject request) {
String output = "null";
if ("UpdateMetaNotification".equals(action)) {
UpdateMetaNotificationRequest input = new UpdateMetaNotificationRequest();
input.fromJson(request);
output = new UpdateMetaNotificationActionHandler().handle(input).toString();
} else if ("AddMetaNotification".equals(action)) {
AddMetaNotificationRequest input = new AddMetaNotificationRequest();
input.fromJson(request);
output = new AddMetaNotificationActionHandler().handle(input).toString();
} else if ("GetMetaNotification".equals(action)) {
GetMetaNotificationRequest input = new GetMetaNotificationRequest();
input.fromJson(request);
output = new GetMetaNotificationActionHandler().handle(input).toString();
} else if ("GetNotifications".equals(action)) {
GetNotificationsRequest input = new GetNotificationsRequest();
input.fromJson(request);
output = new GetNotificationsActionHandler().handle(input).toString();
} else if ("GetMetaNotifications".equals(action)) {
GetMetaNotificationsRequest input = new GetMetaNotificationsRequest();
input.fromJson(request);
output = new GetMetaNotificationsActionHandler().handle(input).toString();
} else if ("GetNotificationSettings".equals(action)) {
GetNotificationSettingsRequest input = new GetNotificationSettingsRequest();
input.fromJson(request);
output = new GetNotificationSettingsActionHandler().handle(input).toString();
} else if ("SendAdhocNotification".equals(action)) {
SendAdhocNotificationRequest input = new SendAdhocNotificationRequest();
input.fromJson(request);
output = new SendAdhocNotificationActionHandler().handle(input).toString();
} else if ("UpdateNotificationSettings".equals(action)) {
UpdateNotificationSettingsRequest input = new UpdateNotificationSettingsRequest();
input.fromJson(request);
output = new UpdateNotificationSettingsActionHandler().handle(input).toString();
} else if ("SetPushToken".equals(action)) {
SetPushTokenRequest input = new SetPushTokenRequest();
input.fromJson(request);
output = new SetPushTokenActionHandler().handle(input).toString();
}
return output;
}
Aggregations