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 AnyMatchDAOanyMatchDAOprotected AnyObjectDAOanyObjectDAOprotected AnyObjectDataBinderanyObjectDataBinderprotected AnySearchDAOanySearchDAOprotected ConfParamOpsconfParamOpsprotected DerAttrHandlerderAttrHandlerprotected DerSchemaDAOderSchemaDAOprotected EntityFactoryentityFactoryprotected GroupDAOgroupDAOprotected GroupDataBindergroupDataBinderprotected IntAttrNameParserintAttrNameParserprotected static LoggerLOGprotected NotificationDAOnotificationDAOprotected Optional<RecipientsProvider>perContextRecipientsProviderprotected SearchCondVisitorsearchCondVisitorprotected TaskDAOtaskDAOprotected UserDAOuserDAOprotected UserDataBinderuserDataBinderprotected VirAttrHandlervirAttrHandlerprotected VirSchemaDAOvirSchemaDAO
-
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 longcountExecutionsWithStatus(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.voidcreateTasks(AfterHandlingEvent event)Create notification tasks according to the provided event.longgetMaxRetries()protected NotificationTaskgetNotificationTask(Notification notification, Any<?> any, Map<String,Object> jexlVars)Create a notification task.protected StringgetRecipientEmail(String recipientAttrName, User user)booleannotificationsAvailable(AuditElements.EventCategoryType type, String category, String subcategory, String event)Checks if notifications are available matching the provided conditions.voidsetTaskExecuted(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:
getMaxRetriesin 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:NotificationManagerChecks if notifications are available matching the provided conditions.- Specified by:
notificationsAvailablein 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:NotificationManagerCreate notification tasks according to the provided event.- Specified by:
createTasksin 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:NotificationManagerCreate notification tasks for each notification matching provided conditions.- Specified by:
createTasksin 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:NotificationManagerStore execution of a NotificationTask.- Specified by:
storeExecin interfaceNotificationManager- Parameters:
execution- task execution.- Returns:
- merged task execution.
-
setTaskExecuted
public void setTaskExecuted(String taskKey, boolean executed)
Description copied from interface:NotificationManagerSet execution state of NotificationTask with provided id.- Specified by:
setTaskExecutedin interfaceNotificationManager- Parameters:
taskKey- task to be updatedexecuted- execution state
-
countExecutionsWithStatus
public long countExecutionsWithStatus(String taskKey, String status)
Description copied from interface:NotificationManagerCount the number of task executions of a given task with a given status.- Specified by:
countExecutionsWithStatusin interfaceNotificationManager- Parameters:
taskKey- taskstatus- status- Returns:
- number of task executions
-
-