Package rocks.xmpp.extensions.amp.model
Class Rule
- java.lang.Object
-
- rocks.xmpp.extensions.amp.model.Rule
-
public final class Rule extends Object
The implementation of the<rule/>
element, used both in thehttp://jabber.org/protocol/amp
namespace as well as in thehttp://jabber.org/protocol/amp#errors
namespace.This class is immutable.
- See Also:
- XEP-0079: Advanced Message Processing, XML Schema
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Rule.Action
The action defines what occurs when a particular rule is triggered.static class
Rule.Condition
The condition defines how or when a particular rule is triggered.static class
Rule.DeliveryMode
The possible values for theRule.Condition.DELIVER
condition.static class
Rule.MatchResource
The possible values for theRule.Condition.MATCH_RESOURCE
condition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Rule
deliver(Rule.Action action, Rule.DeliveryMode value)
Creates the defined "deliver" rule.static Rule
expireAt(Rule.Action action, Instant instant)
Creates the defined "expire-at" rule.Rule.Action
getAction()
The 'action' attribute defines the result for this rule.Rule.Condition
getCondition()
The 'condition' attribute defines the overall condition this rule applies to.String
getValue()
The 'value' attribute defines how the condition is matched.static Rule
matchResource(Rule.Action action, Rule.MatchResource value)
Creates the defined "match-resource" rule.static Rule
of(Rule.Action action, Rule.Condition condition, String value)
Creates a rule.
-
-
-
Method Detail
-
of
public static Rule of(Rule.Action action, Rule.Condition condition, String value)
Creates a rule.- Parameters:
action
- The action.condition
- The condition.value
- The value. This depends on the condition.- Returns:
- The rule.
-
expireAt
public static Rule expireAt(Rule.Action action, Instant instant)
Creates the defined "expire-at" rule.- Parameters:
action
- The action.instant
- The expiration date.- Returns:
- The rule.
-
deliver
public static Rule deliver(Rule.Action action, Rule.DeliveryMode value)
Creates the defined "deliver" rule.- Parameters:
action
- The action.value
- The value.- Returns:
- The rule.
-
matchResource
public static Rule matchResource(Rule.Action action, Rule.MatchResource value)
Creates the defined "match-resource" rule.- Parameters:
action
- The action.value
- The value.- Returns:
- The rule.
-
getAction
public final Rule.Action getAction()
The 'action' attribute defines the result for this rule.- Returns:
- The action.
-
getCondition
public final Rule.Condition getCondition()
The 'condition' attribute defines the overall condition this rule applies to.- Returns:
- The condition.
-
getValue
public final String getValue()
The 'value' attribute defines how the condition is matched.- Returns:
- The value.
-
-