Class DittoDiskUsage

java.lang.Object
com.ditto.java.DittoDiskUsage

public final class DittoDiskUsage extends Object

Provides access to information about disk storage used by Ditto.

This class allows you to query current disk usage and observe changes over time. Access an instance through Ditto.getDiskUsage().

API Note:
Do not implement this interface yourself.
  • Method Details

    • getCurrent

      public @NonNull DittoDiskUsageItem getCurrent()

      Returns a single snapshot of current disk usage.

      This provides an immediate, point-in-time view of how much disk space is being used by Ditto's data store, including documents, attachments, and metadata.

      Returns:
      a DittoDiskUsageItem containing current disk usage information.
    • observe

      public @NonNull AutoCloseable observe(@NonNull DittoDiskUsageCallback callback)

      Observes disk usage changes using a callback.

      The callback will be invoked regularly with updated disk usage information. Observation continues until the returned AutoCloseable handle goes out of scope or its AutoCloseable.close() method is invoked.

      Parameters:
      callback - the DittoDiskUsageCallback to be called with DittoDiskUsageItem updates.
      Returns:
      an AutoCloseable handle to stop observing disk usage.
    • observe

      public @NonNull Flow.Publisher<DittoDiskUsageItem> observe()

      Observes disk usage changes using a reactive streams publisher.

      Returns a Flow.Publisher that emits DittoDiskUsageItem updates regularly as disk usage changes. Use this method when integrating with reactive streams frameworks.

      Returns:
      a Flow.Publisher that emits disk usage updates.