Package org.apache.avro.ipc
Class SaslSocketTransceiver
java.lang.Object
org.apache.avro.ipc.Transceiver
org.apache.avro.ipc.SaslSocketTransceiver
- All Implemented Interfaces:
Closeable,AutoCloseable
A
Transceiver that uses javax.security.sasl for
authentication and encryption.-
Constructor Summary
ConstructorsConstructorDescriptionSaslSocketTransceiver(SocketAddress address) Create using SASL's anonymous (RFC 2245) mechanism.SaslSocketTransceiver(SocketAddress address, SaslClient saslClient) Create using the specifiedSaslClient.SaslSocketTransceiver(SocketChannel channel, SaslServer saslServer) Create using the specifiedSaslServer. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.avro.ProtocolReturns the protocol passed toTransceiver.setRemote(Protocol).booleanTrue if a handshake has been completed for this connection.Called by the default definition ofTransceiver.transceive(List).voidsetRemote(org.apache.avro.Protocol remote) Called with the remote protocol when a handshake has been completed.transceive(List<ByteBuffer> request) Called byRequestor.request(String,Object)for two-way messages.voidwriteBuffers(List<ByteBuffer> buffers) Called byRequestor.request(String,Object)for one-way messages.Methods inherited from class org.apache.avro.ipc.Transceiver
lockChannel, transceive, unlockChannel
-
Constructor Details
-
SaslSocketTransceiver
Create using SASL's anonymous (RFC 2245) mechanism.- Throws:
IOException
-
SaslSocketTransceiver
Create using the specifiedSaslClient.- Throws:
IOException
-
SaslSocketTransceiver
Create using the specifiedSaslServer.- Throws:
IOException
-
-
Method Details
-
isConnected
public boolean isConnected()Description copied from class:TransceiverTrue if a handshake has been completed for this connection. Used to determine whether a handshake need be completed prior to a one-way message. Requests and responses are always prefixed by handshakes, but one-way messages. If the first request sent over a connection is one-way, then a handshake-only response is returned. Subsequent one-way messages over the connection will have no response data sent. Returns false by default.- Overrides:
isConnectedin classTransceiver
-
setRemote
public void setRemote(org.apache.avro.Protocol remote) Description copied from class:TransceiverCalled with the remote protocol when a handshake has been completed. After this has been called and while a connection is maintained,Transceiver.isConnected()should return true and #getRemote() should return this protocol. Does nothing by default.- Overrides:
setRemotein classTransceiver
-
getRemote
public org.apache.avro.Protocol getRemote()Description copied from class:TransceiverReturns the protocol passed toTransceiver.setRemote(Protocol). Throws IllegalStateException by default.- Overrides:
getRemotein classTransceiver
-
getRemoteName
- Specified by:
getRemoteNamein classTransceiver
-
transceive
Description copied from class:TransceiverCalled byRequestor.request(String,Object)for two-way messages. By default callsTransceiver.writeBuffers(List)followed byTransceiver.readBuffers().- Overrides:
transceivein classTransceiver- Throws:
IOException
-
readBuffers
Description copied from class:TransceiverCalled by the default definition ofTransceiver.transceive(List).- Specified by:
readBuffersin classTransceiver- Throws:
IOException
-
writeBuffers
Description copied from class:TransceiverCalled byRequestor.request(String,Object)for one-way messages.- Specified by:
writeBuffersin classTransceiver- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classTransceiver- Throws:
IOException
-