public class SaslSocketTransceiver extends Transceiver
Transceiver that uses javax.security.sasl for
authentication and encryption.| Constructor and Description |
|---|
SaslSocketTransceiver(SocketAddress address)
Create using SASL's anonymous
(RFC 2245) mechanism.
|
SaslSocketTransceiver(SocketAddress address,
SaslClient saslClient)
Create using the specified
SaslClient. |
SaslSocketTransceiver(SocketChannel channel,
SaslServer saslServer)
Create using the specified
SaslServer. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Protocol |
getRemote()
Returns the protocol passed to
Transceiver.setRemote(Protocol). |
String |
getRemoteName() |
boolean |
isConnected()
True if a handshake has been completed for this connection.
|
List<ByteBuffer> |
readBuffers()
Called by the default definition of
Transceiver.transceive(List). |
void |
setRemote(Protocol remote)
Called with the remote protocol when a handshake has been completed.
|
List<ByteBuffer> |
transceive(List<ByteBuffer> request)
Called by
Requestor.request(String,Object) for two-way messages. |
void |
writeBuffers(List<ByteBuffer> buffers)
Called by
Requestor.request(String,Object) for one-way messages. |
lockChannel, transceive, unlockChannelpublic SaslSocketTransceiver(SocketAddress address) throws IOException
IOExceptionpublic SaslSocketTransceiver(SocketAddress address, SaslClient saslClient) throws IOException
SaslClient.IOExceptionpublic SaslSocketTransceiver(SocketChannel channel, SaslServer saslServer) throws IOException
SaslServer.IOExceptionpublic boolean isConnected()
TransceiverisConnected in class Transceiverpublic void setRemote(Protocol remote)
TransceiverTransceiver.isConnected() should return true and #getRemote() should return this
protocol. Does nothing by default.setRemote in class Transceiverpublic Protocol getRemote()
TransceiverTransceiver.setRemote(Protocol). Throws
IllegalStateException by default.getRemote in class Transceiverpublic String getRemoteName()
getRemoteName in class Transceiverpublic List<ByteBuffer> transceive(List<ByteBuffer> request) throws IOException
TransceiverRequestor.request(String,Object) for two-way messages. By
default calls Transceiver.writeBuffers(List) followed by Transceiver.readBuffers().transceive in class TransceiverIOExceptionpublic List<ByteBuffer> readBuffers() throws IOException
TransceiverTransceiver.transceive(List).readBuffers in class TransceiverIOExceptionpublic void writeBuffers(List<ByteBuffer> buffers) throws IOException
TransceiverRequestor.request(String,Object) for one-way messages.writeBuffers in class TransceiverIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class TransceiverIOExceptionCopyright © 2009–2023 The Apache Software Foundation. All rights reserved.