Interface DatabaseChangeListener
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonCollectionCreated(CollectionCreated collectionCreated) Called when a collection is created.default voidonCollectionDropped(CollectionDropped collectionDropped) Called when a collection is dropped.default voidonCollectionFlushed(CollectionFlushed collectionFlushed) Called when a collection is flushed.default voidonDeletion(Deletion deletion) Called when a Couchbase document is deleted or expired.default voidonFailoverLog(FailoverLog failoverLog) voidonFailure(StreamFailure streamFailure) Something bad and probably unrecoverable happened.default voidonMutation(Mutation mutation) Called when a Couchbase document is created or updated.default voidonRollback(Rollback rollback) default voidonScopeCreated(ScopeCreated scopeCreated) Called when a new scope is created.default voidonScopeDropped(ScopeDropped scopeDropped) Called when a scope is dropped.default voidonSeqnoAdvanced(SeqnoAdvanced seqnoAdvanced) Called when a vbucket sequence number has advanced due to an event other than a document change, or for events the consumer is not subscribed to.default voidonSnapshot(SnapshotDetails snapshotDetails) default voidonStreamEnd(StreamEnd streamEnd) NOTE: The DCP client will automatically attempt to reopen the stream if the reason is notStreamEndReason.OK.
-
Method Details
-
onMutation
Called when a Couchbase document is created or updated.NOTE: If flow control is enabled on the client, listeners registered via
Client.nonBlockingListener(DatabaseChangeListener)and listeners usingFlowControlMode.MANUALMUST callDocumentChange.flowControlAck()when the application has finished processing the event, otherwise the server will stop sending events. -
onDeletion
Called when a Couchbase document is deleted or expired.NOTE: If flow control is enabled on the client, listeners registered via
Client.nonBlockingListener(DatabaseChangeListener)and listeners usingFlowControlMode.MANUALMUST callDocumentChange.flowControlAck()when the application has finished processing the event, otherwise the server will stop sending events. -
onSeqnoAdvanced
Called when a vbucket sequence number has advanced due to an event other than a document change, or for events the consumer is not subscribed to.Collections-aware listeners SHOULD use the offset from this notification to update their stream state just as if they had received a document change at this offset. Otherwise they risk "rollback to zero" when the stream is restarted from an offset prior to the purge seqno.
Only sent if the client is collections-aware.
-
onScopeCreated
Called when a new scope is created.The listener will only receive this notification if all of the following conditions are met:
- The client is collections-aware.
- The client is not configured with a scope or collections filter.
- The user has permission to view the new scope.
-
onScopeDropped
Called when a scope is dropped.The listener will only receive this notification if all of the following conditions are met:
- The client is collections-aware.
- The client is not configured with a scope or collections filter, OR the scope filter specifies the dropped scope.
- The user had permission to view the dropped scope.
-
onCollectionCreated
Called when a collection is created.The listener will only receive this notification if all of the following conditions are met:
- The client is collections-aware.
- The client is not configured with a scope or collections filter, OR the scope filter matches the new collection's parent scope, OR the collections filter includes the collection.
- The user has permission to view the new collection.
-
onCollectionDropped
Called when a collection is dropped.The listener will only receive this notification if all of the following conditions are met:
- The client is collections-aware.
- The client is not configured with a scope or collections filter, OR the scope filter matches the new collection's parent scope, OR the collections filter includes the collection.
- The user had permission to view the dropped collection.
-
onCollectionFlushed
Called when a collection is flushed.The listener will only receive this notification if all of the following conditions are met:
- The client is collections-aware.
- The client is not configured with a scope or collections filter, OR the scope filter matches the new collection's parent scope, OR the collections filter includes the collection.
- The user has permission to view the flushed collection.
-
onRollback
-
onSnapshot
-
onFailoverLog
-
onStreamEnd
NOTE: The DCP client will automatically attempt to reopen the stream if the reason is notStreamEndReason.OK. -
onFailure
Something bad and probably unrecoverable happened.
-