|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mpisws.p2p.transport.ssl.SSLSocketManager<Identifier>
public class SSLSocketManager<Identifier>
Field Summary | |
---|---|
protected int |
appBufferMax
|
protected java.nio.ByteBuffer |
bogusEncryptMe
|
protected Continuation<SSLSocketManager<Identifier>,java.lang.Exception> |
c
|
protected boolean |
closed
|
protected boolean |
doneHandshaking
|
protected javax.net.ssl.SSLEngine |
engine
|
protected boolean |
handshaking
|
protected Logger |
logger
|
protected java.lang.String |
name
|
protected int |
netBufferMax
|
protected java.util.Map<java.lang.String,java.lang.Object> |
options
|
protected java.security.cert.X509Certificate |
peerCert
The cert of the remote node. |
protected java.util.LinkedList<java.nio.ByteBuffer> |
readMe
|
protected javax.net.ssl.SSLEngineResult |
result
|
protected boolean |
server
|
protected P2PSocket<Identifier> |
socket
|
protected SSLTransportLayerImpl<Identifier,?> |
sslTL
|
protected javax.net.ssl.SSLEngineResult.HandshakeStatus |
status
|
protected java.util.LinkedList<java.nio.ByteBuffer> |
unwrapMe
|
protected boolean |
useClientAuth
|
protected java.util.LinkedList<java.nio.ByteBuffer> |
writeMe
|
Constructor Summary | |
---|---|
SSLSocketManager(SSLTransportLayerImpl<Identifier,?> sslTL,
P2PSocket<Identifier> s,
Continuation<SSLSocketManager<Identifier>,java.lang.Exception> c,
boolean server,
boolean useClientAuth)
Called on incoming side |
Method Summary | |
---|---|
protected boolean |
checkDone()
Return true when done. |
void |
close()
Closes this socket. |
protected void |
continueHandshaking()
|
protected void |
fail(java.lang.Exception e)
|
java.security.cert.X509Certificate |
getCert()
|
Identifier |
getIdentifier()
The identification of the node at the other end of the socket. |
java.util.Map<java.lang.String,java.lang.Object> |
getOptions()
Details on the connectivity of the socket (encrypted, source-routed etc) |
protected void |
handleResult(javax.net.ssl.SSLEngineResult result)
|
protected void |
handshakeUnwrap()
|
protected void |
handshakeWrap()
|
protected boolean |
read()
|
long |
read(java.nio.ByteBuffer dsts)
Reads a sequence of bytes from this channel into a subsequence of the given buffer. |
void |
receiveException(P2PSocket<Identifier> socket,
java.lang.Exception ioe)
Called when there is an error |
void |
receiveSelectResult(P2PSocket<Identifier> socket,
boolean canRead,
boolean canWrite)
Called when a socket is available for read/write |
void |
register(boolean wantToRead,
boolean wantToWrite,
P2PSocketReceiver<Identifier> receiver)
Must be called every time a Read/Write occurs to continue operation. |
void |
shutdownOutput()
Disables the output stream for this socket. |
java.lang.String |
toString()
|
protected void |
unwrap()
|
long |
write(java.nio.ByteBuffer srcs)
Writes a sequence of bytes to this channel from a subsequence of the given buffers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.security.cert.X509Certificate peerCert
protected P2PSocket<Identifier> socket
protected javax.net.ssl.SSLEngine engine
protected SSLTransportLayerImpl<Identifier,?> sslTL
protected Logger logger
protected boolean handshaking
protected boolean closed
protected javax.net.ssl.SSLEngineResult result
protected javax.net.ssl.SSLEngineResult.HandshakeStatus status
protected java.util.LinkedList<java.nio.ByteBuffer> writeMe
protected java.util.LinkedList<java.nio.ByteBuffer> unwrapMe
protected java.util.LinkedList<java.nio.ByteBuffer> readMe
protected java.nio.ByteBuffer bogusEncryptMe
protected int appBufferMax
protected int netBufferMax
protected Continuation<SSLSocketManager<Identifier>,java.lang.Exception> c
protected boolean doneHandshaking
protected java.util.Map<java.lang.String,java.lang.Object> options
protected boolean useClientAuth
protected boolean server
protected java.lang.String name
Constructor Detail |
---|
public SSLSocketManager(SSLTransportLayerImpl<Identifier,?> sslTL, P2PSocket<Identifier> s, Continuation<SSLSocketManager<Identifier>,java.lang.Exception> c, boolean server, boolean useClientAuth)
transportLayerImpl
- s
- Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
protected void handleResult(javax.net.ssl.SSLEngineResult result)
public void receiveSelectResult(P2PSocket<Identifier> socket, boolean canRead, boolean canWrite) throws java.io.IOException
P2PSocketReceiver
receiveSelectResult
in interface P2PSocketReceiver<Identifier>
java.io.IOException
protected boolean read() throws java.io.IOException
java.io.IOException
protected void handshakeWrap()
protected void unwrap() throws javax.net.ssl.SSLException
javax.net.ssl.SSLException
protected void handshakeUnwrap()
protected void fail(java.lang.Exception e)
protected void continueHandshaking()
protected boolean checkDone()
public java.security.cert.X509Certificate getCert()
public void register(boolean wantToRead, boolean wantToWrite, P2PSocketReceiver<Identifier> receiver)
P2PSocket
register
in interface P2PSocket<Identifier>
wantToRead
- if you want to read from this socketwantToWrite
- if you want to write to this socketreceiver
- will have receiveSelectResult() called on it
note that you must call select() each time receiveSelectResult() is called. This is so
your application can properly handle flow controlpublic long read(java.nio.ByteBuffer dsts) throws java.io.IOException
P2PSocket
read
in interface P2PSocket<Identifier>
java.io.IOException
public long write(java.nio.ByteBuffer srcs) throws java.io.IOException
P2PSocket
write
in interface P2PSocket<Identifier>
java.io.IOException
public void close()
P2PSocket
close
in interface P2PSocket<Identifier>
public Identifier getIdentifier()
P2PSocket
getIdentifier
in interface P2PSocket<Identifier>
public java.util.Map<java.lang.String,java.lang.Object> getOptions()
P2PSocket
getOptions
in interface P2PSocket<Identifier>
public void shutdownOutput()
P2PSocket
shutdownOutput
in interface P2PSocket<Identifier>
public void receiveException(P2PSocket<Identifier> socket, java.lang.Exception ioe)
P2PSocketReceiver
receiveException
in interface P2PSocketReceiver<Identifier>
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |