public class NotificationManager extends java.lang.Object implements JcmsConstants
Channel
in method initAfterLoad()
only if property 'notification.enabled' is set to true.
The NotificationManager
handles 4 alarms, one per hour, one per
day, one per week, one per month. A single AlarmManager listens to these alarms and launches notifications
threads (@see NotificationThread) each time an alarm is fired.
CAUTION: NotificationThread checks the server is not 127.0.0.1 nor localhost, to avoid emails
being sent by mistake while staging.Modifier and Type | Field and Description |
---|---|
protected AlarmManager |
alarmMgr |
static java.lang.String |
CHANGES |
protected Channel |
channel |
static int |
DAILY |
protected AlarmEntry |
dayAlarmEntry |
static java.lang.String |
DELETIONS |
protected AlarmEntry |
hourAlarmEntry |
static int |
HOURLY |
protected AlarmEntry |
minuteAlarmEntry |
static int |
MINUTED |
protected AlarmEntry |
monthAlarmEntry |
static int |
MONTHLY |
static int |
MUTATION_ALL |
static int |
MUTATION_CREATE |
static int |
MUTATION_MAJOR |
static int[] |
MUTATION_TYPES |
static java.lang.String[] |
PERIOD_LABELS |
static int[] |
PERIODS_1 |
static int[] |
PERIODS_2 |
static java.lang.String |
PUBCOUNT |
protected int |
reinit
Variable used to reinitialize the NotificationManager in case a PastDateException is thrown in
initialization stage.
|
static java.lang.String |
REVISION |
static int |
USE_CRITERIA_GROUP_AND_MEMBER |
static int |
USE_CRITERIA_GROUP_ONLY |
static int |
USE_CRITERIA_MEMBER_ONLY |
protected AlarmEntry |
weekAlarmEntry |
static int |
WEEKLY |
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Constructor and Description |
---|
NotificationManager() |
Modifier and Type | Method and Description |
---|---|
static int[] |
getAvailableMutationTypes() |
static int[] |
getAvailablePeriods() |
static java.util.List |
getFollowedTypeList(java.lang.String userLang)
Returns the list of types that can be selected for NotificationCriteria
|
static java.util.Set<NotificationCriteria> |
getGroupsCriteriaSet(Member member) |
static java.lang.String |
getMutationTypeLabel(int mutationType) |
static NotificationCriteria[] |
getNotificationCriteria(Member member) |
static java.lang.String |
getNotificationMailSubject(Member mbr) |
static java.lang.String |
getPeriodLabel(int period)
Retrieve the property used to retrieve label of the specified period.
|
static java.lang.String[] |
getPeriodLabels() |
void |
init() |
static boolean |
isDefault(Notification notification)
Tell if the given notification is equivalent to no notification at all.
|
static boolean |
isDefault(NotificationCriteria[] criterias,
int selectionCriteriaMode) |
static boolean |
isSameCriteria(NotificationCriteria[] criterias1,
NotificationCriteria[] criterias2)
Compares two arrays of NotificationCriteria
|
static boolean |
isSameCriteria(NotificationCriteria criteria1,
NotificationCriteria criteria2)
Compares two NotificationCriteria
|
void |
processNotification(int period)
Launches a thread that notifies all members who have requested
to be alerted of specific changes at each period.
|
public static final java.lang.String REVISION
protected AlarmManager alarmMgr
protected Channel channel
public static final int USE_CRITERIA_GROUP_AND_MEMBER
public static final int USE_CRITERIA_MEMBER_ONLY
public static final int USE_CRITERIA_GROUP_ONLY
public static final int HOURLY
public static final int DAILY
public static final int WEEKLY
public static final int MONTHLY
public static final int MINUTED
public static final int[] PERIODS_1
public static final int[] PERIODS_2
public static final int MUTATION_CREATE
public static final int MUTATION_MAJOR
public static final int MUTATION_ALL
public static final int[] MUTATION_TYPES
public static final java.lang.String[] PERIOD_LABELS
public static final java.lang.String CHANGES
public static final java.lang.String DELETIONS
public static final java.lang.String PUBCOUNT
protected int reinit
protected AlarmEntry minuteAlarmEntry
protected AlarmEntry hourAlarmEntry
protected AlarmEntry dayAlarmEntry
protected AlarmEntry weekAlarmEntry
protected AlarmEntry monthAlarmEntry
public void init()
public void processNotification(int period)
period
- The period typepublic static int[] getAvailablePeriods()
public static int[] getAvailableMutationTypes()
public static java.lang.String[] getPeriodLabels()
public static java.lang.String getPeriodLabel(int period)
public static java.lang.String getMutationTypeLabel(int mutationType)
public static NotificationCriteria[] getNotificationCriteria(Member member)
public static java.util.Set<NotificationCriteria> getGroupsCriteriaSet(Member member)
public static boolean isDefault(Notification notification)
notification
- the notificationpublic static boolean isDefault(NotificationCriteria[] criterias, int selectionCriteriaMode)
public static boolean isSameCriteria(NotificationCriteria[] criterias1, NotificationCriteria[] criterias2)
criterias1
- the first array of NotificationCriteriacriterias2
- the second array of NotificationCriteriapublic static boolean isSameCriteria(NotificationCriteria criteria1, NotificationCriteria criteria2)
criteria1
- the first NotificationCriteriacriteria2
- the second NotificationCriteriapublic static java.lang.String getNotificationMailSubject(Member mbr)
mbr
- the recipient Memberpublic static java.util.List getFollowedTypeList(java.lang.String userLang)
userLang
- the userLang (to sort types)Copyright © 2001-2010 Jalios SA. All Rights Reserved.