Class NotificationService
java.lang.Object
org.apache.camel.builder.BuilderSupport
org.apache.camel.builder.RouteBuilder
org.openremote.manager.notification.NotificationService
- All Implemented Interfaces:
org.apache.camel.builder.ModelRoutesBuilder,org.apache.camel.CamelContextAware,org.apache.camel.Ordered,org.apache.camel.RoutesBuilder,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.ResourceAware,org.openremote.model.ContainerService
public class NotificationService
extends org.apache.camel.builder.RouteBuilder
implements org.openremote.model.ContainerService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AssetStorageServiceprotected ExecutorServiceprotected ManagerIdentityServiceprotected org.openremote.container.message.MessageBrokerServicestatic final Stringprotected Map<String, NotificationHandler> protected org.openremote.container.persistence.PersistenceServiceprotected org.openremote.container.timer.TimerServiceFields inherited from class org.apache.camel.builder.RouteBuilder
logFields inherited from interface org.openremote.model.ContainerService
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, MED_PRIORITYFields inherited from interface org.apache.camel.Ordered
HIGHEST, LOWEST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckAccess(org.openremote.model.notification.Notification.Source source, String sourceId, List<org.openremote.model.notification.Notification.Target> targets, String realm, String userId, boolean isSuperUser, boolean isRestrictedUser, String assetId) voidList<org.openremote.model.notification.SentNotification> getNotifications(List<Long> ids, List<String> types, Long fromTimestamp, Long toTimestamp, List<String> realmIds, List<String> userIds, List<String> assetIds) intprotected InstantgetRepeatAfterTimestamp(org.openremote.model.notification.Notification notification, Instant lastSend) org.openremote.model.notification.SentNotificationgetSentNotification(Long notificationId) voidinit(org.openremote.model.Container container) protected booleanokToSendNotification(org.openremote.model.notification.Notification.Source source, String sourceId, org.openremote.model.notification.Notification.Target target, org.openremote.model.notification.Notification notification) protected voidprocessCriteria(StringBuilder builder, List<Object> parameters, List<Long> ids, List<String> types, Long fromTimestamp, Long toTimestamp, List<String> realmIds, List<String> userIds, List<String> assetIds, boolean isRemove) voidvoidremoveNotifications(List<Long> ids, List<String> types, Long fromTimestamp, Long toTimestamp, List<String> realmIds, List<String> userIds, List<String> assetIds) booleansendNotification(org.openremote.model.notification.Notification notification) booleansendNotification(org.openremote.model.notification.Notification notification, org.openremote.model.notification.Notification.Source source, String sourceId) voidsendNotificationAsync(org.openremote.model.notification.Notification notification, org.openremote.model.notification.Notification.Source source, String sourceId) voidsetNotificationAcknowledged(long id, String acknowledgement) voidsetNotificationAcknowledged(long id, String acknowledgement, long timestamp) voidsetNotificationDelivered(long id) voidsetNotificationDelivered(long id, long timestamp) voidstart(org.openremote.model.Container container) voidstop(org.openremote.model.Container container) Methods inherited from class org.apache.camel.builder.RouteBuilder
addLifecycleInterceptor, addRoutes, addRoutesToCamelContext, addTemplatedRoutesToCamelContext, bindToRegistry, bindToRegistry, checkInitialized, configuration, configureRest, configureRests, configureRoute, configureRouteConfiguration, configureRoutes, configureRouteTemplate, configureTemplatedRoute, customize, customize, dataFormat, errorHandler, errorHandler, expression, from, from, from, fromF, fromV, fromV, getBeans, getOrder, getResource, getRestCollection, getRestConfiguration, getRests, getRouteCollection, getRoutes, getRouteTemplateCollection, getTemplatedRouteCollection, initializeCamelContext, intercept, interceptFrom, interceptFrom, interceptSendToEndpoint, loadRoutesBuilder, loadRoutesBuilder, onCompletion, onException, onException, populateBeans, populateOrUpdateRoutes, populateRests, populateRoutes, populateRouteTemplates, populateTemplatedRoutes, populateTransformers, populateValidators, prepareModel, property, propertyInject, removeLifecycleInterceptor, rest, rest, restConfiguration, routeTemplate, setErrorHandlerFactory, setResource, setRestCollection, setRouteTemplateCollection, setTemplatedRouteCollection, templatedRoute, tokenizer, toString, transformer, updateRoutesToCamelContext, validatorMethods inherited from class org.apache.camel.builder.BuilderSupport
body, bodyAs, constant, constant, constant, createErrorHandlerBuilder, csimple, csimple, datasonnet, datasonnet, datasonnet, deadLetterChannel, deadLetterChannel, defaultErrorHandler, endpoint, endpoint, exceptionMessage, exchangeProperty, expression, getCamelContext, getContext, getErrorHandlerFactory, hasErrorHandlerFactory, header, java, java, joor, joor, jq, jq, jsonpath, jsonpath, jtaTransactionErrorHandler, jtaTransactionErrorHandler, jtaTransactionErrorHandler, method, method, method, method, noErrorHandler, regexReplaceAll, regexReplaceAll, setCamelContext, simple, simple, simpleF, simpleF, springTransactionErrorHandler, springTransactionErrorHandler, springTransactionErrorHandler, systemProperty, systemProperty, variable, xpath, xpath, xpath, xpath
-
Field Details
-
NOTIFICATION_QUEUE
- See Also:
-
timerService
protected org.openremote.container.timer.TimerService timerService -
persistenceService
protected org.openremote.container.persistence.PersistenceService persistenceService -
assetStorageService
-
identityService
-
messageBrokerService
protected org.openremote.container.message.MessageBrokerService messageBrokerService -
executorService
-
notificationHandlerMap
-
-
Constructor Details
-
NotificationService
public NotificationService()
-
-
Method Details
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceorg.openremote.model.ContainerService
-
init
- Specified by:
initin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
start
- Specified by:
startin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
configure
- Specified by:
configurein classorg.apache.camel.builder.RouteBuilder- Throws:
Exception
-
sendNotification
public boolean sendNotification(org.openremote.model.notification.Notification notification) -
sendNotificationAsync
public void sendNotificationAsync(org.openremote.model.notification.Notification notification, org.openremote.model.notification.Notification.Source source, String sourceId) -
sendNotification
public boolean sendNotification(org.openremote.model.notification.Notification notification, org.openremote.model.notification.Notification.Source source, String sourceId) -
setNotificationDelivered
public void setNotificationDelivered(long id) -
setNotificationDelivered
public void setNotificationDelivered(long id, long timestamp) -
setNotificationAcknowledged
-
setNotificationAcknowledged
-
getSentNotification
-
getNotifications
public List<org.openremote.model.notification.SentNotification> getNotifications(List<Long> ids, List<String> types, Long fromTimestamp, Long toTimestamp, List<String> realmIds, List<String> userIds, List<String> assetIds) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
removeNotification
-
removeNotifications
public void removeNotifications(List<Long> ids, List<String> types, Long fromTimestamp, Long toTimestamp, List<String> realmIds, List<String> userIds, List<String> assetIds) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
processCriteria
-
getRepeatAfterTimestamp
-
checkAccess
protected void checkAccess(org.openremote.model.notification.Notification.Source source, String sourceId, List<org.openremote.model.notification.Notification.Target> targets, String realm, String userId, boolean isSuperUser, boolean isRestrictedUser, String assetId) throws NotificationProcessingException - Throws:
NotificationProcessingException
-
okToSendNotification
protected boolean okToSendNotification(org.openremote.model.notification.Notification.Source source, String sourceId, org.openremote.model.notification.Notification.Target target, org.openremote.model.notification.Notification notification)
-