rapture.common.client.HttpNotificationApi Maven / Gradle / Ivy
/**
* The MIT License (MIT)
*
* Copyright (C) 2011-2016 Incapture Technologies LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* This file is autogenerated and any changes will be overwritten.
*/
package rapture.common.client;
import java.util.List;
import java.util.Map;
import rapture.common.api.NotificationApi;
import rapture.common.api.ScriptNotificationApi;
import rapture.common.CallingContext;
import rapture.common.model.GeneralResponse;
import rapture.common.model.BasePayload;
import rapture.common.exception.RaptureException;
import rapture.common.impl.jackson.JacksonUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import org.apache.log4j.Logger;
import rapture.common.model.RaptureNotificationConfig;
import rapture.common.NotificationInfo;
import rapture.common.RaptureFolderInfo;
import rapture.common.NotificationResult;
import rapture.common.shared.notification.GetNotificationManagerConfigsPayload;
import rapture.common.shared.notification.ListNotificationsByUriPrefixPayload;
import rapture.common.shared.notification.FindNotificationManagerConfigsByPurposePayload;
import rapture.common.shared.notification.CreateNotificationManagerPayload;
import rapture.common.shared.notification.NotificationManagerExistsPayload;
import rapture.common.shared.notification.GetNotificationManagerConfigPayload;
import rapture.common.shared.notification.DeleteNotificationManagerPayload;
import rapture.common.shared.notification.GetLatestNotificationEpochPayload;
import rapture.common.shared.notification.PublishNotificationPayload;
import rapture.common.shared.notification.FindNotificationsAfterEpochPayload;
import rapture.common.shared.notification.GetNotificationPayload;
@SuppressWarnings("all")
public class HttpNotificationApi extends BaseHttpApi implements NotificationApi, ScriptNotificationApi {
private static final Logger log = Logger.getLogger(HttpNotificationApi.class);
public HttpNotificationApi(HttpLoginApi login) {
super(login, "notification");
}
private static final class GetNotificationManagerConfigsTypeReference extends TypeReference> {
}
@Override
public List getNotificationManagerConfigs(CallingContext context) {
GetNotificationManagerConfigsPayload requestObj = new GetNotificationManagerConfigsPayload();
requestObj.setContext(context == null ? this.getContext() : context);
return doRequest(requestObj, "GETNOTIFICATIONMANAGERCONFIGS", new GetNotificationManagerConfigsTypeReference()); }
private static final class ListNotificationsByUriPrefixTypeReference extends TypeReference> {
}
@Override
public List listNotificationsByUriPrefix(CallingContext context, String uriPrefix) {
ListNotificationsByUriPrefixPayload requestObj = new ListNotificationsByUriPrefixPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setUriPrefix(uriPrefix);
return doRequest(requestObj, "LISTNOTIFICATIONSBYURIPREFIX", new ListNotificationsByUriPrefixTypeReference()); }
private static final class FindNotificationManagerConfigsByPurposeTypeReference extends TypeReference> {
}
@Override
public List findNotificationManagerConfigsByPurpose(CallingContext context, String purpose) {
FindNotificationManagerConfigsByPurposePayload requestObj = new FindNotificationManagerConfigsByPurposePayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setPurpose(purpose);
return doRequest(requestObj, "FINDNOTIFICATIONMANAGERCONFIGSBYPURPOSE", new FindNotificationManagerConfigsByPurposeTypeReference()); }
private static final class CreateNotificationManagerTypeReference extends TypeReference {
}
@Override
public RaptureNotificationConfig createNotificationManager(CallingContext context, String notificationManagerUri, String config, String purpose) {
CreateNotificationManagerPayload requestObj = new CreateNotificationManagerPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationManagerUri(notificationManagerUri);
requestObj.setConfig(config);
requestObj.setPurpose(purpose);
return doRequest(requestObj, "CREATENOTIFICATIONMANAGER", new CreateNotificationManagerTypeReference()); }
private static final class NotificationManagerExistsTypeReference extends TypeReference {
}
@Override
public Boolean notificationManagerExists(CallingContext context, String notificationManagerUri) {
NotificationManagerExistsPayload requestObj = new NotificationManagerExistsPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationManagerUri(notificationManagerUri);
return doRequest(requestObj, "NOTIFICATIONMANAGEREXISTS", new NotificationManagerExistsTypeReference()); }
private static final class GetNotificationManagerConfigTypeReference extends TypeReference {
}
@Override
public RaptureNotificationConfig getNotificationManagerConfig(CallingContext context, String notificationManagerUri) {
GetNotificationManagerConfigPayload requestObj = new GetNotificationManagerConfigPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationManagerUri(notificationManagerUri);
return doRequest(requestObj, "GETNOTIFICATIONMANAGERCONFIG", new GetNotificationManagerConfigTypeReference()); }
@Override
public void deleteNotificationManager(CallingContext context, String notificationManagerUri) {
DeleteNotificationManagerPayload requestObj = new DeleteNotificationManagerPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationManagerUri(notificationManagerUri);
doRequest(requestObj, "DELETENOTIFICATIONMANAGER", null); }
private static final class GetLatestNotificationEpochTypeReference extends TypeReference {
}
@Override
public Long getLatestNotificationEpoch(CallingContext context, String notificationManagerUri) {
GetLatestNotificationEpochPayload requestObj = new GetLatestNotificationEpochPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationManagerUri(notificationManagerUri);
return doRequest(requestObj, "GETLATESTNOTIFICATIONEPOCH", new GetLatestNotificationEpochTypeReference()); }
private static final class PublishNotificationTypeReference extends TypeReference {
}
@Override
public String publishNotification(CallingContext context, String notificationManagerUri, String referenceId, String content, String contentType) {
PublishNotificationPayload requestObj = new PublishNotificationPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationManagerUri(notificationManagerUri);
requestObj.setReferenceId(referenceId);
requestObj.setContent(content);
requestObj.setContentType(contentType);
return doRequest(requestObj, "PUBLISHNOTIFICATION", new PublishNotificationTypeReference()); }
private static final class FindNotificationsAfterEpochTypeReference extends TypeReference {
}
@Override
public NotificationResult findNotificationsAfterEpoch(CallingContext context, String notificationManagerUri, Long epoch) {
FindNotificationsAfterEpochPayload requestObj = new FindNotificationsAfterEpochPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationManagerUri(notificationManagerUri);
requestObj.setEpoch(epoch);
return doRequest(requestObj, "FINDNOTIFICATIONSAFTEREPOCH", new FindNotificationsAfterEpochTypeReference()); }
private static final class GetNotificationTypeReference extends TypeReference {
}
@Override
public NotificationInfo getNotification(CallingContext context, String notificationUri, String id) {
GetNotificationPayload requestObj = new GetNotificationPayload();
requestObj.setContext(context == null ? this.getContext() : context);
requestObj.setNotificationUri(notificationUri);
requestObj.setId(id);
return doRequest(requestObj, "GETNOTIFICATION", new GetNotificationTypeReference()); }
@Override
public List getNotificationManagerConfigs() {
return getNotificationManagerConfigs(null); }
@Override
public List listNotificationsByUriPrefix(String uriPrefix) {
return listNotificationsByUriPrefix(null,uriPrefix); }
@Override
public List findNotificationManagerConfigsByPurpose(String purpose) {
return findNotificationManagerConfigsByPurpose(null,purpose); }
@Override
public RaptureNotificationConfig createNotificationManager(String notificationManagerUri, String config, String purpose) {
return createNotificationManager(null,notificationManagerUri,config,purpose); }
@Override
public Boolean notificationManagerExists(String notificationManagerUri) {
return notificationManagerExists(null,notificationManagerUri); }
@Override
public RaptureNotificationConfig getNotificationManagerConfig(String notificationManagerUri) {
return getNotificationManagerConfig(null,notificationManagerUri); }
@Override
public void deleteNotificationManager(String notificationManagerUri) {
deleteNotificationManager(null,notificationManagerUri); }
@Override
public Long getLatestNotificationEpoch(String notificationManagerUri) {
return getLatestNotificationEpoch(null,notificationManagerUri); }
@Override
public String publishNotification(String notificationManagerUri, String referenceId, String content, String contentType) {
return publishNotification(null,notificationManagerUri,referenceId,content,contentType); }
@Override
public NotificationResult findNotificationsAfterEpoch(String notificationManagerUri, Long epoch) {
return findNotificationsAfterEpoch(null,notificationManagerUri,epoch); }
@Override
public NotificationInfo getNotification(String notificationUri, String id) {
return getNotification(null,notificationUri,id); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy