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
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isActionSupported
(XMPPConnection connection, AMPExtension.Action action) Check if server supports specified action.static boolean
isConditionSupported
(XMPPConnection connection, String conditionName) Check if server supports specified condition.static boolean
isServiceEnabled
(XMPPConnection connection) Returns true if the AMP support is enabled for the given connection.static void
setServiceEnabled
(XMPPConnection connection, boolean enabled) Enables or disables the AMP support on a given connection.
-
Constructor Details
-
AMPManager
public AMPManager()
-
-
Method Details
-
setServiceEnabled
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
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(XMPPConnection connection, AMPExtension.Action action) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, 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:
XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NoResponseException
- if there was no response from the remote entity.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
isConditionSupported
public static boolean isConditionSupported(XMPPConnection connection, String conditionName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, 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:
XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NoResponseException
- if there was no response from the remote entity.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.- See Also:
-