Class UpdateDocumentMessage
java.lang.Object
com.yahoo.messagebus.Routable
com.yahoo.messagebus.Message
com.yahoo.documentapi.messagebus.protocol.DocumentMessage
com.yahoo.documentapi.messagebus.protocol.TestAndSetMessage
com.yahoo.documentapi.messagebus.protocol.UpdateDocumentMessage
- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateDocumentMessage(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
Modifier and TypeMethodDescriptionstatic UpdateDocumentMessageCreates an empty UpdateDocumentMessageCreates and returns a reply to this message.com.yahoo.document.TestAndSetConditioncom.yahoo.document.DocumentUpdateReturns the document update to perform.longReturns the timestamp to assign to the updated document.longReturns the timestamp required for this update to be applied.longintgetType()booleanvoidsetCondition(com.yahoo.document.TestAndSetCondition condition) voidsetDocumentUpdate(com.yahoo.document.DocumentUpdate upd) Sets the document update to perform.voidsetNewTimestamp(long time) Sets the timestamp to assign to the updated document.voidsetOldTimestamp(long time) Sets the timestamp required for this update to be applied.Methods inherited from class com.yahoo.documentapi.messagebus.protocol.DocumentMessage
getApproxSize, getPriority, getProtocol, setPriority, swapStateMethods inherited from class com.yahoo.messagebus.Message
getBucketSequence, getRetry, getRetryEnabled, getRoute, getTimeReceived, getTimeRemaining, getTimeRemainingNow, hasBucketSequence, isExpired, setRetry, setRetryEnabled, setRoute, setTimeReceived, setTimeReceivedNow, setTimeRemainingMethods inherited from class com.yahoo.messagebus.Routable
discard, getCallStack, getContext, getTrace, popHandler, pushHandler, setContext
-
Constructor Details
-
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 Details
-
createEmpty
Creates an empty UpdateDocumentMessage -
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.
-
createReply
Description copied from class:DocumentMessageCreates and returns a reply to this message.- Specified by:
createReplyin classDocumentMessage- Returns:
- The created reply.
-
hasSequenceId
public boolean hasSequenceId()- Overrides:
hasSequenceIdin classcom.yahoo.messagebus.Message
-
getSequenceId
public long getSequenceId()- Overrides:
getSequenceIdin classcom.yahoo.messagebus.Message
-
getType
public int getType()- Specified by:
getTypein classcom.yahoo.messagebus.Routable
-
getCondition
public com.yahoo.document.TestAndSetCondition getCondition()- Specified by:
getConditionin classTestAndSetMessage
-
setCondition
public void setCondition(com.yahoo.document.TestAndSetCondition condition) - Specified by:
setConditionin classTestAndSetMessage
-