Class DefaultStorageCallbacks

  • All Implemented Interfaces:
    StorageCallbacks

    public class DefaultStorageCallbacks
    extends Object
    implements StorageCallbacks
    No-op implementation of storage callbacks. Extending this class allows convenient implementation of certain callbacks while leaving the rest as no-op.

    For example:

    StorageCallbacks storageCallbacks =
        new DefaultStorageCallbacks() {
            @Override
            public void storageOverflowPressure(final long remainingSizeBytes) {
                super.storageOverflowPressure(remainingSize);
    
                final long remainingSizeInMB = remainingSizeBytes / 1024L / 1024L;
    
                log.warn("The buffer is approaching capacity: {} MB remaining", remainingSizeInMB);
            }
        };