|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.sam.SAMHandler
net.i2p.sam.SAMv1Handler
net.i2p.sam.SAMv3Handler
class SAMv3Handler
Class able to handle a SAM version 3 client connection.
Nested Class Summary | |
---|---|
static class |
SAMv3Handler.DatagramServer
|
(package private) static interface |
SAMv3Handler.Session
|
static class |
SAMv3Handler.SessionRecord
The values in the SessionsDB |
static class |
SAMv3Handler.SessionsDB
basically a HashMap from String to SessionRecord |
Field Summary | |
---|---|
static SAMv3Handler.SessionsDB |
sSessionsHash
|
Fields inherited from class net.i2p.sam.SAMv1Handler |
---|
_id, datagramSession, rawSession, streamSession |
Fields inherited from class net.i2p.sam.SAMHandler |
---|
_log, bridge, i2cpProps, socket, stopHandler, stopLock, thread, verMajor, verMinor |
Constructor Summary | |
---|---|
SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor,
Properties i2cpProps,
SAMBridge parent)
Create a new SAM version 3 handler. |
|
SAMv3Handler(SocketChannel s,
int verMajor,
int verMinor,
SAMBridge parent)
Create a new SAM version 3 handler. |
Method Summary | |
---|---|
protected boolean |
execSessionMessage(String opcode,
Properties props)
|
protected boolean |
execStreamAccept(Properties props)
|
protected boolean |
execStreamConnect(Properties props)
|
protected boolean |
execStreamForwardIncoming(Properties props)
|
protected boolean |
execStreamMessage(String opcode,
Properties props)
|
(package private) SAMBridge |
getBridge()
For SAMv3StreamSession |
String |
getClientIP()
|
void |
handle()
Actually handle the SAM protocol. |
void |
notifyStreamIncomingConnection(Destination d)
|
static void |
notifyStreamIncomingConnection(SocketChannel client,
Destination d)
|
void |
notifyStreamResult(boolean verbose,
String result,
String message)
|
void |
stealSocket()
For SAMv3StreamSession connect and accept |
void |
stopHandling()
Stop the SAM handler, close the socket, unregister with the bridge. |
boolean |
verifVersion()
|
Methods inherited from class net.i2p.sam.SAMHandler |
---|
closeClientSocket, getClientSocket, getWriteLock, run, shouldStop, startHandling, toString, writeBytes, writeBytes, writeString, writeString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SAMv3Handler.SessionsDB sSessionsHash
Constructor Detail |
---|
public SAMv3Handler(SocketChannel s, int verMajor, int verMinor, SAMBridge parent) throws SAMException, IOException
s
- Socket attached to a SAM clientverMajor
- SAM major version to manage (should be 3)verMinor
- SAM minor version to manage
SAMException
IOException
public SAMv3Handler(SocketChannel s, int verMajor, int verMinor, Properties i2cpProps, SAMBridge parent) throws SAMException, IOException
s
- Socket attached to a SAM clientverMajor
- SAM major version to manage (should be 3)verMinor
- SAM minor version to managei2cpProps
- properties to configure the I2CP connection (host, port, etc)
SAMException
IOException
Method Detail |
---|
public boolean verifVersion()
verifVersion
in class SAMv1Handler
public String getClientIP()
public void stealSocket()
SAMBridge getBridge()
public void handle()
SAMHandler
handle
in class SAMv1Handler
public void stopHandling()
stopHandling
in interface Handler
stopHandling
in class SAMHandler
protected boolean execSessionMessage(String opcode, Properties props)
execSessionMessage
in class SAMv1Handler
protected boolean execStreamMessage(String opcode, Properties props)
execStreamMessage
in class SAMv1Handler
protected boolean execStreamConnect(Properties props)
execStreamConnect
in class SAMv1Handler
protected boolean execStreamForwardIncoming(Properties props)
protected boolean execStreamAccept(Properties props)
public void notifyStreamResult(boolean verbose, String result, String message) throws IOException
IOException
public void notifyStreamIncomingConnection(Destination d) throws IOException
IOException
public static void notifyStreamIncomingConnection(SocketChannel client, Destination d) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |