Class DefaultNotificationManager
- java.lang.Object
-
- org.apache.syncope.core.provisioning.java.notification.DefaultNotificationManager
-
- All Implemented Interfaces:
NotificationManager
@Transactional(rollbackFor=java.lang.Throwable.class) public class DefaultNotificationManager extends Object implements NotificationManager
-
-
Field Summary
Fields Modifier and Type Field Description protected AnyMatchDAO
anyMatchDAO
protected AnyObjectDAO
anyObjectDAO
protected AnyObjectDataBinder
anyObjectDataBinder
protected AnySearchDAO
anySearchDAO
protected ConfParamOps
confParamOps
protected DerAttrHandler
derAttrHandler
protected DerSchemaDAO
derSchemaDAO
protected EntityFactory
entityFactory
protected GroupDAO
groupDAO
protected GroupDataBinder
groupDataBinder
protected IntAttrNameParser
intAttrNameParser
protected static Logger
LOG
protected NotificationDAO
notificationDAO
protected Optional<RecipientsProvider>
perContextRecipientsProvider
protected SearchCondVisitor
searchCondVisitor
protected TaskDAO
taskDAO
protected UserDAO
userDAO
protected UserDataBinder
userDataBinder
protected VirAttrHandler
virAttrHandler
protected VirSchemaDAO
virSchemaDAO
-
Constructor Summary
Constructors Constructor Description DefaultNotificationManager(DerSchemaDAO derSchemaDAO, VirSchemaDAO virSchemaDAO, NotificationDAO notificationDAO, AnyObjectDAO anyObjectDAO, UserDAO userDAO, GroupDAO groupDAO, AnySearchDAO anySearchDAO, AnyMatchDAO anyMatchDAO, TaskDAO taskDAO, DerAttrHandler derAttrHandler, VirAttrHandler virAttrHandler, UserDataBinder userDataBinder, GroupDataBinder groupDataBinder, AnyObjectDataBinder anyObjectDataBinder, ConfParamOps confParamOps, EntityFactory entityFactory, IntAttrNameParser intAttrNameParser, SearchCondVisitor searchCondVisitor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
countExecutionsWithStatus(String taskKey, String status)
Count the number of task executions of a given task with a given status.List<NotificationTask>
createTasks(String who, AuditElements.EventCategoryType type, String category, String subcategory, String event, AuditElements.Result condition, Object before, Object output, Object... input)
Create notification tasks for each notification matching provided conditions.void
createTasks(AfterHandlingEvent event)
Create notification tasks according to the provided event.long
getMaxRetries()
protected NotificationTask
getNotificationTask(Notification notification, Any<?> any, Map<String,Object> jexlVars)
Create a notification task.protected String
getRecipientEmail(String recipientAttrName, User user)
boolean
notificationsAvailable(AuditElements.EventCategoryType type, String category, String subcategory, String event)
Checks if notifications are available matching the provided conditions.void
setTaskExecuted(String taskKey, boolean executed)
Set execution state of NotificationTask with provided id.TaskExec<NotificationTask>
storeExec(TaskExec<NotificationTask> execution)
Store execution of a NotificationTask.
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
-
derSchemaDAO
protected final DerSchemaDAO derSchemaDAO
-
virSchemaDAO
protected final VirSchemaDAO virSchemaDAO
-
notificationDAO
protected final NotificationDAO notificationDAO
-
anyObjectDAO
protected final AnyObjectDAO anyObjectDAO
-
userDAO
protected final UserDAO userDAO
-
groupDAO
protected final GroupDAO groupDAO
-
anySearchDAO
protected final AnySearchDAO anySearchDAO
-
anyMatchDAO
protected final AnyMatchDAO anyMatchDAO
-
taskDAO
protected final TaskDAO taskDAO
-
derAttrHandler
protected final DerAttrHandler derAttrHandler
-
virAttrHandler
protected final VirAttrHandler virAttrHandler
-
userDataBinder
protected final UserDataBinder userDataBinder
-
groupDataBinder
protected final GroupDataBinder groupDataBinder
-
anyObjectDataBinder
protected final AnyObjectDataBinder anyObjectDataBinder
-
confParamOps
protected final ConfParamOps confParamOps
-
entityFactory
protected final EntityFactory entityFactory
-
intAttrNameParser
protected final IntAttrNameParser intAttrNameParser
-
searchCondVisitor
protected final SearchCondVisitor searchCondVisitor
-
perContextRecipientsProvider
protected Optional<RecipientsProvider> perContextRecipientsProvider
-
-
Constructor Detail
-
DefaultNotificationManager
public DefaultNotificationManager(DerSchemaDAO derSchemaDAO, VirSchemaDAO virSchemaDAO, NotificationDAO notificationDAO, AnyObjectDAO anyObjectDAO, UserDAO userDAO, GroupDAO groupDAO, AnySearchDAO anySearchDAO, AnyMatchDAO anyMatchDAO, TaskDAO taskDAO, DerAttrHandler derAttrHandler, VirAttrHandler virAttrHandler, UserDataBinder userDataBinder, GroupDataBinder groupDataBinder, AnyObjectDataBinder anyObjectDataBinder, ConfParamOps confParamOps, EntityFactory entityFactory, IntAttrNameParser intAttrNameParser, SearchCondVisitor searchCondVisitor)
-
-
Method Detail
-
getMaxRetries
@Transactional(readOnly=true) public long getMaxRetries()
- Specified by:
getMaxRetries
in interfaceNotificationManager
-
getNotificationTask
protected NotificationTask getNotificationTask(Notification notification, Any<?> any, Map<String,Object> jexlVars)
Create a notification task.- Parameters:
notification
- notification to take as modelany
- the any object this task is aboutjexlVars
- JEXL variables- Returns:
- notification task, fully populated
-
notificationsAvailable
public boolean notificationsAvailable(AuditElements.EventCategoryType type, String category, String subcategory, String event)
Description copied from interface:NotificationManager
Checks if notifications are available matching the provided conditions.- Specified by:
notificationsAvailable
in interfaceNotificationManager
- Parameters:
type
- event category typecategory
- event categorysubcategory
- event subcategoryevent
- event- Returns:
- created notification tasks
-
createTasks
public void createTasks(AfterHandlingEvent event)
Description copied from interface:NotificationManager
Create notification tasks according to the provided event.- Specified by:
createTasks
in interfaceNotificationManager
- Parameters:
event
- Spring event raised during Logic processing
-
createTasks
public List<NotificationTask> createTasks(String who, AuditElements.EventCategoryType type, String category, String subcategory, String event, AuditElements.Result condition, Object before, Object output, Object... input)
Description copied from interface:NotificationManager
Create notification tasks for each notification matching provided conditions.- Specified by:
createTasks
in interfaceNotificationManager
- Parameters:
who
- user triggering the eventtype
- event category typecategory
- event categorysubcategory
- event subcategoryevent
- eventcondition
- result value condition.before
- object(s) availabile before the eventoutput
- object(s) produced by the eventinput
- object(s) provided to the event- Returns:
- created notification tasks
-
storeExec
public TaskExec<NotificationTask> storeExec(TaskExec<NotificationTask> execution)
Description copied from interface:NotificationManager
Store execution of a NotificationTask.- Specified by:
storeExec
in interfaceNotificationManager
- Parameters:
execution
- task execution.- Returns:
- merged task execution.
-
setTaskExecuted
public void setTaskExecuted(String taskKey, boolean executed)
Description copied from interface:NotificationManager
Set execution state of NotificationTask with provided id.- Specified by:
setTaskExecuted
in interfaceNotificationManager
- Parameters:
taskKey
- task to be updatedexecuted
- execution state
-
countExecutionsWithStatus
public long countExecutionsWithStatus(String taskKey, String status)
Description copied from interface:NotificationManager
Count the number of task executions of a given task with a given status.- Specified by:
countExecutionsWithStatus
in interfaceNotificationManager
- Parameters:
taskKey
- taskstatus
- status- Returns:
- number of task executions
-
-