Class AMPExtension
java.lang.Object
org.jivesoftware.smackx.amp.packet.AMPExtension
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.ExtensionElement,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlElement,org.jivesoftware.smack.packet.XmlLangElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumamp action attribute.static interfaceInterface for defining XEP-0079 Conditions and their values.static classXEP-0079 Rule element.static enumamp notification status as defined by XEP-0079. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate 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. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRule(AMPExtension.Rule rule) Adds a rule to the amp element.Returns the XML element name of the extension sub-packet root element.getFrom()Get the JID that triggered this AMP callback.Returns the XML namespace of the extension sub-packet root element.getRules()Returns a unmodifiable List of the rules in the packet.intReturns a count of the rules in the AMP packet.Status of this amp notification.getTo()Get the receiver of this AMP receipt.booleanisPerHop()Returns true is this ruleset is "per-hop".voidsetPerHop(boolean enabled) Sets this amp ruleset to be "per-hop".toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) Returns the XML representation of a XHTML extension according the specification.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.Element
toXML, toXMLMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
NAMESPACE
- See Also:
-
ELEMENT
- See Also:
-
-
Constructor Details
-
AMPExtension
Create a new AMPExtension instance with defined from, to and status attributes. Used to create incoming packets.- Parameters:
from- jid that triggered this amp callback.to- receiver of this amp receipt.status- status of this amp receipt.
-
AMPExtension
public AMPExtension()Create a new amp request extension to be used with outgoing message.
-
-
Method Details
-
getFrom
Get the JID that triggered this AMP callback.- Returns:
- jid that triggered this amp callback.
-
getTo
Get the receiver of this AMP receipt.- Returns:
- receiver of this amp receipt.
-
getStatus
Status of this amp notification.- Returns:
- Status for this amp
-
getRules
Returns a unmodifiable List of the rules in the packet.- Returns:
- a unmodifiable List of the rules in the packet.
-
addRule
Adds a rule to the amp element. Amp can have any number of rules.- Parameters:
rule- the rule to add.
-
getRulesCount
public int getRulesCount()Returns a count of the rules in the AMP packet.- Returns:
- the number of rules in the AMP packet.
-
setPerHop
public void setPerHop(boolean enabled) Sets this amp ruleset to be "per-hop".- Parameters:
enabled- true if "per-hop" should be enabled
-
isPerHop
public boolean isPerHop()Returns true is this ruleset is "per-hop".- Returns:
- true is this ruleset is "per-hop".
-
getElementName
Returns the XML element name of the extension sub-packet root element. Always returns "amp"- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement- Returns:
- the XML element name of the stanza extension.
-
getNamespace
Returns the XML namespace of the extension sub-packet root element. According the specification the namespace is always "http://jabber.org/protocol/xhtml-im"- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.XmlElement- Returns:
- the XML namespace of the stanza extension.
-
toXML
Returns the XML representation of a XHTML extension according the specification.- Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-