org.glassfish.grizzly.ssl
Class SSLResourcesAccessor

java.lang.Object
  extended by org.glassfish.grizzly.ssl.SSLResourcesAccessor

public class SSLResourcesAccessor
extends Object

Utility class, which simplifies the access to the SSL related resources stored in AttributeHolder.

Author:
Alexey Stashok

Field Summary
 Attribute<Buffer> plainBufferAttribute
           
static String SSL_APP_BUFFER_NAME
           
static String SSL_ENGINE_ATTR_NAME
           
static String SSL_SECURED_IN_BUFFER_NAME
           
static String SSL_SECURED_OUT_BUFFER_NAME
           
 Attribute<SSLEngine> sslEngineAttribute
           
 Attribute<Buffer> sslSecuredInBufferAttribute
           
 Attribute<Buffer> sslSecuredOutBufferAttribute
           
 
Constructor Summary
SSLResourcesAccessor()
           
 
Method Summary
 void clear(AttributeStorage state)
           
 Buffer getAppBuffer(AttributeStorage state)
           
protected  AttributeBuilder getAttributeBuilder()
           
static SSLResourcesAccessor getInstance()
           
 Buffer getSecuredInBuffer(AttributeStorage state)
           
 Buffer getSecuredOutBuffer(AttributeStorage state)
           
 SSLEngine getSSLEngine(AttributeStorage state)
           
protected  SSLResourcesAccessor initializeAttributes()
           
 Buffer obtainAppBuffer(AttributeStorage state)
          Obtaining secured input buffer
 Buffer obtainSecuredInBuffer(AttributeStorage state)
          Obtaining secured input buffer
 Buffer obtainSecuredOutBuffer(AttributeStorage state)
          Obtaining secured output buffer
 SSLEngine obtainSSLEngine(SSLContext sslContext, AttributeStorage state)
           
 void setAppBuffer(AttributeStorage state, Buffer buffer)
           
 void setSecuredInBuffer(AttributeStorage state, Buffer buffer)
           
 void setSecuredOutBuffer(AttributeStorage state, Buffer buffer)
           
 void setSSLEngine(AttributeStorage state, SSLEngine sslEngine)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SSL_ENGINE_ATTR_NAME

public static final String SSL_ENGINE_ATTR_NAME
See Also:
Constant Field Values

SSL_SECURED_IN_BUFFER_NAME

public static final String SSL_SECURED_IN_BUFFER_NAME
See Also:
Constant Field Values

SSL_SECURED_OUT_BUFFER_NAME

public static final String SSL_SECURED_OUT_BUFFER_NAME
See Also:
Constant Field Values

SSL_APP_BUFFER_NAME

public static final String SSL_APP_BUFFER_NAME
See Also:
Constant Field Values

sslEngineAttribute

public Attribute<SSLEngine> sslEngineAttribute

plainBufferAttribute

public Attribute<Buffer> plainBufferAttribute

sslSecuredInBufferAttribute

public Attribute<Buffer> sslSecuredInBufferAttribute

sslSecuredOutBufferAttribute

public Attribute<Buffer> sslSecuredOutBufferAttribute
Constructor Detail

SSLResourcesAccessor

public SSLResourcesAccessor()
Method Detail

getInstance

public static SSLResourcesAccessor getInstance()

initializeAttributes

protected SSLResourcesAccessor initializeAttributes()

getAttributeBuilder

protected AttributeBuilder getAttributeBuilder()

getSSLEngine

public SSLEngine getSSLEngine(AttributeStorage state)

obtainSSLEngine

public SSLEngine obtainSSLEngine(SSLContext sslContext,
                                 AttributeStorage state)

setSSLEngine

public void setSSLEngine(AttributeStorage state,
                         SSLEngine sslEngine)

getAppBuffer

public Buffer getAppBuffer(AttributeStorage state)

obtainAppBuffer

public Buffer obtainAppBuffer(AttributeStorage state)
Obtaining secured input buffer

Parameters:
state - State storage
sslEngine - SSL engine
Returns:
Secured input buffer, or null if buffer could not be allocated automatically.

setAppBuffer

public void setAppBuffer(AttributeStorage state,
                         Buffer buffer)

getSecuredInBuffer

public Buffer getSecuredInBuffer(AttributeStorage state)

obtainSecuredInBuffer

public Buffer obtainSecuredInBuffer(AttributeStorage state)
Obtaining secured input buffer

Parameters:
state - State storage
sslEngine - SSL engine
Returns:
Secured input buffer, or null if buffer could not be allocated automatically.

setSecuredInBuffer

public void setSecuredInBuffer(AttributeStorage state,
                               Buffer buffer)

getSecuredOutBuffer

public Buffer getSecuredOutBuffer(AttributeStorage state)

obtainSecuredOutBuffer

public Buffer obtainSecuredOutBuffer(AttributeStorage state)
Obtaining secured output buffer

Parameters:
state - State storage
sslEngine - SSL engine
Returns:
Secured output buffer, or null if buffer could not be allocated automatically.

setSecuredOutBuffer

public void setSecuredOutBuffer(AttributeStorage state,
                                Buffer buffer)

clear

public void clear(AttributeStorage state)


Copyright © 2009 SUN Microsystems. All Rights Reserved.