Package org.apache.zookeeper.compat
Class ProtocolManager
- java.lang.Object
-
- org.apache.zookeeper.compat.ProtocolManager
-
public final class ProtocolManager extends Object
A manager for switching behaviours between difference wire protocol.Basically, wire protocol should be backward and forward compatible between minor versions. However, there are several cases that it's different due to Jute's limitations.
-
-
Constructor Summary
Constructors Constructor Description ProtocolManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectRequest
deserializeConnectRequest(InputArchive inputArchive)
DeserializingConnectRequest
should be specially handled for request from client version before and including ZooKeeper 3.3 which doesn't understand readOnly field.ConnectResponse
deserializeConnectResponse(InputArchive inputArchive)
DeserializingConnectResponse
should be specially handled for response from server version before and including ZooKeeper 3.3 which doesn't understand readOnly field.boolean
isReadonlyAvailable()
void
serializeConnectResponse(ConnectResponse response, OutputArchive outputArchive)
The serialization ofConnectResponse
has to be handled specially as clients earlier than 3.5 might not expect thereadOnly
flag.
-
-
-
Method Detail
-
isReadonlyAvailable
public boolean isReadonlyAvailable()
-
deserializeConnectRequest
public ConnectRequest deserializeConnectRequest(InputArchive inputArchive) throws IOException
DeserializingConnectRequest
should be specially handled for request from client version before and including ZooKeeper 3.3 which doesn't understand readOnly field.- Throws:
IOException
-
deserializeConnectResponse
public ConnectResponse deserializeConnectResponse(InputArchive inputArchive) throws IOException
DeserializingConnectResponse
should be specially handled for response from server version before and including ZooKeeper 3.3 which doesn't understand readOnly field.- Throws:
IOException
-
serializeConnectResponse
public void serializeConnectResponse(ConnectResponse response, OutputArchive outputArchive) throws IOException
The serialization ofConnectResponse
has to be handled specially as clients earlier than 3.5 might not expect thereadOnly
flag.- Parameters:
response
- the response to serializeoutputArchive
- the serialization destination- Throws:
IOException
- See Also:
deserializeConnectRequest(InputArchive)
-
-