|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.sam.SAMMessageSession
public abstract class SAMMessageSession
Base abstract class for SAM message-based sessions.
Nested Class Summary | |
---|---|
class |
SAMMessageSession.SAMMessageSessionHandler
SAM message-based session handler, running in its own thread |
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)
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 |
Constructor Detail |
---|
protected SAMMessageSession(String dest, Properties props) throws IOException, DataFormatException, I2PSessionException
dest
- Base64-encoded destination (private key)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 keysprops
- Properties to setup the I2P session
IOException
DataFormatException
I2PSessionException
Method Detail |
---|
public Destination getDestination()
public abstract boolean sendBytes(String dest, byte[] data) throws DataFormatException
dest
- Destinationdata
- Bytes to be sent
DataFormatException
protected boolean sendBytesThroughMessageSession(String dest, byte[] data) throws DataFormatException
dest
- Destinationdata
- Bytes to be sent
DataFormatException
public void close()
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 |