Class UpdateDocumentMessage


  • public class UpdateDocumentMessage
    extends TestAndSetMessage
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      UpdateDocumentMessage​(com.yahoo.document.DocumentUpdate upd)
      Constructs a new document update message.
      UpdateDocumentMessage​(LazyDecoder decoder, com.yahoo.document.serialization.DocumentDeserializer buffer)
      Constructs a new message from a byte buffer.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static UpdateDocumentMessage createEmpty()
      Creates an empty UpdateDocumentMessage
      DocumentReply createReply()
      Creates and returns a reply to this message.
      com.yahoo.document.TestAndSetCondition getCondition()  
      com.yahoo.document.DocumentUpdate getDocumentUpdate()
      Returns the document update to perform.
      long getNewTimestamp()
      Returns the timestamp to assign to the updated document.
      long getOldTimestamp()
      Returns the timestamp required for this update to be applied.
      long getSequenceId()  
      int getType()  
      boolean hasSequenceId()  
      void setCondition​(com.yahoo.document.TestAndSetCondition condition)  
      void setDocumentUpdate​(com.yahoo.document.DocumentUpdate upd)
      Sets the document update to perform.
      void setNewTimestamp​(long time)
      Sets the timestamp to assign to the updated document.
      void setOldTimestamp​(long time)
      Sets the timestamp required for this update to be applied.
      • Methods inherited from class com.yahoo.messagebus.Message

        getBucketSequence, getRetry, getRetryEnabled, getRoute, getTimeReceived, getTimeRemaining, getTimeRemainingNow, hasBucketSequence, isExpired, setRetry, setRetryEnabled, setRoute, setTimeReceived, setTimeReceivedNow, setTimeRemaining
      • Methods inherited from class com.yahoo.messagebus.Routable

        discard, getCallStack, getContext, getTrace, popHandler, pushHandler, setContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UpdateDocumentMessage

        public UpdateDocumentMessage​(LazyDecoder decoder,
                                     com.yahoo.document.serialization.DocumentDeserializer buffer)
        Constructs a new message from a byte buffer.
        Parameters:
        decoder - The decoder to use for deserialization.
        buffer - A byte buffer that contains a serialized message.
      • UpdateDocumentMessage

        public UpdateDocumentMessage​(com.yahoo.document.DocumentUpdate upd)
        Constructs a new document update message.
        Parameters:
        upd - The document update to perform.
    • Method Detail

      • getDocumentUpdate

        public com.yahoo.document.DocumentUpdate getDocumentUpdate()
        Returns the document update to perform.
        Returns:
        The update.
      • setDocumentUpdate

        public void setDocumentUpdate​(com.yahoo.document.DocumentUpdate upd)
        Sets the document update to perform.
        Parameters:
        upd - The document update to set.
      • getOldTimestamp

        public long getOldTimestamp()
        Returns the timestamp required for this update to be applied.
        Returns:
        The document timestamp.
      • setOldTimestamp

        public void setOldTimestamp​(long time)
        Sets the timestamp required for this update to be applied.
        Parameters:
        time - The timestamp to set.
      • getNewTimestamp

        public long getNewTimestamp()
        Returns the timestamp to assign to the updated document.
        Returns:
        The document timestamp.
      • setNewTimestamp

        public void setNewTimestamp​(long time)
        Sets the timestamp to assign to the updated document.
        Parameters:
        time - The timestamp to set.
      • hasSequenceId

        public boolean hasSequenceId()
        Overrides:
        hasSequenceId in class com.yahoo.messagebus.Message
      • getSequenceId

        public long getSequenceId()
        Overrides:
        getSequenceId in class com.yahoo.messagebus.Message
      • getType

        public int getType()
        Specified by:
        getType in class com.yahoo.messagebus.Routable
      • setCondition

        public void setCondition​(com.yahoo.document.TestAndSetCondition condition)
        Specified by:
        setCondition in class TestAndSetMessage