javax.net.ssl

Class SSLEngineResult

  1. java.lang.Object
  2. extended byjavax.net.ssl.SSLEngineResult

  1. public class SSLEngineResult
  2. extends Object
An encapsulation of the result state produced by SSLEngine I/O calls.

A SSLEngine provides a means for establishing secure communication sessions between two peers. SSLEngine operations typically consume bytes from an input buffer and produce bytes in an output buffer. This class provides operational result values describing the state of the SSLEngine, including indications of what operations are needed to finish an ongoing handshake. Lastly, it reports the number of bytes consumed and produced as a result of this operation.

Since:
1.5
See Also:
SSLEngine, SSLEngine.wrap(ByteBuffer, ByteBuffer), SSLEngine.unwrap(ByteBuffer, ByteBuffer)

Nested Class Summary

Modifier and Type Class and Description
  1. static class
SSLEngineResult.HandshakeStatus
An SSLEngineResult enum describing the current handshaking state of this SSLEngine.
  1. static class
SSLEngineResult.Status
An SSLEngineResult enum describing the overall result of the SSLEngine operation.

Constructor Summary

Constructor and Description
SSLEngineResult(SSLEngineResult.Status status,SSLEngineResult.HandshakeStatus handshakeStatus,int bytesConsumed,int bytesProduced)
Initializes a new instance of this class.

Method Summary

Modifier and Type Method and Description
  1. int
bytesConsumed()
Returns the number of bytes consumed from the input buffer.
  1. int
bytesProduced()
Returns the number of bytes written to the output buffer.
  1. SSLEngineResult.HandshakeStatus
getHandshakeStatus()
Gets the handshake status of this SSLEngine operation.
  1. SSLEngineResult.Status
getStatus()
Gets the return value of this SSLEngine operation.
  1. String
toString()
Returns a String representation of this object.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

SSLEngineResult

  1. public SSLEngineResult(SSLEngineResult.Status status,
  2. SSLEngineResult.HandshakeStatus handshakeStatus,
  3. int bytesConsumed,
  4. int bytesProduced)
Initializes a new instance of this class.
Parameters:
status - the return value of the operation.
handshakeStatus - the current handshaking status.
bytesConsumed - the number of bytes consumed from the source ByteBuffer
bytesProduced - the number of bytes placed into the destination ByteBuffer
Throws:
IllegalArgumentException - if the status or handshakeStatus arguments are null, or if <bytesConsumed or bytesProduced is negative.

Method Detail

getStatus

  1. public final SSLEngineResult.Status getStatus( )
Gets the return value of this SSLEngine operation.
Returns:
the return value

getHandshakeStatus

  1. public final SSLEngineResult.HandshakeStatus getHandshakeStatus( )
Gets the handshake status of this SSLEngine operation.
Returns:
the handshake status

bytesConsumed

  1. public final int bytesConsumed( )
Returns the number of bytes consumed from the input buffer.
Returns:
the number of bytes consumed.

bytesProduced

  1. public final int bytesProduced( )
Returns the number of bytes written to the output buffer.
Returns:
the number of bytes produced

toString

  1. public String toString()
Returns a String representation of this object.
Overrides:
toString in class Object