Package oracle.kv.pubsub
Interface StreamOperation
- All Known Subinterfaces:
StreamOperation.DeleteEvent,StreamOperation.PutEvent,StreamOperation.TransactionEvent
public interface StreamOperation
The operation (Put, Delete) that was delivered over the NoSQL stream.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceUsed to signal a Delete operationstatic interfaceUsed to signal a Put operationstatic interfaceA SequenceId uniquely identifies a stream operation associated with a Publisher.static interfaceUsed to signal a Transaction operationstatic enumThe type of the operation. -
Method Summary
Modifier and TypeMethodDescriptionasDelete()Converts this operation to aStreamOperation.DeleteEvent.asPut()Converts this operation to aStreamOperation.PutEvent.default StreamOperation.TransactionEventConverts this operation to aStreamOperation.TransactionEvent.Returns the before image associated with the stream event represented byStreamOperation, or null if 1.intReturns the shard id associated with this operation.Returns the unique sequence id associated with this operation.getType()Returns the type of this operation.booleanReturns true if the current stream is configured to include before image, false otherwisebooleanReturns true if before image is enabled for the write operation in this eventStreamOperationto the subscribed table in kvstore.booleanReturns true if the before image is enabled for the write operation in this eventStreamOperationbut the before image has expired.
-
Method Details
-
getSequenceId
StreamOperation.SequenceId getSequenceId()Returns the unique sequence id associated with this operation. -
getRepGroupId
int getRepGroupId()Returns the shard id associated with this operation. -
includeBeforeImage
boolean includeBeforeImage()Returns true if the current stream is configured to include before image, false otherwise- Returns:
- true if the current stream is configured to include before image, false otherwise
-
isBeforeImageEnabled
boolean isBeforeImageEnabled()Returns true if before image is enabled for the write operation in this eventStreamOperationto the subscribed table in kvstore. Returns false if otherwise.- Returns:
- true if the before image is enabled, or false.
-
isBeforeImageExpired
boolean isBeforeImageExpired()Returns true if the before image is enabled for the write operation in this eventStreamOperationbut the before image has expired. If the before image is disabled for the table or the subscription is not configured to include before image, it returns false. For insert operations to the subscribed table, for which the before image is null, this method returns false.- Returns:
- true if the before image is enabled and expired, or false.
-
getBeforeImage
Row getBeforeImage()Returns the before image associated with the stream event represented byStreamOperation, or null if 1. the stream is not configured to include before image, or 2. the before image is not enabled for the event, or 3. the before image is enabled while it does not exist for operations like insert.- Returns:
- the before image associated with the stream event, or null.
-
getType
StreamOperation.Type getType()Returns the type of this operation.- Returns:
- the type of this operation
-
asPut
StreamOperation.PutEvent asPut()Converts this operation to aStreamOperation.PutEvent.- Returns:
- this operation as a Put
- Throws:
IllegalArgumentException- if this operation is not a Put
-
asDelete
StreamOperation.DeleteEvent asDelete()Converts this operation to aStreamOperation.DeleteEvent.- Returns:
- this operation as a Delete
- Throws:
IllegalArgumentException- if this operation is not a Delete
-
asTransaction
Converts this operation to aStreamOperation.TransactionEvent.- Returns:
- this operation as a Transaction
- Throws:
IllegalArgumentException- if this operation is not a Transaction
-