Package org.jivesoftware.smackx.amp
Class AMPManager
- java.lang.Object
-
- org.jivesoftware.smackx.amp.AMPManager
-
public class AMPManager extends java.lang.Object
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 Constructor Description AMPManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isActionSupported(org.jivesoftware.smack.XMPPConnection connection, AMPExtension.Action action)
Check if server supports specified action.static boolean
isConditionSupported(org.jivesoftware.smack.XMPPConnection connection, java.lang.String conditionName)
Check if server supports specified condition.static boolean
isServiceEnabled(org.jivesoftware.smack.XMPPConnection connection)
Returns true if the AMP support is enabled for the given connection.static void
setServiceEnabled(org.jivesoftware.smack.XMPPConnection connection, boolean enabled)
Enables or disables the AMP support on a given connection.
-
-
-
Method Detail
-
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, java.lang.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.java.lang.InterruptedException
- if the calling thread was interrupted.
-
isConditionSupported
public static boolean isConditionSupported(org.jivesoftware.smack.XMPPConnection connection, java.lang.String conditionName) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.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.java.lang.InterruptedException
- if the calling thread was interrupted.- See Also:
AMPDeliverCondition
,AMPExpireAtCondition
,AMPMatchResourceCondition
-
-