Interface CBProtocolType<T extends CBProtocolMessageType>
- Type Parameters:
T- The type of messages
- All Known Implementing Classes:
CBAbstractProtocol
public interface CBProtocolType<T extends CBProtocolMessageType>
The base type of protocols.
-
Method Summary
Modifier and TypeMethodDescriptionserializerForMessageClass(Class<T> messageClass) Retrieve a serializer for the given message class.serializerForProtocolVersion(long version) Retrieve a serializer for the given protocol version.serializerForProtocolVersion(BigInteger version) Retrieve a serializer for the given protocol version.
-
Method Details
-
messageClass
-
protocolId
UUID protocolId()- Returns:
- The unique protocol identifier
-
serializerForMessageClass
Optional<CBProtocolMessageVersionedSerializerType<T>> serializerForMessageClass(Class<T> messageClass) Retrieve a serializer for the given message class.- Parameters:
messageClass- The message class- Returns:
- A serializer, if one is available
-
serializerForProtocolVersion
Optional<CBProtocolMessageVersionedSerializerType<T>> serializerForProtocolVersion(BigInteger version) Retrieve a serializer for the given protocol version.- Parameters:
version- The protocol version- Returns:
- A serializer, if one is available
-
serializerForProtocolVersion
default Optional<CBProtocolMessageVersionedSerializerType<T>> serializerForProtocolVersion(long version) Retrieve a serializer for the given protocol version.- Parameters:
version- The protocol version- Returns:
- A serializer, if one is available
-
protocols
SortedSet<CBProtocolCoordinates> protocols()- Returns:
- The set of protocol coordinates for this protocol
-
protocolVersions
SortedSet<BigInteger> protocolVersions()- Returns:
- The set of protocol versions for this protocol
-