com.jalios.jcms.alert
Class AlertManager

java.lang.Object
  extended by com.jalios.jcms.alert.AlertManager
All Implemented Interfaces:
AlertConstants, DBConstants, JaliosConstants, JPropertiesListener

public class AlertManager
extends Object
implements AlertConstants, JPropertiesListener, DBConstants, JaliosConstants


Field Summary
 
Fields inherited from interface com.jalios.jcms.alert.AlertConstants
HTML_MARKUP, MSG_PREFIX_PROP, NAME_PREFIX_PROP, TEXT_MARKUP, WIKI_MARKUP
 
Fields inherited from interface com.jalios.util.JPropertiesListener
REVISION
 
Fields inherited from interface com.jalios.jcms.db.DBConstants
ALL_CATEGORIES_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MDATE_FIELD, PSTATUS_FIELD, REVISION, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
 
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, REVISION
 
Method Summary
 void addAlertChannel(AlertChannel alertChannel)
          Adds the given AlertChannel
 AlertChannel getAlertChannel(String name)
          Returns the AlertChannel with the given name.
 List<AlertChannel> getAlertChannelList()
          Returns the list of all available AlertChannel.
 List<AlertChannel> getAlertChannelList(Member mbr)
          Returns the list of available AlertChannel for the given member.
 Set<AlertChannel> getAlertChannelSet(Alert alert)
          Returns the set of AlertChannel matching the given alert.
 int getAlertCount(Member mbr)
          Returns the count of Alert the given member is a recipient.
 List<Alert.Level> getAlertLevelList()
          Returns the list of Alert.Level.
 List<Alert> getAlertList(Member mbr)
          Returns the list of Alert the given member is a recipient.
 List<Alert> getAlertList(Member mbr, Alert.Level level, Boolean read)
          Returns the list of Alert the given member is a recipient.
 Set<AlertChannel> getDefaultAlertChannelSet()
          Returns the set of default AlertChannel.
static AlertManager getInstance()
           
 AlertChannel getMailAlertChannel()
          Returns the MailAlertChannel
 Alert.Level getMaxUnreadAlertLevel(Member mbr)
          Returns the highest alert level the given member is a recipient.
 List<Alert> getOldAlertList()
          Returns the list of old alerts.
 int getUnreadAlertCount(Member mbr)
          Returns the count of unread Alert the given member is a recipient.
 AlertChannel getWebAlertChannel()
          Returns the WebAlertChannel
 void invalidateCacheEntries(String mid)
          Invalidate the cache entries for the given member.
 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 removeAlertChannel(AlertChannel alertChannel)
          Removes the given AlertChannel
 void sendAlert(Alert alert)
          Send the given alert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static AlertManager getInstance()

propertiesChange

public void propertiesChange(JProperties properties)
Description copied from interface: JPropertiesListener
Invoked after properties have been modified in JCMS and save on disk.

You cannot alter the value received in parameters.

Specified by:
propertiesChange in interface JPropertiesListener
Parameters:
properties - the properties which have been modified (may not contain all JCMS properties)

addAlertChannel

public void addAlertChannel(AlertChannel alertChannel)
Adds the given AlertChannel

Parameters:
alertChannel - the AlertChannel to add
Since:
jcms-8.0.0

removeAlertChannel

public void removeAlertChannel(AlertChannel alertChannel)
Removes the given AlertChannel

Parameters:
alertChannel - the AlertChannel to remove
Since:
jcms-8.0.0

sendAlert

public void sendAlert(Alert alert)
Send the given alert

Parameters:
alert - the Alert
Since:
jcms-8.0.0

getAlertLevelList

public List<Alert.Level> getAlertLevelList()
Returns the list of Alert.Level.

Returns:
the list of Alert.Level.
Since:
jcms-8.0.0

getAlertChannel

public AlertChannel getAlertChannel(String name)
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

public AlertChannel getMailAlertChannel()
Returns the MailAlertChannel

Returns:
the MailAlertChannel
Since:
jcms-8.0.0

getWebAlertChannel

public AlertChannel getWebAlertChannel()
Returns the WebAlertChannel

Returns:
the WebAlertChannel
Since:
jcms-8.0.0

getAlertChannelList

public List<AlertChannel> getAlertChannelList()
Returns the list of all available AlertChannel.

Returns:
the list of all available AlertChannel.
Since:
jcms-8.0.0

getAlertChannelList

public List<AlertChannel> getAlertChannelList(Member mbr)
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

getDefaultAlertChannelSet

public Set<AlertChannel> getDefaultAlertChannelSet()
Returns the set of default AlertChannel.

Returns:
the set of default AlertChannel.
Since:
jcms-8.0.0

getAlertChannelSet

public Set<AlertChannel> getAlertChannelSet(Alert alert)
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

public List<Alert> getAlertList(Member mbr)
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

public List<Alert> getAlertList(Member mbr,
                                Alert.Level level,
                                Boolean read)
Returns the list of Alert the given member is a recipient.

Parameters:
mbr - the member
level - 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

public int getAlertCount(Member mbr)
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

getUnreadAlertCount

public int getUnreadAlertCount(Member mbr)
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

public Alert.Level getMaxUnreadAlertLevel(Member mbr)
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

public void markAsRead(Alert alert,
                       Member loggedMember)
Marks the given alert as read and updates it.

Parameters:
alert - the alert
loggedMember - the logged member
Since:
jcms-8.0.0

markAsUnread

public void markAsUnread(Alert alert,
                         Member loggedMember)
Marks the given alert as unread and updates it.

Parameters:
alert - the alert
loggedMember - the logged member
Since:
jcms-8.0.0

purgeAlerts

public void purgeAlerts()
Purge old alerts.

Since:
jcms-8.0.0

getOldAlertList

public List<Alert> getOldAlertList()
Returns the list of old alerts.

Returns:
the list of old alerts.
Since:
jcms-8.0.0

invalidateCacheEntries

public void invalidateCacheEntries(String mid)
Invalidate the cache entries for the given member.

Parameters:
mid - the member's id
Since:
jcms-8.0.0


Copyright © 2001-2010 Jalios SA. All Rights Reserved.