Class SynchronizationPoint<E extends java.lang.Exception>


  • public class SynchronizationPoint<E extends java.lang.Exception>
    extends java.lang.Object
    • Constructor Detail

      • SynchronizationPoint

        public SynchronizationPoint​(AbstractXMPPConnection connection,
                                    java.lang.String waitFor)
        Construct a new synchronization point for the given connection.
        Parameters:
        connection - the connection of this synchronization point.
        waitFor - a description of the event this synchronization point handles.
    • Method Detail

      • init

        public void init()
        Initialize (or reset) this synchronization point.
      • checkIfSuccessOrWait

        public java.lang.Exception checkIfSuccessOrWait()
                                                 throws SmackException.NoResponseException,
                                                        java.lang.InterruptedException
        Check if this synchronization point is successful or wait the connections reply timeout.
        Returns:
        null if synchronization point was successful, or the failure Exception.
        Throws:
        SmackException.NoResponseException - if there was no response marking the synchronization point as success or failed.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • reportSuccess

        public void reportSuccess()
        Report this synchronization point as successful.
      • reportFailure

        public void reportFailure​(E failureException)
        Report this synchronization point as failed because of the given exception. The failureException must be set.
        Parameters:
        failureException - the exception causing this synchronization point to fail.
      • reportGenericFailure

        public void reportGenericFailure​(SmackException.SmackWrappedException exception)
        Report this synchronization point as failed because of the given exception. The failureException must be set.
        Parameters:
        exception - the exception causing this synchronization point to fail.
      • wasSuccessful

        public boolean wasSuccessful()
        Check if this synchronization point was successful.
        Returns:
        true if the synchronization point was successful, false otherwise.
      • isNotInInitialState

        public boolean isNotInInitialState()
      • requestSent

        public boolean requestSent()
        Check if this synchronization point has its request already sent.
        Returns:
        true if the request was already sent, false otherwise.
      • getFailureException

        public E getFailureException()
      • resetTimeout

        public void resetTimeout()