Class SafeInboxReader

java.lang.Object
software.spool.publisher.internal.port.decorator.SafeInboxReader
All Implemented Interfaces:
InboxReader

public class SafeInboxReader extends Object implements InboxReader
Decorator for InboxReader that normalises unchecked exceptions into typed InboxReadException instances.

If the delegate throws a SpoolException subclass, it is re-thrown as-is. Any other Exception is wrapped in a new InboxReadException.

  • Constructor Details

    • SafeInboxReader

      public SafeInboxReader(InboxReader reader)
  • Method Details

    • findByStatus

      public Stream<software.spool.core.model.InboxItem> findByStatus(software.spool.core.model.InboxItemStatus status)
      Description copied from interface: InboxReader
      Returns all inbox items matching the given status.
      Specified by:
      findByStatus in interface InboxReader
      Parameters:
      status - the status to filter by; must not be null
      Returns:
      a stream of matching inbox items
    • of

      public static SafeInboxReader of(InboxReader reader)
      Creates a new SafeInboxReader wrapping the given delegate.
      Parameters:
      reader - the reader to wrap; must not be null
      Returns:
      a new SafeInboxReader instance