Interface RoutableFactory
- All Known Implementing Classes:
AbstractRoutableFactory
,RoutableFactories60.CreateVisitorMessageFactory
,RoutableFactories60.CreateVisitorReplyFactory
,RoutableFactories60.DestroyVisitorMessageFactory
,RoutableFactories60.DestroyVisitorReplyFactory
,RoutableFactories60.DocumentIgnoredReplyFactory
,RoutableFactories60.DocumentListMessageFactory
,RoutableFactories60.DocumentListReplyFactory
,RoutableFactories60.DocumentMessageFactory
,RoutableFactories60.DocumentReplyFactory
,RoutableFactories60.EmptyBucketsMessageFactory
,RoutableFactories60.EmptyBucketsReplyFactory
,RoutableFactories60.GetBucketListMessageFactory
,RoutableFactories60.GetBucketListReplyFactory
,RoutableFactories60.GetBucketStateMessageFactory
,RoutableFactories60.GetBucketStateReplyFactory
,RoutableFactories60.GetDocumentMessageFactory
,RoutableFactories60.GetDocumentReplyFactory
,RoutableFactories60.MapVisitorMessageFactory
,RoutableFactories60.MapVisitorReplyFactory
,RoutableFactories60.PutDocumentMessageFactory
,RoutableFactories60.PutDocumentReplyFactory
,RoutableFactories60.QueryResultMessageFactory
,RoutableFactories60.QueryResultReplyFactory
,RoutableFactories60.RemoveDocumentMessageFactory
,RoutableFactories60.RemoveDocumentReplyFactory
,RoutableFactories60.RemoveLocationMessageFactory
,RoutableFactories60.RemoveLocationReplyFactory
,RoutableFactories60.StatBucketMessageFactory
,RoutableFactories60.StatBucketReplyFactory
,RoutableFactories60.UpdateDocumentMessageFactory
,RoutableFactories60.UpdateDocumentReplyFactory
,RoutableFactories60.VisitorInfoMessageFactory
,RoutableFactories60.VisitorInfoReplyFactory
,RoutableFactories60.WrongDistributionReplyFactory
This interface defines the necessary methods of a routable factory that can be plugged into a DocumentProtocol
using the DocumentProtocol.putRoutableFactory(int, RoutableFactory, com.yahoo.component.VersionSpecification)
method.
Notice that no routable type is passed to the
decode(DocumentDeserializer)
method, so
you may NOT share a factory across multiple routable types. To share serialization logic between factory use a common
superclass or composition with a common serialization utility.
- Author:
- Simon Thoresen Hult
-
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.messagebus.Routable
decode
(com.yahoo.document.serialization.DocumentDeserializer in) This method decodes the given byte buffer to a routable.boolean
encode
(com.yahoo.messagebus.Routable obj, com.yahoo.document.serialization.DocumentSerializer out) This method encodes the content of the given routable into a byte buffer that can later be decoded using thedecode(DocumentDeserializer)
method.
-
Method Details
-
encode
boolean encode(com.yahoo.messagebus.Routable obj, com.yahoo.document.serialization.DocumentSerializer out) This method encodes the content of the given routable into a byte buffer that can later be decoded using the
decode(DocumentDeserializer)
method.Return false to signal failure.
This method is NOT exception safe.
- Parameters:
obj
- The routable to encode.out
- The buffer to write into.- Returns:
- True if the routable could be encoded.
-
decode
com.yahoo.messagebus.Routable decode(com.yahoo.document.serialization.DocumentDeserializer in) This method decodes the given byte buffer to a routable.
Return false to signal failure.
This method is NOT exception safe.
- Parameters:
in
- The buffer to read from.- Returns:
- The decoded routable.
-