Package org.nuxeo.lib.stream.pattern
Class KeyValueMessage
java.lang.Object
org.nuxeo.lib.stream.pattern.KeyValueMessage
- All Implemented Interfaces:
Externalizable,Serializable,Message
Simple key value message.
- Since:
- 9.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringstatic final KeyValueMessageprotected booleanprotected byte[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedKeyValueMessage(String key, byte[] value, boolean poisonPill, boolean forceBatch) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanA consumer reading this message must not wait for new message to process the batch.getId()A message identifier.inthashCode()key()static KeyValueMessagestatic KeyValueMessagestatic KeyValueMessageofForceBatch(String key) static KeyValueMessageofForceBatch(String key, byte[] value) A message that force the batch.booleanThis message is a poison pill it contains no other data, a consumer reading this message will process the batch and stop.voidtoString()byte[]value()void
-
Field Details
-
POISON_PILL
-
key
-
value
protected byte[] value -
poisonPill
protected boolean poisonPill -
forceBatch
protected boolean forceBatch
-
-
Constructor Details
-
KeyValueMessage
public KeyValueMessage() -
KeyValueMessage
-
-
Method Details
-
of
-
of
-
ofForceBatch
A message that force the batch. -
ofForceBatch
-
key
-
value
public byte[] value() -
getId
Description copied from interface:MessageA message identifier. -
poisonPill
public boolean poisonPill()Description copied from interface:MessageThis message is a poison pill it contains no other data, a consumer reading this message will process the batch and stop.- Specified by:
poisonPillin interfaceMessage
-
forceBatch
public boolean forceBatch()Description copied from interface:MessageA consumer reading this message must not wait for new message to process the batch.- Specified by:
forceBatchin interfaceMessage
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
equals
-
hashCode
public int hashCode() -
toString
-