public class SslProtocolCodec extends java.lang.Object implements WrappingProtocolCodec, SecuredSession
| Modifier and Type | Class and Description |
|---|---|
static class |
SslProtocolCodec.ClientAuth |
class |
SslProtocolCodec.SSLReadChannel |
class |
SslProtocolCodec.SSLWriteChannel |
ProtocolCodec.BufferState| Modifier and Type | Field and Description |
|---|---|
private javax.net.ssl.SSLEngine |
engine |
(package private) int |
lastReadSize |
(package private) int |
lastWriteSize |
(package private) ProtocolCodec |
next |
private java.nio.ByteBuffer |
readBuffer |
private java.nio.channels.ReadableByteChannel |
readChannel |
(package private) long |
readCounter |
private java.nio.ByteBuffer |
readOverflowBuffer |
private boolean |
readUnderflow |
private javax.net.ssl.SSLContext |
sslContext |
(package private) SslProtocolCodec.SSLReadChannel |
sslReadChannel |
(package private) SslProtocolCodec.SSLWriteChannel |
sslWriteChannel |
(package private) Transport |
transport |
private java.nio.ByteBuffer |
writeBuffer |
private java.nio.channels.WritableByteChannel |
writeChannel |
(package private) long |
writeCounter |
private boolean |
writeFlushing |
| Constructor and Description |
|---|
SslProtocolCodec() |
| Modifier and Type | Method and Description |
|---|---|
SslProtocolCodec |
client() |
ProtocolCodec.BufferState |
flush()
Attempts to complete the previous write which did not complete.
|
boolean |
full()
Is the codec's buffer full?
|
long |
getLastReadSize() |
long |
getLastWriteSize() |
ProtocolCodec |
getNext() |
java.security.cert.X509Certificate[] |
getPeerX509Certificates()
Gets the X509Certificate associated withe the peer.
|
int |
getReadBufferSize() |
long |
getReadCounter() |
javax.net.ssl.SSLSession |
getSSLSession() |
int |
getWriteBufferSize() |
long |
getWriteCounter() |
void |
handshake() |
protected void |
initializeEngine() |
private void |
initNext() |
java.lang.Object |
read()
Non-blocking channel based decoding.
|
private int |
secure_read(java.nio.ByteBuffer plain) |
private int |
secure_write(java.nio.ByteBuffer plain) |
SslProtocolCodec |
server(SslProtocolCodec.ClientAuth clientAuth) |
void |
setNext(ProtocolCodec next) |
void |
setSSLContext(javax.net.ssl.SSLContext ctx) |
void |
setTransport(Transport transport) |
protected boolean |
transportFlush() |
void |
unread(byte[] buffer)
Pushes back a buffer as being unread.
|
ProtocolCodec.BufferState |
write(java.lang.Object value)
Non-blocking channel based encoding.
|
private java.nio.channels.ReadableByteChannel readChannel
private java.nio.channels.WritableByteChannel writeChannel
private javax.net.ssl.SSLContext sslContext
private javax.net.ssl.SSLEngine engine
private java.nio.ByteBuffer readBuffer
private boolean readUnderflow
private java.nio.ByteBuffer writeBuffer
private boolean writeFlushing
private java.nio.ByteBuffer readOverflowBuffer
Transport transport
int lastReadSize
int lastWriteSize
long readCounter
long writeCounter
ProtocolCodec next
SslProtocolCodec.SSLReadChannel sslReadChannel
SslProtocolCodec.SSLWriteChannel sslWriteChannel
public ProtocolCodec getNext()
getNext in interface WrappingProtocolCodecpublic void setNext(ProtocolCodec next)
setNext in interface WrappingProtocolCodecprivate void initNext()
public void setSSLContext(javax.net.ssl.SSLContext ctx)
public SslProtocolCodec client() throws java.lang.Exception
java.lang.Exceptionpublic SslProtocolCodec server(SslProtocolCodec.ClientAuth clientAuth) throws java.lang.Exception
java.lang.Exceptionprotected void initializeEngine()
throws java.lang.Exception
java.lang.Exceptionpublic javax.net.ssl.SSLSession getSSLSession()
public java.security.cert.X509Certificate[] getPeerX509Certificates()
SecuredSessiongetPeerX509Certificates in interface SecuredSessionpublic void setTransport(Transport transport)
setTransport in interface ProtocolCodecpublic void handshake()
throws java.io.IOException
java.io.IOExceptionprotected boolean transportFlush()
throws java.io.IOException
java.io.IOExceptionprivate int secure_read(java.nio.ByteBuffer plain)
throws java.io.IOException
java.io.IOExceptionprivate int secure_write(java.nio.ByteBuffer plain)
throws java.io.IOException
java.io.IOExceptionpublic void unread(byte[] buffer)
ProtocolCodecunread in interface ProtocolCodecpublic java.lang.Object read()
throws java.io.IOException
ProtocolCodecread in interface ProtocolCodecjava.io.IOExceptionpublic ProtocolCodec.BufferState write(java.lang.Object value) throws java.io.IOException
ProtocolCodecwrite in interface ProtocolCodecjava.io.IOExceptionpublic ProtocolCodec.BufferState flush() throws java.io.IOException
ProtocolCodecflush in interface ProtocolCodecjava.io.IOExceptionpublic boolean full()
ProtocolCodecfull in interface ProtocolCodecpublic long getWriteCounter()
getWriteCounter in interface ProtocolCodecpublic long getLastWriteSize()
getLastWriteSize in interface ProtocolCodecpublic long getReadCounter()
getReadCounter in interface ProtocolCodecpublic long getLastReadSize()
getLastReadSize in interface ProtocolCodecpublic int getReadBufferSize()
getReadBufferSize in interface ProtocolCodecpublic int getWriteBufferSize()
getWriteBufferSize in interface ProtocolCodec