public class SAMEventHandler extends SAMClientEventListenerImpl
NAMING_REPLY_INVALID_KEY, NAMING_REPLY_KEY_NOT_FOUND, NAMING_REPLY_OK, SESSION_STATUS_DUPLICATE_DEST, SESSION_STATUS_I2P_ERROR, SESSION_STATUS_INVALID_KEY, SESSION_STATUS_OK, STREAM_CLOSED_CANT_REACH_PEER, STREAM_CLOSED_I2P_ERROR, STREAM_CLOSED_OK, STREAM_CLOSED_PEER_NOT_FOUND, STREAM_CLOSED_TIMEOUT, STREAM_STATUS_CANT_REACH_PEER, STREAM_STATUS_I2P_ERROR, STREAM_STATUS_INVALID_KEY, STREAM_STATUS_OK, STREAM_STATUS_TIMEOUT
Constructor and Description |
---|
SAMEventHandler(I2PAppContext ctx) |
Modifier and Type | Method and Description |
---|---|
void |
helloReplyReceived(boolean ok,
String version) |
void |
namingReplyReceived(String name,
String result,
String value,
String msg) |
void |
sessionStatusReceived(String result,
String destination,
String msg)
may be called twice, first for CREATE and second for ADD
|
void |
streamStatusReceived(String result,
String id,
String message) |
void |
unknownMessageReceived(String major,
String minor,
Properties params) |
String |
waitForHelloReply()
Wait for the connection to be established, returning the server version if everything
went ok
|
String |
waitForNamingReply(String name)
Return the destination found matching the name, or null if the key was
not able to be retrieved.
|
boolean |
waitForSessionAddReply()
Wait for the session to be added, returning true if everything went ok
|
boolean |
waitForSessionCreateReply()
Wait for the session to be created, returning true if everything went ok
|
boolean |
waitForStreamStatusReply()
Wait for the stream to be created, returning true if everything went ok
|
datagramReceived, destReplyReceived, pingReceived, pongReceived, rawReceived, streamClosedReceived, streamConnectedReceived, streamDataReceived
public SAMEventHandler(I2PAppContext ctx)
public void helloReplyReceived(boolean ok, String version)
helloReplyReceived
in interface SAMReader.SAMClientEventListener
helloReplyReceived
in class SAMClientEventListenerImpl
public void sessionStatusReceived(String result, String destination, String msg)
sessionStatusReceived
in interface SAMReader.SAMClientEventListener
sessionStatusReceived
in class SAMClientEventListenerImpl
public void namingReplyReceived(String name, String result, String value, String msg)
namingReplyReceived
in interface SAMReader.SAMClientEventListener
namingReplyReceived
in class SAMClientEventListenerImpl
public void streamStatusReceived(String result, String id, String message)
streamStatusReceived
in interface SAMReader.SAMClientEventListener
streamStatusReceived
in class SAMClientEventListenerImpl
public void unknownMessageReceived(String major, String minor, Properties params)
unknownMessageReceived
in interface SAMReader.SAMClientEventListener
unknownMessageReceived
in class SAMClientEventListenerImpl
public String waitForHelloReply()
public boolean waitForSessionCreateReply()
public boolean waitForSessionAddReply()
public boolean waitForStreamStatusReply()