com.jalios.jcms.alert
Class AlertRule

java.lang.Object
  extended by com.jalios.jcms.alert.AlertRule
All Implemented Interfaces:
AlertConstants, Comparable

public class AlertRule
extends Object
implements AlertConstants, Comparable


Field Summary
 
Fields inherited from interface com.jalios.jcms.alert.AlertConstants
HTML_MARKUP, MSG_PREFIX_PROP, NAME_PREFIX_PROP, TEXT_MARKUP, WIKI_MARKUP
 
Constructor Summary
AlertRule()
           
 
Method Summary
 int compareTo(Object obj)
           
 boolean containsAlertChannel(AlertChannel alertChannel)
          Returns true if this AlertRule contains the given alertChannel.
 boolean equals(Object obj)
           
static AlertRule fromJSON(String json)
           
 String[] getAlertChannels()
           
 Set<AlertChannel> getAlertChannelSet()
           
 String getAlertFullName()
          Returns the full name (i.e. domain + "." + name) of the alert type of this AlertRule.
 String getAlertLabel(String userLang)
          Returns the label of the alert type of this AlertRule.
static Set<AlertRule> getAlertRuleSet(String json)
           
 String getDomain()
           
 Alert.Level getLevel()
           
 String getLevelKey()
           
 String getName()
           
 boolean isEmpty()
          Returns true if this AlertRule is empty (i.e. no level, no domain and no alert channel).
 boolean matches(Alert alert)
          Returns true if the given alert match this rule.
 boolean notEmpty()
          Returns true if this AlertRule is not empty (i.e. a level, a domain or an alert channel).
 void setAlertChannels(String[] alertChannels)
           
 void setAlertChannelSet(Set<AlertChannel> alertChannelSet)
           
 void setDomain(String domain)
           
 void setLevel(Alert.Level level)
           
 void setLevelKey(String key)
           
 void setName(String name)
           
 String toJSON()
           
static String toJSON(Set<AlertRule> ruleSet)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlertRule

public AlertRule()
Method Detail

matches

public boolean matches(Alert alert)
Returns true if the given alert match this rule.

Parameters:
alert - the alert
Returns:
true if the given alert match this rule.
Since:
jcms-8.0.0

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getLevel

public Alert.Level getLevel()

setLevel

public void setLevel(Alert.Level level)

getLevelKey

public String getLevelKey()

setLevelKey

public void setLevelKey(String key)

getDomain

public String getDomain()

setDomain

public void setDomain(String domain)

getName

public String getName()

setName

public void setName(String name)

getAlertChannelSet

public Set<AlertChannel> getAlertChannelSet()

setAlertChannelSet

public void setAlertChannelSet(Set<AlertChannel> alertChannelSet)

getAlertChannels

public String[] getAlertChannels()

setAlertChannels

public void setAlertChannels(String[] alertChannels)

isEmpty

public boolean isEmpty()
Returns true if this AlertRule is empty (i.e. no level, no domain and no alert channel).

Returns:
true if this AlertRule is empty (i.e. no level, no domain and no alert channel).
Since:
jcms-8.0.0

notEmpty

public boolean notEmpty()
Returns true if this AlertRule is not empty (i.e. a level, a domain or an alert channel).

Returns:
true if this AlertRule is not empty (i.e. a level, a domain or an alert channel).
Since:
jcms-8.0.0

containsAlertChannel

public boolean containsAlertChannel(AlertChannel alertChannel)
Returns true if this AlertRule contains the given alertChannel.

Parameters:
alertChannel - the alertChannel
Returns:
true if this AlertRule contains the given alertChannel.
Since:
jcms-8.0.0

getAlertFullName

public String getAlertFullName()
Returns the full name (i.e. domain + "." + name) of the alert type of this AlertRule.

Returns:
the full name (i.e. domain + "." + name) of the alert type of this AlertRule.
Since:
jcms-8.0.0

getAlertLabel

public String getAlertLabel(String userLang)
Returns the label of the alert type of this AlertRule.

Parameters:
userLang - the user language
Returns:
the label of the alert type of this AlertRule.
Since:
jcms-8.0.0

toString

public String toString()
Overrides:
toString in class Object

toJSON

public String toJSON()

toJSON

public static String toJSON(Set<AlertRule> ruleSet)

getAlertRuleSet

public static Set<AlertRule> getAlertRuleSet(String json)

fromJSON

public static AlertRule fromJSON(String json)


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