|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.sam.SAMMessageSession
abstract class SAMMessageSession
Base abstract class for SAM message-based sessions.
Nested Class Summary | |
---|---|
(package private) class |
SAMMessageSession.SAMMessageSessionHandler
SAM message-based session handler, running in its own thread |
Field Summary | |
---|---|
protected Log |
_log
|
Constructor Summary | |
---|---|
protected |
SAMMessageSession(InputStream destStream,
Properties props)
Initialize a new SAM message-based session. |
protected |
SAMMessageSession(String dest,
Properties props)
Initialize a new SAM message-based session. |
Method Summary | |
---|---|
void |
close()
Close a SAM message-based session. |
Destination |
getDestination()
Get the SAM message-based session Destination. |
protected I2PSession |
getI2PSession()
Get the I2PSession object used by the SAM message-based session. |
protected abstract void |
messageReceived(byte[] msg)
Handle a new received message |
abstract boolean |
sendBytes(String dest,
byte[] data)
Send bytes through a SAM message-based session. |
protected boolean |
sendBytesThroughMessageSession(String dest,
byte[] data,
int proto,
int fromPort,
int toPort)
Actually send bytes through the SAM message-based session I2PSession (er...). |
protected abstract void |
shutDown()
Do whatever is needed to shutdown the SAM session |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log _log
Constructor Detail |
---|
protected SAMMessageSession(String dest, Properties props) throws IOException, DataFormatException, I2PSessionException
dest
- Base64-encoded destination and private keys (same format as PrivateKeyFile)props
- Properties to setup the I2P session
IOException
DataFormatException
I2PSessionException
protected SAMMessageSession(InputStream destStream, Properties props) throws IOException, DataFormatException, I2PSessionException
destStream
- Input stream containing the destination and private keys (same format as PrivateKeyFile)props
- Properties to setup the I2P session
IOException
DataFormatException
I2PSessionException
Method Detail |
---|
public Destination getDestination()
public abstract boolean sendBytes(String dest, byte[] data) throws DataFormatException, I2PSessionException
dest
- Destinationdata
- Bytes to be sent
DataFormatException
- on unknown / bad dest
I2PSessionException
- on serious error, probably session closedprotected boolean sendBytesThroughMessageSession(String dest, byte[] data, int proto, int fromPort, int toPort) throws DataFormatException, I2PSessionException
dest
- Destinationdata
- Bytes to be sentproto
- I2CP protocolfromPort
- I2CP from porttoPort
- I2CP to port
DataFormatException
- on unknown / bad dest
I2PSessionException
- on serious error, probably session closedpublic void close()
close
in interface Closeable
protected abstract void messageReceived(byte[] msg)
msg
- Message payloadprotected abstract void shutDown()
protected I2PSession getI2PSession()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |