org.fusesource.hawtdispatch.transport
Class SslTransport
java.lang.Object
org.fusesource.hawtdispatch.transport.ServiceBase
org.fusesource.hawtdispatch.transport.TcpTransport
org.fusesource.hawtdispatch.transport.SslTransport
- All Implemented Interfaces:
- SecuredSession, Transport
public class SslTransport
- extends TcpTransport
- implements SecuredSession
An SSL Transport for secure communications.
- Author:
- Hiram Chirino
Fields inherited from class org.fusesource.hawtdispatch.transport.TcpTransport |
blockingExecutor, channel, codec, dispatchQueue, drainOutboundSource, IPTOS_LOWCOST, IPTOS_LOWDELAY, IPTOS_RELIABILITY, IPTOS_THROUGHPUT, listener, localLocation, rateLimitingChannel, remoteLocation, socketState, useLocalHost, yieldSource |
Methods inherited from class org.fusesource.hawtdispatch.transport.TcpTransport |
_start, _stop, full, getBlockingExecutor, getDispatchQueue, getLocalAddress, getLocalHost, getMaxReadRate, getMaxWriteRate, getProtocolCodec, getReceiveBufferSize, getRemoteAddress, getSendBufferSize, getSocketChannel, getTrafficClass, getTransportListener, initializeCodec, isClosed, isCloseOnCancel, isConnected, isKeepAlive, isUseLocalHost, offer, onTransportFailure, resolveHostName, resumeRead, resumeWrite, setBlockingExecutor, setCloseOnCancel, setDispatchQueue, setKeepAlive, setMaxReadRate, setMaxWriteRate, setProtocolCodec, setReceiveBufferSize, setSendBufferSize, setTrafficClass, setTransportListener, setUseLocalHost, suspendRead, suspendWrite |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SslTransport
public SslTransport()
protocol
public static String protocol(String scheme)
- Maps uri schemes to a protocol algorithm names.
Valid algorithm names listed at:
http://download.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html#SSLContext
setSSLContext
public void setSSLContext(SSLContext ctx)
createTransport
public static SslTransport createTransport(URI uri)
throws Exception
- Allows subclasses of TcpTransportFactory to create custom instances of
TcpTransport.
- Throws:
Exception
getSSLSession
public SSLSession getSSLSession()
getPeerX509Certificates
public X509Certificate[] getPeerX509Certificates()
- Description copied from interface:
SecuredSession
- Gets the X509Certificate associated withe the peer.
- Specified by:
getPeerX509Certificates
in interface SecuredSession
- Returns:
connecting
public void connecting(URI remoteLocation,
URI localLocation)
throws Exception
- Overrides:
connecting
in class TcpTransport
- Throws:
Exception
connected
public void connected(SocketChannel channel)
throws Exception
- Overrides:
connected
in class TcpTransport
- Throws:
Exception
initializeChannel
protected void initializeChannel()
throws Exception
- Overrides:
initializeChannel
in class TcpTransport
- Throws:
Exception
onConnected
protected void onConnected()
throws IOException
- Overrides:
onConnected
in class TcpTransport
- Throws:
IOException
flush
public void flush()
- Description copied from interface:
Transport
- Forces a flush of any output buffers. Once the flush completes the listener's
'onRefill()' method will execute.
- Specified by:
flush
in interface Transport
- Overrides:
flush
in class TcpTransport
drainInbound
public void drainInbound()
- Specified by:
drainInbound
in interface Transport
- Overrides:
drainInbound
in class TcpTransport
transportFlush
protected boolean transportFlush()
throws IOException
- Overrides:
transportFlush
in class TcpTransport
- Returns:
- true if fully flushed.
- Throws:
IOException
handshake
public void handshake()
getReadChannel
public ReadableByteChannel getReadChannel()
- Specified by:
getReadChannel
in interface Transport
- Overrides:
getReadChannel
in class TcpTransport
getWriteChannel
public WritableByteChannel getWriteChannel()
- Specified by:
getWriteChannel
in interface Transport
- Overrides:
getWriteChannel
in class TcpTransport
getClientAuth
public String getClientAuth()
setClientAuth
public void setClientAuth(String clientAuth)
Copyright © 2010-2014 FuseSource, Corp.. All Rights Reserved.