public class AMPManager extends Object
Constructor and Description |
---|
AMPManager() |
Modifier and Type | Method and Description |
---|---|
static 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.
|
public AMPManager()
public static void setServiceEnabled(XMPPConnection connection, boolean enabled)
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.
connection
- the connection where the service will be enabled or disabledenabled
- indicates if the service will be enabled or disabledpublic static boolean isServiceEnabled(XMPPConnection connection)
connection
- the connection to look for AMP supportpublic static boolean isActionSupported(XMPPConnection connection, AMPExtension.Action action) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
connection
- active xmpp connectionaction
- action to checkXMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public static boolean isConditionSupported(XMPPConnection connection, String conditionName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
connection
- active xmpp connectionconditionName
- name of condition to checkXMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
AMPDeliverCondition
,
AMPExpireAtCondition
,
AMPMatchResourceCondition