- All Known Implementing Classes:
SAMClientEventListenerImpl, SAMEventHandler, SAMStreamSend.SendEventHandler, SAMStreamSink.SinkEventHandler, SAMStreamSink.SinkEventHandler2
- Enclosing class:
SAMReader
public static interface SAMReader.SAMClientEventListener
Async event notification interface for SAM clients.
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNaming lookup failed because the private key is invalid.static final StringNaming lookup failed because no key matches the requested name.static final StringNaming lookup succeeded.static final StringSession creation failed because the destination is already in use.static final StringSESSION_STATUS_I2P_ERROR.static final StringSession creation failed because the supplied private key is invalid.static final StringSession creation succeeded.static final StringStream closed because the peer became unreachable.static final StringSTREAM_CLOSED_I2P_ERROR.static final StringStream closed normally.static final StringStream closed because the destination was no longer known to the router.static final StringStream closed because the lease expired.static final StringStream connect failed because the peer could not be reached.static final StringSTREAM_STATUS_I2P_ERROR.static final StringStream connect failed because the private key is invalid.static final StringStream connect succeeded.static final StringStream connect failed because the lease expired before it was established.Method Summary
All MethodsModifier and TypeMethodDescriptionvoiddatagramReceived(String dest, byte[] data, int offset, int length, int fromPort, int toPort) Called when a datagram arrives.voiddestReplyReceived(String publicKey, String privateKey) Called when a DEST reply arrives.voidhelloReplyReceived(boolean ok, String version) Called when the HELLO reply arrives.voidnamingReplyReceived(String name, String result, String value, String message) Called when a NAMING reply arrives.voidpingReceived(String data) Called when a PING reply arrives.voidpongReceived(String data) Called when a PONG reply arrives.voidrawReceived(byte[] data, int offset, int length, int fromPort, int toPort, int protocol) Called when a raw datagram arrives.voidsessionStatusReceived(String result, String destination, String message) Called when a SESSION STATUS reply arrives.voidstreamClosedReceived(String result, String id, String message) Called when a STREAM CLOSED reply arrives.voidstreamConnectedReceived(String remoteDestination, String id) Called when a STREAM CONNECTED reply arrives.voidstreamDataReceived(String id, byte[] data, int offset, int length) Called when data arrives on a stream.voidstreamStatusReceived(String result, String id, String message) Called when a STREAM STATUS reply arrives.voidunknownMessageReceived(String major, String minor, Properties params) Called for a SAM message the reader does not parse.
Field Details
SESSION_STATUS_OK
SESSION_STATUS_DUPLICATE_DEST
Session creation failed because the destination is already in use.- See Also:
SESSION_STATUS_I2P_ERROR
SESSION_STATUS_INVALID_KEY
Session creation failed because the supplied private key is invalid.- See Also:
STREAM_STATUS_OK
STREAM_STATUS_CANT_REACH_PEER
Stream connect failed because the peer could not be reached.- See Also:
STREAM_STATUS_I2P_ERROR
STREAM_STATUS_INVALID_KEY
Stream connect failed because the private key is invalid.- See Also:
STREAM_STATUS_TIMEOUT
Stream connect failed because the lease expired before it was established.- See Also:
STREAM_CLOSED_OK
STREAM_CLOSED_CANT_REACH_PEER
Stream closed because the peer became unreachable.- See Also:
STREAM_CLOSED_I2P_ERROR
STREAM_CLOSED_PEER_NOT_FOUND
Stream closed because the destination was no longer known to the router.- See Also:
STREAM_CLOSED_TIMEOUT
Stream closed because the lease expired.- See Also:
NAMING_REPLY_OK
NAMING_REPLY_INVALID_KEY
Naming lookup failed because the private key is invalid.- See Also:
NAMING_REPLY_KEY_NOT_FOUND
Naming lookup failed because no key matches the requested name.- See Also:
Method Details
helloReplyReceived
Called when the HELLO reply arrives.- Parameters:
ok- whether the SAM bridge accepted our HELLO greetingversion- the bridge version string it reported, null if none was sent
sessionStatusReceived
Called when a SESSION STATUS reply arrives.- Parameters:
result- the session status, one of the SESSION_STATUS_* constantsdestination- the base64 destination the status refers tomessage- the human-readable explanation supplied by the bridge
streamStatusReceived
streamConnectedReceived
streamClosedReceived
streamDataReceived
Called when data arrives on a stream.- Parameters:
id- the stream ID the data arrived ondata- the buffer holding the payloadoffset- the index within data where the payload startslength- the number of payload bytes valid from offset
namingReplyReceived
Called when a NAMING reply arrives.- Parameters:
name- the requested host name or service stringresult- the reply status, one of the NAMING_REPLY_* constantsvalue- the resolved value, null when the lookup failedmessage- the human-readable explanation supplied by the bridge
destReplyReceived
datagramReceived
Called when a datagram arrives.- Parameters:
dest- the base64 destination that sent the datagramdata- the buffer holding the datagram bodyoffset- the index within data where the body startslength- the number of body bytes valid from offsetfromPort- the source port in host byte ordertoPort- the destination port in host byte order
rawReceived
void rawReceived(byte[] data, int offset, int length, int fromPort, int toPort, int protocol) Called when a raw datagram arrives.- Parameters:
data- the buffer holding the raw datagram bodyoffset- the index within data where the body startslength- the number of body bytes valid from offsetfromPort- the source port in host byte ordertoPort- the destination port in host byte orderprotocol- the IP protocol number, or I2PSession.PROTO_DATAGRAM_RAW when unreported
pingReceived
Called when a PING reply arrives.- Parameters:
data- the payload echoed back, limited to the first token of the line
pongReceived
Called when a PONG reply arrives.- Parameters:
data- the payload echoed back, limited to the first token of the line
unknownMessageReceived
Called for a SAM message the reader does not parse.- Parameters:
major- the first token of the SAM message, naming the command familyminor- the second token, naming the specific command within that familyparams- the remaining name=value pairs of the line, quotes stripped