Package com.sas.iom.orb
Class SSLSocketChannel
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.SelectableChannel
java.nio.channels.spi.AbstractSelectableChannel
java.nio.channels.SocketChannel
com.sas.iom.orb.SSLSocketChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,GatheringByteChannel,InterruptibleChannel,NetworkChannel,ReadableByteChannel,ScatteringByteChannel,WritableByteChannel
public final class SSLSocketChannel
extends SocketChannel
SocketChannel implementation that encloses all transmitted data in
an SSL envelope. This is not a complete SSL implementation of
a java.nio.channels provider. It is just a wrapper around
SocketChannel. It cannot be registered with a selector. The
wrapped channel should be registered instead.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSocketChannelbind(SocketAddress arg0) booleanconnect(SocketAddress remote) static SSLSocketChannelcreateSocketChannel(SocketChannel channel, String host, int port, boolean close) booleanSocketAddress<T> TgetOption(SocketOption<T> arg0) SocketAddressSocketChannelbooleanprotected voidprotected voidimplConfigureBlocking(boolean block) booleanbooleanintread(ByteBuffer dst) longread(ByteBuffer[] dsts, int offset, int length) protected voidsetChannel(SocketChannel channel) This method has protected access instead of private access only to facilitate unit testing.<T> SocketChannelsetOption(SocketOption<T> arg0, T arg1) protected voidSocketChannelSocketChannelSocketsocket()Set<SocketOption<?>> intwrite(ByteBuffer src) longwrite(ByteBuffer[] srcs, int offset, int length) Methods inherited from class java.nio.channels.SocketChannel
open, open, open, read, validOps, writeMethods inherited from class java.nio.channels.spi.AbstractSelectableChannel
blockingLock, configureBlocking, implCloseChannel, isBlocking, isRegistered, keyFor, provider, registerMethods inherited from class java.nio.channels.SelectableChannel
registerMethods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.nio.channels.Channel
isOpen
-
Constructor Details
-
SSLSocketChannel
protected SSLSocketChannel(SelectorProvider provider)
-
-
Method Details
-
socket
public Socket socket()- Specified by:
socketin classSocketChannel
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin classSocketChannel
-
isConnectionPending
public boolean isConnectionPending()- Specified by:
isConnectionPendingin classSocketChannel
-
connect
public boolean connect(SocketAddress remote) throws IOException - Specified by:
connectin classSocketChannel- Throws:
IOException
-
finishConnect
public boolean finishConnect() throws IOException- Specified by:
finishConnectin classSocketChannel- Throws:
IOException
-
read
public int read(ByteBuffer dst) throws IOException - Specified by:
readin interfaceReadableByteChannel- Specified by:
readin classSocketChannel- Throws:
IOException
-
read
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException - Specified by:
readin interfaceScatteringByteChannel- Specified by:
readin classSocketChannel- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException - Specified by:
writein interfaceWritableByteChannel- Specified by:
writein classSocketChannel- Throws:
IOException
-
write
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException - Specified by:
writein interfaceGatheringByteChannel- Specified by:
writein classSocketChannel- Throws:
IOException
-
getSelectableChannel
public SocketChannel getSelectableChannel() -
hasRemaining
public boolean hasRemaining() -
createSocketChannel
public static SSLSocketChannel createSocketChannel(SocketChannel channel, String host, int port, boolean close) throws IOException - Throws:
IOException
-
implCloseSelectableChannel
protected void implCloseSelectableChannel() throws IOException- Specified by:
implCloseSelectableChannelin classAbstractSelectableChannel- Throws:
IOException
-
shutdownHandshake
protected void shutdownHandshake() throws IOException- Throws:
IOException
-
implConfigureBlocking
protected void implConfigureBlocking(boolean block) throws IOException - Specified by:
implConfigureBlockingin classAbstractSelectableChannel- Throws:
IOException
-
setChannel
protected void setChannel(SocketChannel channel) This method has protected access instead of private access only to facilitate unit testing. It should not be called outside this class in production code.- Parameters:
channel- the underlying channel
-
getOption
public <T> T getOption(SocketOption<T> arg0) throws IOException - Throws:
IOException
-
supportedOptions
public Set<SocketOption<?>> supportedOptions() -
bind
public SocketChannel bind(SocketAddress arg0) throws IOException - Specified by:
bindin interfaceNetworkChannel- Specified by:
bindin classSocketChannel- Throws:
IOException
-
getLocalAddress
public SocketAddress getLocalAddress() throws IOException- Specified by:
getLocalAddressin interfaceNetworkChannel- Specified by:
getLocalAddressin classSocketChannel- Throws:
IOException
-
getRemoteAddress
public SocketAddress getRemoteAddress() throws IOException- Specified by:
getRemoteAddressin classSocketChannel- Throws:
IOException
-
setOption
public <T> SocketChannel setOption(SocketOption<T> arg0, T arg1) throws IOException - Specified by:
setOptionin interfaceNetworkChannel- Specified by:
setOptionin classSocketChannel- Throws:
IOException
-
shutdownInput
public SocketChannel shutdownInput() throws IOException- Specified by:
shutdownInputin classSocketChannel- Throws:
IOException
-
shutdownOutput
public SocketChannel shutdownOutput() throws IOException- Specified by:
shutdownOutputin classSocketChannel- Throws:
IOException
-