Class AMPManager

java.lang.Object
org.jivesoftware.smackx.amp.AMPManager

public class AMPManager extends 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
     
  • Method Summary

    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, 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 disabled
      enabled - 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 connection
      action - 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 connection
      conditionName - 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: