Package org.jivesoftware.smackx.amp
Class AMPManager
java.lang.Object
org.jivesoftware.smackx.amp.AMPManager
Manages AMP stanzas within messages. A AMPManager provides a high level access to
get and set AMP rules to messages.
See http://xmpp.org/extensions/xep-0079.html for AMP extension details
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisActionSupported(org.jivesoftware.smack.XMPPConnection connection, AMPExtension.Action action) Check if server supports specified action.static booleanisConditionSupported(org.jivesoftware.smack.XMPPConnection connection, String conditionName) Check if server supports specified condition.static booleanisServiceEnabled(org.jivesoftware.smack.XMPPConnection connection) Returns true if the AMP support is enabled for the given connection.static voidsetServiceEnabled(org.jivesoftware.smack.XMPPConnection connection, boolean enabled) Enables or disables the AMP support on a given connection.
-
Constructor Details
-
AMPManager
public AMPManager()
-
-
Method Details
-
setServiceEnabled
public static void setServiceEnabled(org.jivesoftware.smack.XMPPConnection connection, boolean enabled) Enables or disables the AMP support on a given connection.Before starting to send AMP messages to a user, check that the user can handle XHTML messages. Enable the AMP support to indicate that this client handles XHTML messages.
- Parameters:
connection- the connection where the service will be enabled or disabledenabled- indicates if the service will be enabled or disabled
-
isServiceEnabled
public static boolean isServiceEnabled(org.jivesoftware.smack.XMPPConnection connection) Returns true if the AMP support is enabled for the given connection.- Parameters:
connection- the connection to look for AMP support- Returns:
- a boolean indicating if the AMP support is enabled for the given connection
-
isActionSupported
public static boolean isActionSupported(org.jivesoftware.smack.XMPPConnection connection, AMPExtension.Action action) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException Check if server supports specified action.- Parameters:
connection- active xmpp connectionaction- action to check- Returns:
- true if this action is supported.
- Throws:
org.jivesoftware.smack.XMPPException.XMPPErrorException- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException- if there was no response from the remote entity.org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
isConditionSupported
public static boolean isConditionSupported(org.jivesoftware.smack.XMPPConnection connection, String conditionName) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedException Check if server supports specified condition.- Parameters:
connection- active xmpp connectionconditionName- name of condition to check- Returns:
- true if this condition is supported.
- Throws:
org.jivesoftware.smack.XMPPException.XMPPErrorException- if there was an XMPP error returned.org.jivesoftware.smack.SmackException.NoResponseException- if there was no response from the remote entity.org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.- See Also:
-