Class NotificationHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.utils.notifications.NotificationHandlerImpl
-
- All Implemented Interfaces:
NotificationHandler,NotificationHandlerImplementor
@Component public class NotificationHandlerImpl extends BaseNetworkedHandlerImpl implements NotificationHandlerImplementor
Service implementation for notifications
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, transactionHandler, translationHandler
-
Fields inherited from interface org.cyclos.impl.utils.notifications.NotificationHandler
ATTR_ENTITY, ATTR_TYPE, ATTR_USER
-
-
Constructor Summary
Constructors Constructor Description NotificationHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdminNotificationsHandleradmin()It returns a handler to allow to notify administrators.<E extends SimpleEntity>
EntityNotificationProcessingHandler<E>getProcessingHandler(NotificationProcessingEntityType<E> t)Returns aEntityNotificationProcessingHandlerfor the given typevoidinitialize()protected booleannetworkCheck(User admin, NetworkedEntity entity)voidnotify(BasicUser user, UserNotificationType type, NotificationURL url, SimpleEntity entity, User relatedUser, Object... arguments)Notify a user about an event on Cyclos and allow to add an optional URL associated to it.UserNotificationsHandlerAccessoruser(BasicUser user)It returns an accessor used to get a handler to allow notify the specified user.-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
admin
public AdminNotificationsHandler admin()
Description copied from interface:NotificationHandlerIt returns a handler to allow to notify administrators.- Specified by:
adminin interfaceNotificationHandler
-
getProcessingHandler
public <E extends SimpleEntity> EntityNotificationProcessingHandler<E> getProcessingHandler(NotificationProcessingEntityType<E> t)
Description copied from interface:NotificationHandlerReturns aEntityNotificationProcessingHandlerfor the given type- Specified by:
getProcessingHandlerin interfaceNotificationHandler
-
initialize
@PostConstruct public void initialize()
-
notify
public void notify(BasicUser user, UserNotificationType type, NotificationURL url, SimpleEntity entity, User relatedUser, Object... arguments)
Description copied from interface:NotificationHandlerImplementorNotify a user about an event on Cyclos and allow to add an optional URL associated to it. First, it is checked whether the given user can actually receive the notification. If not, do nothing. If the user receives the notification, aNotificationis persisted, and will be later processed to send e-mail and / or SMS.- Specified by:
notifyin interfaceNotificationHandlerImplementor
-
user
public UserNotificationsHandlerAccessor user(BasicUser user)
Description copied from interface:NotificationHandlerIt returns an accessor used to get a handler to allow notify the specified user.- Specified by:
userin interfaceNotificationHandler
-
networkCheck
protected boolean networkCheck(User admin, NetworkedEntity entity)
-
-