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.DocumentSummaryMessageFactory
,RoutableFactories60.DocumentSummaryReplyFactory
,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.SearchResultMessageFactory
,RoutableFactories60.SearchResultReplyFactory
,RoutableFactories60.StatBucketMessageFactory
,RoutableFactories60.StatBucketReplyFactory
,RoutableFactories60.UpdateDocumentMessageFactory
,RoutableFactories60.UpdateDocumentReplyFactory
,RoutableFactories60.VisitorInfoMessageFactory
,RoutableFactories60.VisitorInfoReplyFactory
,RoutableFactories60.WrongDistributionReplyFactory
public interface RoutableFactory
This interface defines the necessary methods of a routable factory that can be plugged into a
DocumentProtocol
using theDocumentProtocol.putRoutableFactory(int, RoutableFactory, com.yahoo.component.VersionSpecification)
method.Notice that no routable type is passed to the
decode(DocumentDeserializer, com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet)
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.yahoo.messagebus.Routable
decode(com.yahoo.document.serialization.DocumentDeserializer in, com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet loadTypes)
This method decodes the given byte bufer 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, com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet)
method.
-
-
-
Method Detail
-
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, com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet)
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, com.yahoo.documentapi.messagebus.loadtypes.LoadTypeSet loadTypes)
This method decodes the given byte bufer to a routable.
Return false to signal failure.
This method is NOT exception safe.
- Parameters:
in
- The buffer to read from.loadTypes
- The LoadTypeSet to inject into the Routable.- Returns:
- The decoded routable.
-
-