Package com.jalios.jcms.alert
Class AlertManager
java.lang.Object
com.jalios.jcms.alert.AlertManager
- All Implemented Interfaces:
AlertConstants,DBConstants,JaliosConstants,JPropertiesListener
public class AlertManager
extends Object
implements AlertConstants, JPropertiesListener, DBConstants, JaliosConstants
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of Boolean context attribute passed tosendAlert(Alert, Map)to force sending alert to contact (default is to NOT send alert to contact)static final StringName of Boolean context attribute passed tosendAlert(Alert, Map)to force sending alert to disabled account (default is to NOT send alert to disabled account)static final Stringstatic final Stringstatic final StringFields inherited from interface com.jalios.jcms.alert.AlertConstants
ALERT_META_INFO_ATTRIBUTE, CTXT_DELETE_ALERT, HTML_MARKUP, MSG_PREFIX_PROP, NAME_PREFIX_PROP, NO_ALERT_FLAG, TEXT_MARKUP, WIKI_MARKUPFields inherited from interface com.jalios.jcms.db.DBConstants
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, CLASSIFICATION_LEVEL_FIELD, DBDATA_URID, EXTENDED_READ_RIGHTS, 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_OPAUTHOR, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READ_ACK, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_RESTRICTIVE_UPDATE_RIGHTS, 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, OPAUTHOR_ID_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELDFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlertChannel(AlertChannel alertChannel) Adds the given AlertChannelvoiddeleteAlerts(Data data) Deletes all alerts on given datagetAlertChannel(String name) Returns the AlertChannel with the given name.Returns the list of all available AlertChannel.Returns the list of available AlertChannel for the given member.getAlertChannelSet(Alert alert) Returns the set of AlertChannel matching the given alert.intgetAlertCount(Data data) Returns the count of Alert on the given dataintgetAlertCount(Member mbr) Returns the count of Alert the given member is a recipient.Returns the list of Alert.Level.getAlertList(Data data) Returns the list of Alert on the given datagetAlertList(Data data, Member mbr) Returns the list of Alert on the given data for given MembergetAlertList(Member mbr) Returns the list of Alert the given member is a recipient.getAlertList(Member mbr, Alert.Level level, Boolean read) Returns the list of Alert the given member is a recipient.intReturns the alert refresh interval in msReturns all the alerts with an expiration date.static AlertManagerReturns the MailAlertChannelintReturns the max alerts to send with the same transaction.Returns the highest alert level the given member is a recipient.getMemberAlertSettings(Member member) Returns the member's Alert preferences.getPubOrParentPub(Alert alert) For an alert, we search if the publication type has been declared directly, or if we need to use the parent publicationintReturns the count of unread Alert the given member is a recipient.Returns the WebAlertChannelvoidvoidInvalidate the cache entries for the given member.booleanIndication of an alert being processed by mail alert channel.voidmarkAllRelatedAlertAsRead(Alert alert, Member mbr) Mark all related alerts for given Alert as read (Where alert data is the same)voidmarkAllUnreadAsRead(Member loggedMember) Marks all member's unread alerts as read.voidmarkAsRead(Alert alert, Member loggedMember) Marks the given alert as read and updates it.voidmarkAsUnread(Alert alert, Member loggedMember) Marks the given alert as unread and updates it.voidpropertiesChange(JProperties properties) Invoked after properties have been modified in JCMS and save on disk.voidPurge old alerts.voidregisterExpiration(Alert alert) Register this alert for expiration (if it has an expiration date).voidremoveAlertChannel(AlertChannel alertChannel) Removes the given AlertChannelvoidsaveMemberAlertSettings(Member member, MemberAlertSettings settings) Saves the member's Alert preferences.voidSend the given alert.voidSend the given alert (if possible).voidunregisterExpiration(Alert alert) Unregister this alert from the expiration alarm manager (if it has been registered).
-
Field Details
-
RETRIEVE_PARENT_PROP_PREFIX
- See Also:
-
MARK_ALL_DATA_READ_DOMAIN_EXCEPTION_PROP_PREFIX
- See Also:
-
UNFOLLOWABLE_DOMAIN_AND_NAME_PROP
- See Also:
-
ALERT_SEND_TO_DISABLED_ACCOUNT
Name of Boolean context attribute passed tosendAlert(Alert, Map)to force sending alert to disabled account (default is to NOT send alert to disabled account)- Since:
- 10.0.7 / JCMS-9426
- See Also:
-
ALERT_SEND_TO_CONTACT
Name of Boolean context attribute passed tosendAlert(Alert, Map)to force sending alert to contact (default is to NOT send alert to contact)- Since:
- 10.0.7 / JCMS-9426
- See Also:
-
-
Method Details
-
getInstance
-
getDefaultAlertRuleSet
-
initExpirations
public void initExpirations() -
registerExpiration
Register this alert for expiration (if it has an expiration date).- Parameters:
alert- the alert.- Since:
- jcms-9.0.0
-
unregisterExpiration
Unregister this alert from the expiration alarm manager (if it has been registered).- Parameters:
alert- the alert.- Since:
- jcms-9.0.0
-
propertiesChange
Description copied from interface:JPropertiesListenerInvoked after properties have been modified in JCMS and save on disk.You cannot alter the value received in parameters.
Note that properties parameter may be null, a limited set of site properties, or all site properties.
To check that a property has been modified, reload the "current" property instead using
channel.getPropertiesorchannel.getProperty.- Specified by:
propertiesChangein interfaceJPropertiesListener- Parameters:
properties- the properties which have been submitted to change
-
addAlertChannel
Adds the given AlertChannel- Parameters:
alertChannel- the AlertChannel to add- Since:
- jcms-8.0.0
-
removeAlertChannel
Removes the given AlertChannel- Parameters:
alertChannel- the AlertChannel to remove- Since:
- jcms-8.0.0
-
sendAlert
Send the given alert.- Parameters:
alert- the Alert- Since:
- jcms-8.0.0
- See Also:
-
sendAlert
Send the given alert (if possible).- Parameters:
alert- the Alertcontext- an optional context map used to retrieve other informations to use before/during sending, and propagated toalert.checkIntegrity(...)andalert.performCreate(...)methods- Since:
- 10.0.7 / JCMS-9426
-
getAlertLevelList
Returns the list of Alert.Level.- Returns:
- the list of Alert.Level.
- Since:
- jcms-8.0.0
-
getAlertChannel
Returns the AlertChannel with the given name.- Parameters:
name- the name of the AlertChannel- Returns:
- the AlertChannel with the given name.
- Since:
- jcms-8.0.0
-
getMailAlertChannel
Returns the MailAlertChannel- Returns:
- the MailAlertChannel
- Since:
- jcms-8.0.0
-
isMailSendingThread
public boolean isMailSendingThread()Indication of an alert being processed by mail alert channel.- Returns:
- true when an alert is currently being sent as an email.
- Since:
- jcms-11.0.0
-
getWebAlertChannel
Returns the WebAlertChannel- Returns:
- the WebAlertChannel
- Since:
- jcms-8.0.0
-
getAlertChannelList
Returns the list of all available AlertChannel.- Returns:
- the list of all available AlertChannel.
- Since:
- jcms-8.0.0
-
getAlertChannelList
Returns the list of available AlertChannel for the given member.- Parameters:
mbr- the member- Returns:
- the list of available AlertChannel for the given member.
- Since:
- jcms-8.0.0
-
getAlertChannelSet
Returns the set of AlertChannel matching the given alert.- Parameters:
alert- the alert- Returns:
- the set of AlertChannel matching the given alert.
- Since:
- jcms-8.0.0
-
getAlertList
Returns the list of Alert the given member is a recipient.- Parameters:
mbr- the member- Returns:
- the list of Alert the given member is a recipient.
- Since:
- jcms-8.0.0
-
getAlertList
Returns the list of Alert on the given data- Parameters:
data- the data- Returns:
- the list of Alert on the given data
- Since:
- jcms-8.0.1
-
getAlertList
Returns the list of Alert on the given data for given Member- Parameters:
data- the datambr- the member- Returns:
- the list of Alert on the given data for given Member
- Since:
- jcms-10.0.2
-
getAlertList
Returns the list of Alert the given member is a recipient.- Parameters:
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.- Returns:
- the list of Alert the given member is a recipient.
- Since:
- jcms-8.0.0
-
getAlertCount
Returns the count of Alert the given member is a recipient.- Parameters:
mbr- the member- Returns:
- the count of Alert the given member is a recipient.
- Since:
- jcms-8.0.0
-
getAlertCount
Returns the count of Alert on the given data- Parameters:
data- the data- Returns:
- the count of Alert on the given data
- Since:
- jcms-8.0.1
-
getUnreadAlertCount
Returns the count of unread Alert the given member is a recipient.- Parameters:
mbr- the member- Returns:
- the count of unread Alert the given member is a recipient.
- Since:
- jcms-8.0.0
-
getMaxUnreadAlertLevel
Returns the highest alert level the given member is a recipient.- Parameters:
mbr- the member- Returns:
- the highest alert level the given member is a recipient.
- Since:
- jcms-8.0.0
-
markAsRead
Marks the given alert as read and updates it.- Parameters:
alert- the alertloggedMember- the logged member- Since:
- jcms-8.0.0
-
getPubOrParentPub
For an alert, we search if the publication type has been declared directly, or if we need to use the parent publication- Parameters:
alert- theAlert- Returns:
- the
Publicationor its parentPublication - Since:
- jcms-10.0.2
-
markAllRelatedAlertAsRead
Mark all related alerts for given Alert as read (Where alert data is the same) -
markAsUnread
Marks the given alert as unread and updates it.- Parameters:
alert- the alertloggedMember- the logged member- Since:
- jcms-8.0.0
-
markAllUnreadAsRead
Marks all member's unread alerts as read.- Parameters:
loggedMember- the logged member- Since:
- jcms-10.0.0
-
deleteAlerts
Deletes all alerts on given data- Parameters:
data- the data- Since:
- jcms-8.0.1
-
purgeAlerts
public void purgeAlerts()Purge old alerts.- Since:
- jcms-8.0.0
-
getExpirationAlertList
Returns all the alerts with an expiration date.- Returns:
- all the alerts with an expiration date.
- Since:
- jcms-9.0.0
-
invalidateCacheEntries
Invalidate the cache entries for the given member.- Parameters:
mid- the member's id- Since:
- jcms-8.0.0
-
getMaxAlertPerTransaction
public int getMaxAlertPerTransaction()Returns the max alerts to send with the same transaction.- Returns:
- the max alerts to send with the same transaction.
- Since:
- jcms-8.0.3
-
getAlertRefreshInterval
public int getAlertRefreshInterval()Returns the alert refresh interval in ms- Returns:
- the alert refresh interval in ms
- Since:
- jcms-10.0.0
-
saveMemberAlertSettings
Saves the member's Alert preferences.- Parameters:
member- the member to save its alert's preferences.settings- the settings to save- Since:
- jcms-10.0.1
-
getMemberAlertSettings
Returns the member's Alert preferences.- Parameters:
member- the member to get its alert's preferences.- Returns:
MemberAlertSettings- Since:
- jcms-10.0.1
-
getScoringScale
-