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(XMPPConnection connection, AMPExtension.Action action)
Check if server supports specified action.static boolean
isConditionSupported(XMPPConnection connection, java.lang.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 Detail
-
AMPManager
public AMPManager()
-
-
Method Detail
-
setServiceEnabled
public static void setServiceEnabled(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(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(XMPPConnection connection, AMPExtension.Action action) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, 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:
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.java.lang.InterruptedException
- if the calling thread was interrupted.
-
isConditionSupported
public static boolean isConditionSupported(XMPPConnection connection, java.lang.String conditionName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, 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:
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.java.lang.InterruptedException
- if the calling thread was interrupted.- See Also:
AMPDeliverCondition
,AMPExpireAtCondition
,AMPMatchResourceCondition
-
-