/** Copy constructor based on a source notification object. */ protected AbstractNotification(AbstractNotification source) { this(source.getMessageNumber(), source.getResourceState(), source.getResourceId(), source .getResourceUri(), source.getChannelId()); setChannelExpiration(source.getChannelExpiration()); setChannelToken(source.getChannelToken()); setChanged(source.getChanged()); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setResourceId(String resourceId) { return (TypedNotification<T>) super.setResourceId(resourceId); }
/** * Constructor with a random UUID using {@link NotificationUtils#randomUuidString()}. * * @param notificationCallback notification handler called when a notification is received for * this subscription */ public StoredChannel(UnparsedNotificationCallback notificationCallback) { this(notificationCallback, NotificationUtils.randomUuidString()); }
/** * Stores this notification channel in the notification channel data store, which is derived from * {@link #getDefaultDataStore(DataStoreFactory)} on the given data store factory. * * <p> * It is important that this method be called before the watch HTTP request is made in case the * notification is received before the watch HTTP response is received. * </p> * * @param dataStoreFactory data store factory */ public StoredChannel store(DataStoreFactory dataStoreFactory) throws IOException { return store(getDefaultDataStore(dataStoreFactory)); }
/** * Constructor which uses {@link StoredChannel#getDefaultDataStore(DataStoreFactory)} on the given * data store factory, which is the normal use case. * * @param dataStoreFactory data store factory */ protected NotificationServlet(DataStoreFactory dataStoreFactory) throws IOException { this(StoredChannel.getDefaultDataStore(dataStoreFactory)); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setResourceState(String resourceState) { return (TypedNotification<T>) super.setResourceState(resourceState); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setChannelToken(String channelToken) { return (TypedNotification<T>) super.setChannelToken(channelToken); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setChanged(String changed) { return (TypedNotification<T>) super.setChanged(changed); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setChannelId(String channelId) { return (TypedNotification<T>) super.setChannelId(channelId); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setMessageNumber(long messageNumber) { return (TypedNotification<T>) super.setMessageNumber(messageNumber); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setResourceUri(String resourceUri) { return (TypedNotification<T>) super.setResourceUri(resourceUri); }
@Override @SuppressWarnings("unchecked") public TypedNotification<T> setChannelExpiration(String channelExpiration) { return (TypedNotification<T>) super.setChannelExpiration(channelExpiration); }
@Override public UnparsedNotification setResourceId(String resourceId) { return (UnparsedNotification) super.setResourceId(resourceId); }
@Override public UnparsedNotification setResourceState(String resourceState) { return (UnparsedNotification) super.setResourceState(resourceState); }
@Override public UnparsedNotification setChannelToken(String channelToken) { return (UnparsedNotification) super.setChannelToken(channelToken); }
@Override public UnparsedNotification setChanged(String changed) { return (UnparsedNotification) super.setChanged(changed); }
@Override public UnparsedNotification setChannelId(String channelId) { return (UnparsedNotification) super.setChannelId(channelId); }
@Override public UnparsedNotification setMessageNumber(long messageNumber) { return (UnparsedNotification) super.setMessageNumber(messageNumber); }
@Override public UnparsedNotification setResourceUri(String resourceUri) { return (UnparsedNotification) super.setResourceUri(resourceUri); }
@Override public UnparsedNotification setChannelExpiration(String channelExpiration) { return (UnparsedNotification) super.setChannelExpiration(channelExpiration); }