public class AMPExtension extends Object implements ExtensionElement
Modifier and Type | Class and Description |
---|---|
static class |
AMPExtension.Action
amp action attribute.
|
static interface |
AMPExtension.Condition
Interface for defining XEP-0079 Conditions and their values.
|
static class |
AMPExtension.Rule
XEP-0079 Rule element.
|
static class |
AMPExtension.Status
amp notification status as defined by XEP-0079.
|
Modifier and Type | Field and Description |
---|---|
static String |
ELEMENT |
static String |
NAMESPACE |
Constructor and Description |
---|
AMPExtension()
Create a new amp request extension to be used with outgoing message.
|
AMPExtension(String from,
String to,
AMPExtension.Status status)
Create a new AMPExtension instance with defined from, to and status attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
addRule(AMPExtension.Rule rule)
Adds a rule to the amp element.
|
String |
getElementName()
Returns the XML element name of the extension sub-packet root element.
|
String |
getFrom()
Get the JID that triggered this AMP callback.
|
String |
getNamespace()
Returns the XML namespace of the extension sub-packet root element.
|
List<AMPExtension.Rule> |
getRules()
Returns a unmodifiable List of the rules in the packet.
|
int |
getRulesCount()
Returns a count of the rules in the AMP packet.
|
AMPExtension.Status |
getStatus()
Status of this amp notification.
|
String |
getTo()
Get the receiver of this AMP receipt.
|
boolean |
isPerHop()
Returns true is this ruleset is "per-hop".
|
void |
setPerHop(boolean enabled)
Sets this amp ruleset to be "per-hop".
|
String |
toXML(String enclosingNamespace)
Returns the XML representation of a XHTML extension according the specification.
|
public static final String NAMESPACE
public static final String ELEMENT
public AMPExtension(String from, String to, AMPExtension.Status status)
from
- jid that triggered this amp callback.to
- receiver of this amp receipt.status
- status of this amp receipt.public AMPExtension()
public String getFrom()
public String getTo()
public AMPExtension.Status getStatus()
public List<AMPExtension.Rule> getRules()
public void addRule(AMPExtension.Rule rule)
rule
- the rule to add.public int getRulesCount()
public void setPerHop(boolean enabled)
enabled
- true if "per-hop" should be enabledpublic boolean isPerHop()
public String getElementName()
getElementName
in interface NamedElement
public String getNamespace()
getNamespace
in interface ExtensionElement