|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.client.impl.MessageState
class MessageState
Contains the state of a payload message being sent to a peer. Originally was a general-purpose waiter. Then we got rid of guaranteed delivery. Then we stopped waiting for accept in best-effort delivery. Brought back to life for asynchronous status delivery to the client.
Constructor Summary | |
---|---|
MessageState(I2PAppContext ctx,
long nonce,
I2PSession session,
long expires,
SendMessageStatusListener listener)
For asynchronous notification |
|
MessageState(I2PAppContext ctx,
long nonce,
String prefix)
For synchronous waiting for accept with waitForAccept(). |
Method Summary | |
---|---|
void |
cancel()
|
long |
getElapsed()
|
long |
getExpires()
|
MessageId |
getMessageId()
|
void |
receive(int status)
|
void |
setMessageId(MessageId id)
|
void |
waitForAccept(long expiration)
For guaranteed/best effort only. |
boolean |
wasAccepted()
|
boolean |
wasSuccessful()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageState(I2PAppContext ctx, long nonce, String prefix)
public MessageState(I2PAppContext ctx, long nonce, I2PSession session, long expires, SendMessageStatusListener listener)
expires
- absolute time (not interval)Method Detail |
---|
public void receive(int status)
public void setMessageId(MessageId id)
public MessageId getMessageId()
public long getElapsed()
public long getExpires()
public void waitForAccept(long expiration) throws InterruptedException
InterruptedException
public boolean wasAccepted()
public boolean wasSuccessful()
public void cancel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |