public class AlertManager extends java.lang.Object implements AlertConstants, JPropertiesListener, DBConstants, JaliosConstants
CTXT_DELETE_ALERT, HTML_MARKUP, MSG_PREFIX_PROP, NAME_PREFIX_PROP, TEXT_MARKUP, WIKI_MARKUP
REVISION
ALL_CATEGORIES_SET_FIELD, ATTACH_WS_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_ATTACH_WS_FIELD, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HAS_ATTACH_WS, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAININSTANCE_ID, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MERGE_DATE, HIBERNATE_MAPPING_MERGE_ID, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_TRACKED, HIBERNATE_MAPPING_UDATE, HIBERNATE_MAPPING_VOTECOUNT, HIBERNATE_MAPPING_VOTESCORE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MAX_HIBERNATE_MAPPING_PUBLICATION, MDATE_FIELD, PSTATUS_FIELD, REVISION, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
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, REVISION
Modifier and Type | Method and Description |
---|---|
void |
addAlertChannel(AlertChannel alertChannel)
Adds the given AlertChannel
|
void |
deleteAlerts(Data data)
Deletes all alerts on given data
|
AlertChannel |
getAlertChannel(java.lang.String name)
Returns the AlertChannel with the given name.
|
java.util.List<AlertChannel> |
getAlertChannelList()
Returns the list of all available AlertChannel.
|
java.util.List<AlertChannel> |
getAlertChannelList(Member mbr)
Returns the list of available AlertChannel for the given member.
|
java.util.Set<AlertChannel> |
getAlertChannelSet(Alert alert)
Returns the set of AlertChannel matching the given alert.
|
int |
getAlertCount(Data data)
Returns the count of Alert on the given data
|
int |
getAlertCount(Member mbr)
Returns the count of Alert the given member is a recipient.
|
java.util.List<Alert.Level> |
getAlertLevelList()
Returns the list of Alert.Level.
|
java.util.List<Alert> |
getAlertList(Data data)
Returns the list of Alert on the given data
|
java.util.List<Alert> |
getAlertList(Member mbr)
Returns the list of Alert the given member is a recipient.
|
java.util.List<Alert> |
getAlertList(Member mbr,
Alert.Level level,
java.lang.Boolean read)
Returns the list of Alert the given member is a recipient.
|
int |
getAlertRefreshInterval()
Returns the alert refresh interval in ms
|
java.util.Set<AlertRule> |
getDefaultAlertRuleSet() |
java.util.List<Alert> |
getExpirationAlertList()
Returns all the alerts with an expiration date.
|
static AlertManager |
getInstance() |
AlertChannel |
getMailAlertChannel()
Returns the MailAlertChannel
|
int |
getMaxAlertPerTransaction()
Returns the max alerts to send with the same transaction.
|
Alert.Level |
getMaxUnreadAlertLevel(Member mbr)
Returns the highest alert level the given member is a recipient.
|
MemberAlertSettings |
getMemberAlertSettings(Member member)
Returns the member's Alert preferences.
|
int |
getUnreadAlertCount(Member mbr)
Returns the count of unread Alert the given member is a recipient.
|
AlertChannel |
getWebAlertChannel()
Returns the WebAlertChannel
|
void |
initExpirations() |
void |
invalidateCacheEntries(java.lang.String mid)
Invalidate the cache entries for the given member.
|
void |
markAllUnreadAsRead(Member loggedMember)
Marks all member's unread alerts as read.
|
void |
markAsRead(Alert alert,
Member loggedMember)
Marks the given alert as read and updates it.
|
void |
markAsUnread(Alert alert,
Member loggedMember)
Marks the given alert as unread and updates it.
|
void |
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.
|
void |
purgeAlerts()
Purge old alerts.
|
void |
registerExpiration(Alert alert)
Register this alert for expiration (if it has an expiration date).
|
void |
removeAlertChannel(AlertChannel alertChannel)
Removes the given AlertChannel
|
void |
saveMemberAlertSettings(Member member,
MemberAlertSettings settings)
Saves the member's Alert preferences.
|
void |
sendAlert(Alert alert)
Send the given alert
|
void |
unregisterExpiration(Alert alert)
Unregister this alert from the expiration alarm manager (if it has been registered).
|
public static AlertManager getInstance()
public java.util.Set<AlertRule> getDefaultAlertRuleSet()
public void initExpirations()
public void registerExpiration(Alert alert)
alert
- the alert.public void unregisterExpiration(Alert alert)
alert
- the alert.public void propertiesChange(JProperties properties)
JPropertiesListener
You cannot alter the value received in parameters.
propertiesChange
in interface JPropertiesListener
properties
- the properties which have been modified (may not contain all JCMS properties)public void addAlertChannel(AlertChannel alertChannel)
alertChannel
- the AlertChannel to addpublic void removeAlertChannel(AlertChannel alertChannel)
alertChannel
- the AlertChannel to removepublic void sendAlert(Alert alert)
alert
- the Alertpublic java.util.List<Alert.Level> getAlertLevelList()
public AlertChannel getAlertChannel(java.lang.String name)
name
- the name of the AlertChannelpublic AlertChannel getMailAlertChannel()
public AlertChannel getWebAlertChannel()
public java.util.List<AlertChannel> getAlertChannelList()
public java.util.List<AlertChannel> getAlertChannelList(Member mbr)
mbr
- the memberpublic java.util.Set<AlertChannel> getAlertChannelSet(Alert alert)
alert
- the alertpublic java.util.List<Alert> getAlertList(Member mbr)
mbr
- the memberpublic java.util.List<Alert> getAlertList(Data data)
data
- the datapublic java.util.List<Alert> getAlertList(Member mbr, Alert.Level level, java.lang.Boolean read)
mbr
- the memberlevel
- the alert level. Null means any level.read
- true for read alerts, false for not read alerts, null for read or not read alerts.public int getAlertCount(Member mbr)
mbr
- the memberpublic int getAlertCount(Data data)
data
- the datapublic int getUnreadAlertCount(Member mbr)
mbr
- the memberpublic Alert.Level getMaxUnreadAlertLevel(Member mbr)
mbr
- the memberpublic void markAsRead(Alert alert, Member loggedMember)
alert
- the alertloggedMember
- the logged memberpublic void markAsUnread(Alert alert, Member loggedMember)
alert
- the alertloggedMember
- the logged memberpublic void markAllUnreadAsRead(Member loggedMember)
loggedMember
- the logged memberpublic void deleteAlerts(Data data)
data
- the datapublic void purgeAlerts()
public java.util.List<Alert> getExpirationAlertList()
public void invalidateCacheEntries(java.lang.String mid)
mid
- the member's idpublic int getMaxAlertPerTransaction()
public int getAlertRefreshInterval()
public void saveMemberAlertSettings(Member member, MemberAlertSettings settings)
member
- the member to save its alert's preferences.settings
- the settings to savepublic MemberAlertSettings getMemberAlertSettings(Member member)
member
- the member to get its alert's preferences.MemberAlertSettings
Copyright © 2001-2018 Jalios SA. All Rights Reserved.