com.sun.grizzly.portunif
Class TLSPUPreProcessor

java.lang.Object
  extended by com.sun.grizzly.portunif.TLSPUPreProcessor
All Implemented Interfaces:
PUPreProcessor

public class TLSPUPreProcessor
extends Object
implements PUPreProcessor

PUPreProcessor that will first try to execute an handshake. If the handshake is succesfull - it means data is encoded

Author:
Jeanfrancois Arcand, Alexey Stashok

Field Summary
static String ID
           
 
Constructor Summary
TLSPUPreProcessor()
           
TLSPUPreProcessor(SSLConfig sslConfig)
           
TLSPUPreProcessor(SSLContext sslContext)
           
 
Method Summary
 void configure(SSLConfig sslConfig)
          Configures SSL settings.
 String getId()
          Returns PUPreProcessor id
 SSLContext getSSLContext()
          Return the SSLContext required to support SSL over NIO.
 boolean isNeedClientAuth()
           
 boolean isWantClientAuth()
           
 void postProcess(Context context, PUProtocolRequest protocolRequest)
          Method is called if no ProtocolFinder was found.
 boolean process(Context context, PUProtocolRequest protocolRequest)
          Try to initialize an SSL|TLS handshake to determine if secured connection is used
 void setNeedClientAuth(boolean needClientAuth)
           
 void setSSLContext(SSLContext sslContext)
          Set the SSLContext required to support SSL over NIO.
 void setWantClientAuth(boolean wantClientAuth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values
Constructor Detail

TLSPUPreProcessor

public TLSPUPreProcessor()

TLSPUPreProcessor

public TLSPUPreProcessor(SSLConfig sslConfig)

TLSPUPreProcessor

public TLSPUPreProcessor(SSLContext sslContext)
Method Detail

getId

public String getId()
Description copied from interface: PUPreProcessor
Returns PUPreProcessor id

Specified by:
getId in interface PUPreProcessor
Returns:
PUPreProcessor id

process

public boolean process(Context context,
                       PUProtocolRequest protocolRequest)
                throws IOException
Try to initialize an SSL|TLS handshake to determine if secured connection is used

Specified by:
process in interface PUPreProcessor
Returns:
true, if preprocessing was completed and initial data was changed, false if preprocessing didn't change anything in the source data set
Throws:
IOException

postProcess

public void postProcess(Context context,
                        PUProtocolRequest protocolRequest)
Description copied from interface: PUPreProcessor
Method is called if no ProtocolFinder was found. PUPreProcessor should restore PUProtocolRequest and make it ready for the next data read operation.

Specified by:
postProcess in interface PUPreProcessor

setSSLContext

public void setSSLContext(SSLContext sslContext)
Set the SSLContext required to support SSL over NIO.

Parameters:
sslContext - SSLContext

configure

public void configure(SSLConfig sslConfig)
Configures SSL settings. SSLConfig contains all the parameters required to build SSLEngine. There will be no need to call three methods: setSSLContext, setWantClientAuth, setNeedClientAuth.

Parameters:
sslConfig - SSLConfig configuration

getSSLContext

public SSLContext getSSLContext()
Return the SSLContext required to support SSL over NIO.

Returns:
SSLContext

isNeedClientAuth

public boolean isNeedClientAuth()

setNeedClientAuth

public void setNeedClientAuth(boolean needClientAuth)

isWantClientAuth

public boolean isWantClientAuth()

setWantClientAuth

public void setWantClientAuth(boolean wantClientAuth)


Copyright © 2009 SUN Microsystems. All Rights Reserved.