com.sas.iom.orb
Class SSLSocketChannel

com.sas.iom.orb.SSLSocketChannel
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel, java.nio.channels.Channel, java.nio.channels.GatheringByteChannel, java.nio.channels.InterruptibleChannel, java.nio.channels.NetworkChannel, java.nio.channels.ReadableByteChannel, java.nio.channels.ScatteringByteChannel, java.nio.channels.WritableByteChannel

public final class SSLSocketChannel

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
protected SSLSocketChannel(java.nio.channels.spi.SelectorProvider provider)
           
 
Method Summary
 java.nio.channels.SocketChannel bind(java.net.SocketAddress arg0)
           
 boolean connect(java.net.SocketAddress remote)
           
static SSLSocketChannel createSocketChannel(java.nio.channels.SocketChannel channel, java.lang.String host, int port, boolean close)
           
 boolean finishConnect()
           
 java.net.SocketAddress getLocalAddress()
           
<T> T
getOption(java.net.SocketOption<T> arg0)
           
 java.net.SocketAddress getRemoteAddress()
           
 java.nio.channels.SocketChannel getSelectableChannel()
           
 boolean hasRemaining()
           
protected  void implCloseSelectableChannel()
           
protected  void implConfigureBlocking(boolean block)
           
 boolean isConnected()
           
 boolean isConnectionPending()
           
 int read(java.nio.ByteBuffer dst)
           
 long read(java.nio.ByteBuffer[] dsts, int offset, int length)
           
protected  void setChannel(java.nio.channels.SocketChannel channel)
          This method has protected access instead of private access only to facilitate unit testing.
<T> java.nio.channels.SocketChannel
setOption(java.net.SocketOption<T> arg0, T arg1)
           
 java.nio.channels.SocketChannel shutdownInput()
           
 java.nio.channels.SocketChannel shutdownOutput()
           
 java.net.Socket socket()
           
 java.util.Set<java.net.SocketOption<?>> supportedOptions()
           
 int write(java.nio.ByteBuffer src)
           
 long write(java.nio.ByteBuffer[] srcs, int offset, int length)
           
 

Constructor Detail

SSLSocketChannel

protected SSLSocketChannel(java.nio.channels.spi.SelectorProvider provider)
Method Detail

socket

public java.net.Socket socket()
Specified by:
socket in class java.nio.channels.SocketChannel

isConnected

public boolean isConnected()
Specified by:
isConnected in class java.nio.channels.SocketChannel

isConnectionPending

public boolean isConnectionPending()
Specified by:
isConnectionPending in class java.nio.channels.SocketChannel

connect

public boolean connect(java.net.SocketAddress remote)
                throws java.io.IOException
Specified by:
connect in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

finishConnect

public boolean finishConnect()
                      throws java.io.IOException
Specified by:
finishConnect in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

read

public int read(java.nio.ByteBuffer dst)
         throws java.io.IOException
Specified by:
read in interface java.nio.channels.ReadableByteChannel
Specified by:
read in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

read

public long read(java.nio.ByteBuffer[] dsts,
                 int offset,
                 int length)
          throws java.io.IOException
Specified by:
read in interface java.nio.channels.ScatteringByteChannel
Specified by:
read in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

write

public int write(java.nio.ByteBuffer src)
          throws java.io.IOException
Specified by:
write in interface java.nio.channels.WritableByteChannel
Specified by:
write in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

write

public long write(java.nio.ByteBuffer[] srcs,
                  int offset,
                  int length)
           throws java.io.IOException
Specified by:
write in interface java.nio.channels.GatheringByteChannel
Specified by:
write in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

getSelectableChannel

public java.nio.channels.SocketChannel getSelectableChannel()

hasRemaining

public boolean hasRemaining()

createSocketChannel

public static SSLSocketChannel createSocketChannel(java.nio.channels.SocketChannel channel,
                                                   java.lang.String host,
                                                   int port,
                                                   boolean close)
                                            throws java.io.IOException
Throws:
java.io.IOException

implCloseSelectableChannel

protected void implCloseSelectableChannel()
                                   throws java.io.IOException
Specified by:
implCloseSelectableChannel in class java.nio.channels.spi.AbstractSelectableChannel
Throws:
java.io.IOException

implConfigureBlocking

protected void implConfigureBlocking(boolean block)
                              throws java.io.IOException
Specified by:
implConfigureBlocking in class java.nio.channels.spi.AbstractSelectableChannel
Throws:
java.io.IOException

setChannel

protected void setChannel(java.nio.channels.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(java.net.SocketOption<T> arg0)
            throws java.io.IOException
Throws:
java.io.IOException

supportedOptions

public java.util.Set<java.net.SocketOption<?>> supportedOptions()

bind

public java.nio.channels.SocketChannel bind(java.net.SocketAddress arg0)
                                     throws java.io.IOException
Specified by:
bind in interface java.nio.channels.NetworkChannel
Overrides:
bind in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

getLocalAddress

public java.net.SocketAddress getLocalAddress()
                                       throws java.io.IOException
Specified by:
getLocalAddress in interface java.nio.channels.NetworkChannel
Specified by:
getLocalAddress in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

getRemoteAddress

public java.net.SocketAddress getRemoteAddress()
                                        throws java.io.IOException
Specified by:
getRemoteAddress in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

setOption

public <T> java.nio.channels.SocketChannel setOption(java.net.SocketOption<T> arg0,
                                                     T arg1)
                                          throws java.io.IOException
Specified by:
setOption in interface java.nio.channels.NetworkChannel
Specified by:
setOption in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

shutdownInput

public java.nio.channels.SocketChannel shutdownInput()
                                              throws java.io.IOException
Specified by:
shutdownInput in class java.nio.channels.SocketChannel
Throws:
java.io.IOException

shutdownOutput

public java.nio.channels.SocketChannel shutdownOutput()
                                               throws java.io.IOException
Specified by:
shutdownOutput in class java.nio.channels.SocketChannel
Throws:
java.io.IOException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.