public NotificationRef toNotificationRef() { return new NotificationRef(domainName, notificationId, revision); }
public NotificationRef createAttachment(CreateAttachment create) { CouchMediaType mediaType = CouchMediaType.fromString(create.getContentType()); NotificationRef notificationRef = create.getNotificationRef(); WriteResponse response = couchDatabase.put().attachment( notificationRef.getNotificationId(), notificationRef.getRevision(), create.getAttachmentName(), mediaType, create.getInputStream()) .onError(r -> throwError(r, format("Failure storing notification attachment in couch [%s] - %s", r.getHttpStatus(), r.getErrorReason()))) .execute(); return new NotificationRef(notificationRef.getDomainName(), notificationRef.getNotificationId(), response.getDocumentRevision()); }
public static CreateTask create(NotificationRef notification, Destination destination) { return new CreateTask(notification.getNotificationId(), destination); }
public Notification newNotification(CreateNotification create) { NotificationRef notificationRef = notificationKernel.createNotification(create); return notificationKernel.findNotificationById(notificationRef.getNotificationId()); }
public NotificationRef toNotificationRef() { return new NotificationRef(domainName, notificationId, revision); }