SSLEngineResult (Java 2 Platform SE 5.0) (original) (raw)


javax.net.ssl

Class SSLEngineResult

java.lang.Object extended by javax.net.ssl.SSLEngineResult


public class SSLEngineResult

extends Object

An encapsulation of the result state produced bySSLEngine 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)](../../../javax/net/ssl/SSLEngine.html#wrap%28java.nio.ByteBuffer, java.nio.ByteBuffer%29), [SSLEngine.unwrap(ByteBuffer, ByteBuffer)](../../../javax/net/ssl/SSLEngine.html#unwrap%28java.nio.ByteBuffer, java.nio.ByteBuffer%29)


Nested Class Summary
static class SSLEngineResult.HandshakeStatus An SSLEngineResult enum describing the current handshaking state of this SSLEngine.
static class SSLEngineResult.Status An SSLEngineResult enum describing the overall result of the SSLEngine operation.
Constructor Summary
[SSLEngineResult](../../../javax/net/ssl/SSLEngineResult.html#SSLEngineResult%28javax.net.ssl.SSLEngineResult.Status, javax.net.ssl.SSLEngineResult.HandshakeStatus, int, int%29)(SSLEngineResult.Status status,SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced) Initializes a new instance of this class.
Method Summary
int bytesConsumed() Returns the number of bytes consumed from the input buffer.
int bytesProduced() Returns the number of bytes written to the output buffer.
SSLEngineResult.HandshakeStatus getHandshakeStatus() Gets the handshake status of this SSLEngine operation.
SSLEngineResult.Status getStatus() Gets the return value of this SSLEngine operation.
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](../../../java/lang/Object.html#wait%28long, int%29)
Constructor Detail

SSLEngineResult

public SSLEngineResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, 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](../../../java/lang/IllegalArgumentException.html "class in java.lang") - if the status or handshakeStatus arguments are null, or if <bytesConsumed orbytesProduced is negative.

Method Detail

getStatus

public final SSLEngineResult.Status getStatus()

Gets the return value of this SSLEngine operation.

Returns:

the return value


getHandshakeStatus

public final SSLEngineResult.HandshakeStatus getHandshakeStatus()

Gets the handshake status of this SSLEngine operation.

Returns:

the handshake status


bytesConsumed

public final int bytesConsumed()

Returns the number of bytes consumed from the input buffer.

Returns:

the number of bytes consumed.


bytesProduced

public final int bytesProduced()

Returns the number of bytes written to the output buffer.

Returns:

the number of bytes produced


toString

public String toString()

Returns a String representation of this object.

Overrides:

[toString](../../../java/lang/Object.html#toString%28%29) in class [Object](../../../java/lang/Object.html "class in java.lang")

Returns:

a string representation of the object.



Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.