|
XNIO API 3.0.4.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xnio.sasl.SaslWrapper
public abstract class SaslWrapper
A wrapper delegation class for SASL that presents the same wrap/unwrap API regardless of whether it is dealing with a SASL client or server.
Constructor Summary | |
---|---|
SaslWrapper()
|
Method Summary | |
---|---|
static SaslWrapper |
create(SaslClient saslClient)
Create a SASL wrapper for a SASL client. |
static SaslWrapper |
create(SaslServer saslServer)
Create a SASL wrapper for a SASL server. |
byte[] |
unwrap(byte[] bytes)
Unwrap a message. |
abstract byte[] |
unwrap(byte[] bytes,
int off,
int len)
Unwrap a message. |
abstract void |
unwrap(ByteBuffer destination,
ByteBuffer source)
Unwrap a message. |
byte[] |
wrap(byte[] bytes)
Wrap a message. |
abstract byte[] |
wrap(byte[] bytes,
int off,
int len)
Wrap a message. |
abstract void |
wrap(ByteBuffer destination,
ByteBuffer source)
Wrap a message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SaslWrapper()
Method Detail |
---|
public abstract byte[] wrap(byte[] bytes, int off, int len) throws SaslException
bytes
- the incoming messageoff
- the offset into the byte arraylen
- the length of the byte array to wrap
SaslException
- if a problem occurspublic final byte[] wrap(byte[] bytes) throws SaslException
bytes
- the incoming message
SaslException
- if a problem occurspublic abstract byte[] unwrap(byte[] bytes, int off, int len) throws SaslException
bytes
- the incoming messageoff
- the offset into the byte arraylen
- the length of the byte array to wrap
SaslException
- if a problem occurspublic final byte[] unwrap(byte[] bytes) throws SaslException
bytes
- the incoming message
SaslException
- if a problem occurspublic abstract void wrap(ByteBuffer destination, ByteBuffer source) throws SaslException
The source
buffer should have its position and remaining length set to encompass exactly one SASL
message (without the length field). The SASL message itself does not encode any length information so it is up
to the protocol implementer to ensure that the message is properly framed.
destination
- the buffer into which bytes should be writtensource
- the buffers from which bytes should be read
SaslException
- if a SASL error occursSaslClient.wrap(byte[], int, int)
,
SaslServer.wrap(byte[], int, int)
public abstract void unwrap(ByteBuffer destination, ByteBuffer source) throws SaslException
The source
buffer should have its position and remaining length set to encompass exactly one SASL
message (without the length field). The SASL message itself does not encode any length information so it is up
to the protocol implementer to ensure that the message is properly framed.
destination
- the buffer into which bytes should be writtensource
- the buffers from which bytes should be read
SaslException
- if a SASL error occursSaslClient.unwrap(byte[], int, int)
public static SaslWrapper create(SaslClient saslClient)
saslClient
- the SASL client
public static SaslWrapper create(SaslServer saslServer)
saslServer
- the SASL server
|
XNIO API 3.0.4.GA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |