|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.NotificationManager
public class NotificationManager
This class is instantiated by a 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.
Field Summary | |
---|---|
protected AlarmManager |
alarmMgr
|
static String |
CHANGES
|
protected Channel |
channel
|
static int |
DAILY
|
protected AlarmEntry |
dayAlarmEntry
|
static 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 String[] |
PERIOD_LABELS
|
static int[] |
PERIODS_1
|
static int[] |
PERIODS_2
|
protected int |
reinit
Variable used to reinitialize the NotificationManager in case a PastDateException is thrown in initialization stage. |
static 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
|
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
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 Summary | |
---|---|
NotificationManager()
|
Method Summary | |
---|---|
static int[] |
getAvailableMutationTypes()
|
static int[] |
getAvailablePeriods()
|
static Set<NotificationCriteria> |
getGroupsCriteriaSet(Member member)
|
static String |
getMutationTypeLabel(int mutationType)
|
static NotificationCriteria[] |
getNotificationCriteria(Member member)
|
static String |
getPeriodLabel(int period)
Retrieve the property used to retrieve label of the specified period. |
static 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final 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 String[] PERIOD_LABELS
public static final String CHANGES
public static final String DELETIONS
protected int reinit
protected AlarmEntry minuteAlarmEntry
protected AlarmEntry hourAlarmEntry
protected AlarmEntry dayAlarmEntry
protected AlarmEntry weekAlarmEntry
protected AlarmEntry monthAlarmEntry
Constructor Detail |
---|
public NotificationManager()
Method Detail |
---|
public void init()
public void processNotification(int period)
period
- The period typepublic static int[] getAvailablePeriods()
public static int[] getAvailableMutationTypes()
public static String[] getPeriodLabels()
public static String getPeriodLabel(int period)
period
- a period constant from : MINUTED
,
HOURLY
, DAILY
,
WEEKLY
or MONTHLY
public static String getMutationTypeLabel(int mutationType)
public static NotificationCriteria[] getNotificationCriteria(Member member)
public static Set<NotificationCriteria> getGroupsCriteriaSet(Member member)
public static boolean isDefault(Notification notification)
notification
-
public static boolean isDefault(NotificationCriteria[] criterias, int selectionCriteriaMode)
public static boolean isSameCriteria(NotificationCriteria[] criterias1, NotificationCriteria[] criterias2)
criterias1
- criterias2
-
public static boolean isSameCriteria(NotificationCriteria criteria1, NotificationCriteria criteria2)
criteria1
- criteria2
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |