com.buildforge.services.common.ssl
Class BuildForgeSSLEngine

java.lang.Object
  extended by com.buildforge.services.common.ssl.BuildForgeSSLEngine

public class BuildForgeSSLEngine
extends java.lang.Object


Field Summary
static int DEFAULT_SO_TIMEOUT
           
static int MAX_RETRIES
           
static int WAIT_TIME
           
 
Method Summary
 void close()
          Closes down this encrypted conversation.
 javax.net.ssl.SSLSession getSession()
          Returns the SSLSession
 void init()
          Initializes the engine for use - this MUST be called before any other methods are invoked.
 int read(java.nio.ByteBuffer buf)
          Reads decrypted data into the provided buffer, from its current position to its limit (reading up to remaining() number of bytes).
 int write(java.nio.ByteBuffer buf)
          Writes data (all bytes from position() to limit() in the provided buffer) into the encrypted network stream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SO_TIMEOUT

public static final int DEFAULT_SO_TIMEOUT
See Also:
Constant Field Values

WAIT_TIME

public static final int WAIT_TIME
See Also:
Constant Field Values

MAX_RETRIES

public static final int MAX_RETRIES
See Also:
Constant Field Values
Method Detail

init

public void init()
          throws java.io.IOException,
                 javax.net.ssl.SSLException
Initializes the engine for use - this MUST be called before any other methods are invoked.

Throws:
javax.net.ssl.SSLException
java.io.IOException

read

public int read(java.nio.ByteBuffer buf)
         throws java.io.IOException
Reads decrypted data into the provided buffer, from its current position to its limit (reading up to remaining() number of bytes).

Parameters:
buf - The buffer to read into
Returns:
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes down this encrypted conversation. Once closed, this engine may not be reused.

Throws:
java.io.IOException

write

public int write(java.nio.ByteBuffer buf)
          throws java.io.IOException
Writes data (all bytes from position() to limit() in the provided buffer) into the encrypted network stream

Parameters:
buf -
Returns:
Throws:
java.io.IOException

getSession

public javax.net.ssl.SSLSession getSession()
Returns the SSLSession