Class CarbonManager

    • Method Detail

      • setEnabledByDefault

        public static void setEnabledByDefault​(boolean enabledByDefault)
        Should Carbons be automatically be enabled once the connection is authenticated? Default: false
        Parameters:
        enabledByDefault - new default value
      • getInstanceFor

        public static CarbonManager getInstanceFor​(XMPPConnection connection)
        Obtain the CarbonManager responsible for a connection.
        Parameters:
        connection - the connection object.
        Returns:
        a CarbonManager instance
      • enableCarbonsAsync

        public void enableCarbonsAsync​(ExceptionCallback<java.lang.Exception> exceptionCallback)
        Enable carbons asynchronously. If an error occurs as result of the attempt to enable carbons, the optional exceptionCallback will be invoked.

        Note that although this method is asynchronous, it may block if the outgoing stream element queue is full (e.g. because of a slow network connection). Thus, if the thread performing this operation is interrupted while the queue is full, an InterruptedException is thrown.

        Parameters:
        exceptionCallback - the optional exception callback.
        Since:
        4.2
      • disableCarbonsAsync

        public void disableCarbonsAsync​(ExceptionCallback<java.lang.Exception> exceptionCallback)
        Disable carbons asynchronously. If an error occurs as result of the attempt to disable carbons, the optional exceptionCallback will be invoked.

        Note that although this method is asynchronous, it may block if the outgoing stream element queue is full (e.g. because of a slow network connection). Thus, if the thread performing this operation is interrupted while the queue is full, an InterruptedException is thrown.

        Parameters:
        exceptionCallback - the optional exception callback.
        Since:
        4.2
      • enableCarbons

        public void enableCarbons()
                           throws XMPPException,
                                  SmackException,
                                  java.lang.InterruptedException
        Helper method to enable carbons.
        Throws:
        XMPPException - if an XMPP protocol error was received.
        SmackException - if there was no response from the server.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • disableCarbons

        public void disableCarbons()
                            throws XMPPException,
                                   SmackException,
                                   java.lang.InterruptedException
        Helper method to disable carbons.
        Throws:
        XMPPException - if an XMPP protocol error was received.
        SmackException - if there was no response from the server.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • getCarbonsEnabled

        public boolean getCarbonsEnabled()
        Check if carbons are enabled on this connection.
        Returns:
        true if carbons are enabled, else false.