Interface DatabaseChangeListener


public interface DatabaseChangeListener
  • Method Details

    • onMutation

      default void onMutation(Mutation mutation)
      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 using FlowControlMode.MANUAL MUST call DocumentChange.flowControlAck() when the application has finished processing the event, otherwise the server will stop sending events.

    • onDeletion

      default void onDeletion(Deletion deletion)
      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 using FlowControlMode.MANUAL MUST call DocumentChange.flowControlAck() when the application has finished processing the event, otherwise the server will stop sending events.

    • onSeqnoAdvanced

      default void onSeqnoAdvanced(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.

      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

      default void onScopeCreated(ScopeCreated scopeCreated)
      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

      default void onScopeDropped(ScopeDropped scopeDropped)
      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

      default void onCollectionCreated(CollectionCreated collectionCreated)
      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

      default void onCollectionDropped(CollectionDropped collectionDropped)
      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

      default void onCollectionFlushed(CollectionFlushed collectionFlushed)
      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

      default void onRollback(Rollback rollback)
    • onSnapshot

      default void onSnapshot(SnapshotDetails snapshotDetails)
    • onFailoverLog

      default void onFailoverLog(FailoverLog failoverLog)
    • onStreamEnd

      default void onStreamEnd(StreamEnd streamEnd)
      NOTE: The DCP client will automatically attempt to reopen the stream if the reason is not StreamEndReason.OK.
    • onFailure

      void onFailure(StreamFailure streamFailure)
      Something bad and probably unrecoverable happened.