Class RoutableFactories60.DocumentReplyFactory

    • Constructor Detail

      • DocumentReplyFactory

        public DocumentReplyFactory()
    • Method Detail

      • doEncode

        protected abstract boolean doEncode​(DocumentReply reply,
                                            com.yahoo.document.serialization.DocumentSerializer buf)
        This method encodes the given reply into the given byte buffer. You are guaranteed to only receive replies of the type that this factory was registered for.

        This method is NOT exception safe. Return false to signal failure.

        Parameters:
        reply - The reply to encode.
        buf - The byte buffer to write to.
        Returns:
        True if the message was encoded.
      • doDecode

        protected abstract DocumentReply doDecode​(com.yahoo.document.serialization.DocumentDeserializer buf)
        This method decodes a reply from the given byte buffer. You are guaranteed to only receive byte buffers generated by a previous call to doEncode(DocumentReply, com.yahoo.document.serialization.DocumentSerializer).

        This method is NOT exception safe. Return null to signal failure.

        Parameters:
        buf - The byte buffer to read from.
        Returns:
        The decoded reply.
      • encode

        public boolean encode​(com.yahoo.messagebus.Routable obj,
                              com.yahoo.document.serialization.DocumentSerializer out)
        Description copied from interface: RoutableFactory

        This method encodes the content of the given routable into a byte buffer that can later be decoded using the RoutableFactory.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

        public com.yahoo.messagebus.Routable decode​(com.yahoo.document.serialization.DocumentDeserializer in,
                                                    LoadTypeSet loadTypes)
        Description copied from interface: RoutableFactory

        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.