public class SynchronizationPoint<E extends java.lang.Exception>
extends java.lang.Object
| Constructor and Description |
|---|
SynchronizationPoint(AbstractXMPPConnection connection)
Construct a new synchronization point for the given connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkIfSuccessOrWait()
Check if this synchronization point is successful or wait the connections reply timeout.
|
void |
checkIfSuccessOrWaitOrThrow()
Check if this synchronization point is successful or wait the connections reply timeout.
|
void |
init()
Initialize (or reset) this synchronization point.
|
void |
reportFailure()
Deprecated.
use
reportFailure(Exception) instead. |
void |
reportFailure(E failureException)
Report this synchronization point as failed because of the given exception.
|
void |
reportSuccess()
Report this synchronization point as successful.
|
boolean |
requestSent()
Check if this synchronization point has its request already sent.
|
void |
sendAndWaitForResponse(TopLevelStreamElement request)
Send the given top level stream element and wait for a response.
|
void |
sendAndWaitForResponseOrThrow(PlainStreamElement request)
Send the given plain stream element and wait for a response.
|
boolean |
wasSuccessful()
Check if this synchronization point was successful.
|
public SynchronizationPoint(AbstractXMPPConnection connection)
connection - the connection of this synchronization point.public void init()
public void sendAndWaitForResponse(TopLevelStreamElement request) throws SmackException.NoResponseException, SmackException.NotConnectedException
request - the plain stream element to send.SmackException.NoResponseException - if no response was received.SmackException.NotConnectedException - if the connection is not connected.public void sendAndWaitForResponseOrThrow(PlainStreamElement request) throws E extends java.lang.Exception, SmackException.NoResponseException, SmackException.NotConnectedException
request - the plain stream element to send.E - if an failure was reported.SmackException.NoResponseException - if no response was received.SmackException.NotConnectedException - if the connection is not connected.E extends java.lang.Exceptionpublic void checkIfSuccessOrWaitOrThrow()
throws SmackException.NoResponseException,
E extends java.lang.Exception
SmackException.NoResponseException - if there was no response marking the synchronization point as success or failed.E - if there was a failureE extends java.lang.Exceptionpublic void checkIfSuccessOrWait()
throws SmackException.NoResponseException
SmackException.NoResponseException - if there was no response marking the synchronization point as success or failed.public void reportSuccess()
@Deprecated public void reportFailure()
reportFailure(Exception) instead.public void reportFailure(E failureException)
failureException must be set.failureException - the exception causing this synchronization point to fail.public boolean wasSuccessful()
public boolean requestSent()