public class SynchronizationPointWithSmackException<E extends java.lang.Exception,R>
extends java.lang.Object
Constructor and Description |
---|
SynchronizationPointWithSmackException(AbstractXMPPConnection connection,
java.lang.String waitFor)
Construct a new synchronization point for the given connection.
|
Modifier and Type | Method and Description |
---|---|
R |
checkIfSuccessOrWaitOrThrow()
Check if this synchronization point is successful or wait the connections reply timeout.
|
java.lang.Exception |
getFailureException() |
void |
init()
Initialize (or reset) this synchronization point.
|
void |
reportFailure(E failureException)
Report this synchronization point as failed because of the given exception.
|
void |
reportFailure(SmackException smackException)
Report this synchronization point as failed because of the given exception.
|
void |
reportSuccess(R result)
Report this synchronization point as successful.
|
boolean |
requestSent()
Check if this synchronization point has its request already sent.
|
void |
resetTimeout() |
boolean |
wasSuccessful()
Check if this synchronization point was successful.
|
public SynchronizationPointWithSmackException(AbstractXMPPConnection connection, java.lang.String waitFor)
connection
- the connection of this synchronization point.waitFor
- a description of the event this synchronization point handles.public void init()
public R checkIfSuccessOrWaitOrThrow() throws E extends java.lang.Exception, java.lang.InterruptedException, SmackException
E
- if there was a failurejava.lang.InterruptedException
- if the connection is interrupted.SmackException
E extends java.lang.Exception
public void reportSuccess(R result)
public void reportFailure(SmackException smackException)
failureException
must be set.smackException
- the exception causing this synchronization point to fail.public void reportFailure(E failureException)
failureException
must be set.failureException
- the exception causing this synchronization point to fail.public boolean wasSuccessful()
public boolean requestSent()
public java.lang.Exception getFailureException()
public void resetTimeout()