Class XMPPTCPConnection

  • All Implemented Interfaces:
    org.jivesoftware.smack.XMPPConnection

    public class XMPPTCPConnection
    extends org.jivesoftware.smack.AbstractXMPPConnection
    Creates a socket connection to an XMPP server. This is the default connection to an XMPP server and is specified in the XMPP Core (RFC 6120).
    See Also:
    XMPPConnection
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  XMPPTCPConnection.PacketReader  
      protected class  XMPPTCPConnection.PacketWriter  
      • Nested classes/interfaces inherited from class org.jivesoftware.smack.AbstractXMPPConnection

        org.jivesoftware.smack.AbstractXMPPConnection.InterceptorWrapper, org.jivesoftware.smack.AbstractXMPPConnection.ListenerWrapper, org.jivesoftware.smack.AbstractXMPPConnection.SyncPointState
      • Nested classes/interfaces inherited from interface org.jivesoftware.smack.XMPPConnection

        org.jivesoftware.smack.XMPPConnection.FromMode
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected XMPPTCPConnection.PacketReader packetReader
      Protected access level because of unit test purposes
      protected XMPPTCPConnection.PacketWriter packetWriter
      Protected access level because of unit test purposes
      • Fields inherited from class org.jivesoftware.smack.AbstractXMPPConnection

        ASYNC_BUT_ORDERED, authenticated, authenticatedConnectionInitiallyEstablishedTimestamp, closingStreamReceived, compressionHandler, connected, connectionCounterValue, connectionListeners, connectionLock, currentSmackException, currentXmppException, debugger, host, inOrderListeners, lastFeaturesReceived, outgoingStreamXmlEnvironment, port, reader, saslFeatureReceived, SMACK_REACTOR, streamFeatures, streamId, tlsHandled, user, wasAuthenticated, writer
    • Constructor Summary

      Constructors 
      Constructor Description
      XMPPTCPConnection​(java.lang.CharSequence jid, java.lang.String password)
      Creates a new XMPP connection over TCP.
      XMPPTCPConnection​(java.lang.CharSequence username, java.lang.String password, java.lang.String serviceName)
      Creates a new XMPP connection over TCP.
      XMPPTCPConnection​(XMPPTCPConnectionConfiguration config)
      Creates a new XMPP connection over TCP (optionally using proxies).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean addRequestAckPredicate​(org.jivesoftware.smack.filter.StanzaFilter predicate)
      Add a predicate for Stream Management acknowledgment requests.
      void addStanzaAcknowledgedListener​(org.jivesoftware.smack.StanzaListener listener)
      Add a Stanza acknowledged listener.
      void addStanzaDroppedListener​(org.jivesoftware.smack.StanzaListener listener)
      Add a Stanza dropped listener.
      org.jivesoftware.smack.StanzaListener addStanzaIdAcknowledgedListener​(java.lang.String id, org.jivesoftware.smack.StanzaListener listener)
      Add a new Stanza ID acknowledged listener for the given ID.
      protected void afterFeaturesReceived()  
      protected void afterSuccessfulLogin​(boolean resumed)  
      protected void connectInternal()
      Establishes a connection to the XMPP server.
      int getMaxSmResumptionTime()
      Get the maximum resumption time in seconds after which a managed stream can be resumed.
      void instantShutdown()  
      boolean isDisconnectedButSmResumptionPossible()
      Returns true if the connection is disconnected by a Stream resumption via Stream Management is possible.
      boolean isSecureConnection()  
      boolean isSmAvailable()
      Returns true if Stream Management is supported by the server.
      boolean isSmEnabled()
      Returns true if Stream Management was successfully negotiated with the server.
      boolean isSmResumptionPossible()
      Returns true if the stream is resumable.
      boolean isUsingCompression()  
      protected void loginInternal​(java.lang.String username, java.lang.String password, org.jxmpp.jid.parts.Resourcepart resource)  
      void removeAllRequestAckPredicates()
      Remove all predicates for Stream Management acknowledgment requests.
      void removeAllStanzaAcknowledgedListeners()
      Remove all stanza acknowledged listeners.
      void removeAllStanzaIdAcknowledgedListeners()
      Removes all Stanza ID acknowledged listeners.
      boolean removeRequestAckPredicate​(org.jivesoftware.smack.filter.StanzaFilter predicate)
      Remove the given predicate for Stream Management acknowledgment request.
      boolean removeStanzaAcknowledgedListener​(org.jivesoftware.smack.StanzaListener listener)
      Remove the given Stanza acknowledged listener.
      boolean removeStanzaDroppedListener​(org.jivesoftware.smack.StanzaListener listener)
      Remove the given Stanza dropped listener.
      org.jivesoftware.smack.StanzaListener removeStanzaIdAcknowledgedListener​(java.lang.String id)
      Remove the Stanza ID acknowledged listener for the given ID.
      void requestSmAcknowledgement()
      Send an unconditional Stream Management acknowledgement request to the server.
      void sendNonza​(org.jivesoftware.smack.packet.Nonza element)  
      void sendSmAcknowledgement()
      Send a unconditional Stream Management acknowledgment to the server.
      protected void sendStanzaInternal​(org.jivesoftware.smack.packet.Stanza packet)  
      void setBundleandDeferCallback​(BundleAndDeferCallback bundleAndDeferCallback)
      Set the bundle and defer callback used for this connection.
      static void setDefaultBundleAndDeferCallback​(BundleAndDeferCallback defaultBundleAndDeferCallback)
      Set the default bundle and defer callback used for new connections.
      void setPreferredResumptionTime​(int resumptionTime)
      Set the preferred resumption time in seconds.
      void setUseStreamManagement​(boolean useSm)
      Set if Stream Management should be used if supported by the server.
      static void setUseStreamManagementDefault​(boolean useSmDefault)
      Set if Stream Management should be used by default for new connections.
      static void setUseStreamManagementResumptiodDefault​(boolean useSmResumptionDefault)
      void setUseStreamManagementResumption​(boolean useSmResumption)
      Set if Stream Management resumption should be used if supported by the server.
      static void setUseStreamManagementResumptionDefault​(boolean useSmResumptionDefault)
      Set if Stream Management resumption should be used by default for new connections.
      protected void setWriter​(java.io.Writer writer)
      For unit testing purposes
      protected void shutdown()
      Shuts the current connection down.
      boolean streamWasResumed()
      Returns true if the stream was successfully resumed with help of Stream Management.
      protected void throwAlreadyConnectedExceptionIfAppropriate()  
      protected void throwAlreadyLoggedInExceptionIfAppropriate()  
      protected void throwNotConnectedExceptionIfAppropriate()  
      • Methods inherited from class org.jivesoftware.smack.AbstractXMPPConnection

        addAsyncStanzaListener, addConnectionListener, addMessageInterceptor, addOneTimeSyncCallback, addPresenceInterceptor, addStanzaInterceptor, addStanzaListener, addStanzaSendingListener, addStreamFeature, addSyncStanzaListener, afterSaslAuthenticationSuccess, asyncGo, asyncGoLimited, authenticate, bindResourceAndEstablishSession, buildNonzaCallback, callConnectionAuthenticatedListener, callConnectionConnectedListener, callConnectionConnectingListener, connect, createStanzaCollector, createStanzaCollector, createStanzaCollectorAndSend, createStanzaCollectorAndSend, disconnect, disconnect, firePacketSendingListeners, getAuthenticatedConnectionInitiallyEstablishedTimestamp, getConfiguration, getConnectionCounter, getConnectionLock, getFeature, getFromMode, getHost, getLastStanzaReceived, getParsingExceptionCallback, getPort, getReactor, getReplyTimeout, getSmackTlsContext, getStanzaFactory, getStreamId, getUsedSaslMechansism, getUser, getXMPPServiceDomain, hasCurrentConnectionException, hasFeature, initDebugger, initState, invokeStanzaCollectorsAndNotifyRecvListeners, isAnonymous, isAuthenticated, isConnected, isSaslAuthenticated, login, login, login, notifyConnectionError, notifyWaitingThreads, onStreamOpen, parseAndProcessNonza, parseAndProcessStanza, parseFeatures, parseFeaturesAndNotify, processStanza, registerIQRequestHandler, removeAsyncStanzaListener, removeConnectionListener, removeMessageInterceptor, removePresenceInterceptor, removeStanzaCollector, removeStanzaInterceptor, removeStanzaListener, removeStanzaSendingListener, removeSyncStanzaListener, schedule, sendAndWaitForResponse, sendAsync, sendAsync, sendIqRequestAndWaitForResponse, sendIqRequestAsync, sendIqRequestAsync, sendStanza, sendStreamOpen, setCurrentConnectionExceptionAndNotify, setFromMode, setMaxAsyncOperations, setParsingExceptionCallback, setReplyTimeout, setUnknownIqRequestReplyMode, setWasAuthenticated, throwCurrentConnectionException, throwNotConnectedExceptionIfAppropriate, toString, trySendStanza, trySendStanza, unregisterIQRequestHandler, unregisterIQRequestHandler, waitFor, waitForClosingStreamTagFromServer, waitForConditionOrConnectionException, waitForConditionOrConnectionException, waitForConditionOrThrowConnectionException
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.jivesoftware.smack.XMPPConnection

        getFeature, getFeature, hasFeature
    • Constructor Detail

      • XMPPTCPConnection

        public XMPPTCPConnection​(XMPPTCPConnectionConfiguration config)
        Creates a new XMPP connection over TCP (optionally using proxies).

        Note that XMPPTCPConnection constructors do not establish a connection to the server and you must call AbstractXMPPConnection.connect().

        Parameters:
        config - the connection configuration.
      • XMPPTCPConnection

        public XMPPTCPConnection​(java.lang.CharSequence jid,
                                 java.lang.String password)
                          throws org.jxmpp.stringprep.XmppStringprepException
        Creates a new XMPP connection over TCP.

        Note that jid must be the bare JID, e.g. "user@example.org". More fine-grained control over the connection settings is available using the XMPPTCPConnection(XMPPTCPConnectionConfiguration) constructor.

        Parameters:
        jid - the bare JID used by the client.
        password - the password or authentication token.
        Throws:
        org.jxmpp.stringprep.XmppStringprepException - if the provided string is invalid.
      • XMPPTCPConnection

        public XMPPTCPConnection​(java.lang.CharSequence username,
                                 java.lang.String password,
                                 java.lang.String serviceName)
                          throws org.jxmpp.stringprep.XmppStringprepException
        Creates a new XMPP connection over TCP.

        This is the simplest constructor for connecting to an XMPP server. Alternatively, you can get fine-grained control over connection settings using the XMPPTCPConnection(XMPPTCPConnectionConfiguration) constructor.

        Parameters:
        username - TODO javadoc me please
        password - TODO javadoc me please
        serviceName - TODO javadoc me please
        Throws:
        org.jxmpp.stringprep.XmppStringprepException - if the provided string is invalid.
    • Method Detail

      • throwNotConnectedExceptionIfAppropriate

        protected void throwNotConnectedExceptionIfAppropriate()
                                                        throws org.jivesoftware.smack.SmackException.NotConnectedException
        Overrides:
        throwNotConnectedExceptionIfAppropriate in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException
      • throwAlreadyConnectedExceptionIfAppropriate

        protected void throwAlreadyConnectedExceptionIfAppropriate()
                                                            throws org.jivesoftware.smack.SmackException.AlreadyConnectedException
        Overrides:
        throwAlreadyConnectedExceptionIfAppropriate in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.SmackException.AlreadyConnectedException
      • throwAlreadyLoggedInExceptionIfAppropriate

        protected void throwAlreadyLoggedInExceptionIfAppropriate()
                                                           throws org.jivesoftware.smack.SmackException.AlreadyLoggedInException
        Overrides:
        throwAlreadyLoggedInExceptionIfAppropriate in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.SmackException.AlreadyLoggedInException
      • afterSuccessfulLogin

        protected void afterSuccessfulLogin​(boolean resumed)
                                     throws org.jivesoftware.smack.SmackException.NotConnectedException,
                                            java.lang.InterruptedException
        Overrides:
        afterSuccessfulLogin in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • loginInternal

        protected void loginInternal​(java.lang.String username,
                                     java.lang.String password,
                                     org.jxmpp.jid.parts.Resourcepart resource)
                              throws org.jivesoftware.smack.XMPPException,
                                     org.jivesoftware.smack.SmackException,
                                     java.io.IOException,
                                     java.lang.InterruptedException
        Specified by:
        loginInternal in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.XMPPException
        org.jivesoftware.smack.SmackException
        java.io.IOException
        java.lang.InterruptedException
      • isSecureConnection

        public boolean isSecureConnection()
        Specified by:
        isSecureConnection in interface org.jivesoftware.smack.XMPPConnection
        Specified by:
        isSecureConnection in class org.jivesoftware.smack.AbstractXMPPConnection
      • shutdown

        protected void shutdown()
        Shuts the current connection down. After this method returns, the connection must be ready for re-use by connect.
        Specified by:
        shutdown in class org.jivesoftware.smack.AbstractXMPPConnection
      • instantShutdown

        public void instantShutdown()
        Specified by:
        instantShutdown in class org.jivesoftware.smack.AbstractXMPPConnection
      • sendNonza

        public void sendNonza​(org.jivesoftware.smack.packet.Nonza element)
                       throws org.jivesoftware.smack.SmackException.NotConnectedException,
                              java.lang.InterruptedException
        Specified by:
        sendNonza in interface org.jivesoftware.smack.XMPPConnection
        Specified by:
        sendNonza in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • sendStanzaInternal

        protected void sendStanzaInternal​(org.jivesoftware.smack.packet.Stanza packet)
                                   throws org.jivesoftware.smack.SmackException.NotConnectedException,
                                          java.lang.InterruptedException
        Specified by:
        sendStanzaInternal in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • isUsingCompression

        public boolean isUsingCompression()
        Specified by:
        isUsingCompression in interface org.jivesoftware.smack.XMPPConnection
        Specified by:
        isUsingCompression in class org.jivesoftware.smack.AbstractXMPPConnection
      • connectInternal

        protected void connectInternal()
                                throws org.jivesoftware.smack.SmackException,
                                       java.io.IOException,
                                       org.jivesoftware.smack.XMPPException,
                                       java.lang.InterruptedException
        Establishes a connection to the XMPP server. It basically creates and maintains a socket connection to the server.

        Listeners will be preserved from a previous connection if the reconnection occurs after an abrupt termination.

        Specified by:
        connectInternal in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.XMPPException - if an error occurs while trying to establish the connection.
        org.jivesoftware.smack.SmackException - if Smack detected an exceptional situation.
        java.io.IOException - if an I/O error occurred.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • setWriter

        protected void setWriter​(java.io.Writer writer)
        For unit testing purposes
        Parameters:
        writer - TODO javadoc me please
      • afterFeaturesReceived

        protected void afterFeaturesReceived()
                                      throws org.jivesoftware.smack.SmackException.NotConnectedException,
                                             java.lang.InterruptedException,
                                             org.jivesoftware.smack.SmackException.SecurityRequiredByServerException
        Overrides:
        afterFeaturesReceived in class org.jivesoftware.smack.AbstractXMPPConnection
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
        org.jivesoftware.smack.SmackException.SecurityRequiredByServerException
      • setUseStreamManagementDefault

        public static void setUseStreamManagementDefault​(boolean useSmDefault)
        Set if Stream Management should be used by default for new connections.
        Parameters:
        useSmDefault - true to use Stream Management for new connections.
      • setUseStreamManagementResumptiodDefault

        @Deprecated
        public static void setUseStreamManagementResumptiodDefault​(boolean useSmResumptionDefault)
        Set if Stream Management resumption should be used by default for new connections.
        Parameters:
        useSmResumptionDefault - true to use Stream Management resumption for new connections.
      • setUseStreamManagementResumptionDefault

        public static void setUseStreamManagementResumptionDefault​(boolean useSmResumptionDefault)
        Set if Stream Management resumption should be used by default for new connections.
        Parameters:
        useSmResumptionDefault - true to use Stream Management resumption for new connections.
      • setUseStreamManagement

        public void setUseStreamManagement​(boolean useSm)
        Set if Stream Management should be used if supported by the server.
        Parameters:
        useSm - true to use Stream Management.
      • setUseStreamManagementResumption

        public void setUseStreamManagementResumption​(boolean useSmResumption)
        Set if Stream Management resumption should be used if supported by the server.
        Parameters:
        useSmResumption - true to use Stream Management resumption.
      • setPreferredResumptionTime

        public void setPreferredResumptionTime​(int resumptionTime)
        Set the preferred resumption time in seconds.
        Parameters:
        resumptionTime - the preferred resumption time in seconds
      • addRequestAckPredicate

        public boolean addRequestAckPredicate​(org.jivesoftware.smack.filter.StanzaFilter predicate)
        Add a predicate for Stream Management acknowledgment requests.

        Those predicates are used to determine when a Stream Management acknowledgement request is send to the server. Some pre-defined predicates are found in the org.jivesoftware.smack.sm.predicates package.

        If not predicate is configured, the Predicate.forMessagesOrAfter5Stanzas() will be used.

        Parameters:
        predicate - the predicate to add.
        Returns:
        if the predicate was not already active.
      • removeRequestAckPredicate

        public boolean removeRequestAckPredicate​(org.jivesoftware.smack.filter.StanzaFilter predicate)
        Remove the given predicate for Stream Management acknowledgment request.
        Parameters:
        predicate - the predicate to remove.
        Returns:
        true if the predicate was removed.
      • removeAllRequestAckPredicates

        public void removeAllRequestAckPredicates()
        Remove all predicates for Stream Management acknowledgment requests.
      • requestSmAcknowledgement

        public void requestSmAcknowledgement()
                                      throws org.jivesoftware.smack.sm.StreamManagementException.StreamManagementNotEnabledException,
                                             org.jivesoftware.smack.SmackException.NotConnectedException,
                                             java.lang.InterruptedException
        Send an unconditional Stream Management acknowledgement request to the server.
        Throws:
        org.jivesoftware.smack.sm.StreamManagementException.StreamManagementNotEnabledException - if Stream Management is not enabled.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • sendSmAcknowledgement

        public void sendSmAcknowledgement()
                                   throws org.jivesoftware.smack.sm.StreamManagementException.StreamManagementNotEnabledException,
                                          org.jivesoftware.smack.SmackException.NotConnectedException,
                                          java.lang.InterruptedException
        Send a unconditional Stream Management acknowledgment to the server.

        See XEP-198: Stream Management ยง 4. Acks: "Either party MAY send an <a/> element at any time (e.g., after it has received a certain number of stanzas, or after a certain period of time), even if it has not received an <r/> element from the other party."

        Throws:
        org.jivesoftware.smack.sm.StreamManagementException.StreamManagementNotEnabledException - if Stream Management is not enabled.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • addStanzaAcknowledgedListener

        public void addStanzaAcknowledgedListener​(org.jivesoftware.smack.StanzaListener listener)
        Add a Stanza acknowledged listener.

        Those listeners will be invoked every time a Stanza has been acknowledged by the server. The will not get automatically removed. Consider using addStanzaIdAcknowledgedListener(String, StanzaListener) when possible.

        Parameters:
        listener - the listener to add.
      • removeStanzaAcknowledgedListener

        public boolean removeStanzaAcknowledgedListener​(org.jivesoftware.smack.StanzaListener listener)
        Remove the given Stanza acknowledged listener.
        Parameters:
        listener - the listener.
        Returns:
        true if the listener was removed.
      • removeAllStanzaAcknowledgedListeners

        public void removeAllStanzaAcknowledgedListeners()
        Remove all stanza acknowledged listeners.
      • addStanzaDroppedListener

        public void addStanzaDroppedListener​(org.jivesoftware.smack.StanzaListener listener)
        Add a Stanza dropped listener.

        Those listeners will be invoked every time a Stanza has been dropped due to a failed SM resume. They will not get automatically removed. If at least one StanzaDroppedListener is configured, no attempt will be made to retransmit the Stanzas.

        Parameters:
        listener - the listener to add.
        Since:
        4.3.3
      • removeStanzaDroppedListener

        public boolean removeStanzaDroppedListener​(org.jivesoftware.smack.StanzaListener listener)
        Remove the given Stanza dropped listener.
        Parameters:
        listener - the listener.
        Returns:
        true if the listener was removed.
        Since:
        4.3.3
      • addStanzaIdAcknowledgedListener

        public org.jivesoftware.smack.StanzaListener addStanzaIdAcknowledgedListener​(java.lang.String id,
                                                                                     org.jivesoftware.smack.StanzaListener listener)
                                                                              throws org.jivesoftware.smack.sm.StreamManagementException.StreamManagementNotEnabledException
        Add a new Stanza ID acknowledged listener for the given ID.

        The listener will be invoked if the stanza with the given ID was acknowledged by the server. It will automatically be removed after the listener was run.

        Parameters:
        id - the stanza ID.
        listener - the listener to invoke.
        Returns:
        the previous listener for this stanza ID or null.
        Throws:
        org.jivesoftware.smack.sm.StreamManagementException.StreamManagementNotEnabledException - if Stream Management is not enabled.
      • removeStanzaIdAcknowledgedListener

        public org.jivesoftware.smack.StanzaListener removeStanzaIdAcknowledgedListener​(java.lang.String id)
        Remove the Stanza ID acknowledged listener for the given ID.
        Parameters:
        id - the stanza ID.
        Returns:
        true if the listener was found and removed, false otherwise.
      • removeAllStanzaIdAcknowledgedListeners

        public void removeAllStanzaIdAcknowledgedListeners()
        Removes all Stanza ID acknowledged listeners.
      • isSmAvailable

        public boolean isSmAvailable()
        Returns true if Stream Management is supported by the server.
        Returns:
        true if Stream Management is supported by the server.
      • isSmEnabled

        public boolean isSmEnabled()
        Returns true if Stream Management was successfully negotiated with the server.
        Returns:
        true if Stream Management was negotiated.
      • streamWasResumed

        public boolean streamWasResumed()
        Returns true if the stream was successfully resumed with help of Stream Management.
        Returns:
        true if the stream was resumed.
      • isDisconnectedButSmResumptionPossible

        public boolean isDisconnectedButSmResumptionPossible()
        Returns true if the connection is disconnected by a Stream resumption via Stream Management is possible.
        Returns:
        true if disconnected but resumption possible.
      • isSmResumptionPossible

        public boolean isSmResumptionPossible()
        Returns true if the stream is resumable.
        Returns:
        true if the stream is resumable.
      • getMaxSmResumptionTime

        public int getMaxSmResumptionTime()
        Get the maximum resumption time in seconds after which a managed stream can be resumed.

        This method will return Integer.MAX_VALUE if neither the client nor the server specify a maximum resumption time. Be aware of integer overflows when using this value, e.g. do not add arbitrary values to it without checking for overflows before.

        Returns:
        the maximum resumption time in seconds or Integer.MAX_VALUE if none set.
      • setDefaultBundleAndDeferCallback

        public static void setDefaultBundleAndDeferCallback​(BundleAndDeferCallback defaultBundleAndDeferCallback)
        Set the default bundle and defer callback used for new connections.
        Parameters:
        defaultBundleAndDeferCallback - TODO javadoc me please
        Since:
        4.1
        See Also:
        BundleAndDeferCallback
      • setBundleandDeferCallback

        public void setBundleandDeferCallback​(BundleAndDeferCallback bundleAndDeferCallback)
        Set the bundle and defer callback used for this connection.

        You can use null as argument to reset the callback. Outgoing stanzas will then no longer get deferred.

        Parameters:
        bundleAndDeferCallback - the callback or null.
        Since:
        4.1
        See Also:
        BundleAndDeferCallback