use of com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsRequest 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;
}
use of com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsRequest in project blogwt by billy1380.
the class NotificationService method updateNotificationSettings.
public Request updateNotificationSettings(UpdateNotificationSettingsRequest input, AsyncSuccess<UpdateNotificationSettingsRequest, UpdateNotificationSettingsResponse> onSuccess, AsyncFailure<UpdateNotificationSettingsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodUpdateNotificationSettings, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdateNotificationSettingsResponse outputParameter = new UpdateNotificationSettingsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
return handle;
}
Aggregations