Record Class ConsumerFilter

java.lang.Object
java.lang.Record
io.fluxzero.common.api.tracking.ConsumerFilter
Record Components:
subscriptionId - unique effective-consumer identity shared by its transport sessions; null scopes to one session
revision - monotonically increasing revision within one client session and consumer
version - filter language version; currently 2
format - payload format for which payloadTypes is complete; other formats remain eligible
payloadTypes - eligible payload names/revisions when payloadRestricted is true
routes - eligible logical routes when routeRestricted is true
upcastInputs - inputs that must bypass both constraints because upcasting may change type or metadata
payloadRestricted - whether payloadTypes is a complete constraint
routeRestricted - whether routes is a complete constraint
referenceOnly - whether this read refers to a previously supplied snapshot instead of carrying its constraints

public record ConsumerFilter(String subscriptionId, long revision, int version, String format, List<ConsumerFilter.PayloadType> payloadTypes, List<ConsumerFilter.RoutePattern> routes, List<ConsumerFilter.PayloadType> upcastInputs, boolean payloadRestricted, boolean routeRestricted, boolean referenceOnly) extends Record
Versioned, conservative projection of an application's effective consumer blueprint. Filters are delivery optimizations, never authorization rules. Missing constraints and unknown versions allow delivery.
  • Field Details

  • Constructor Details

  • Method Details

    • select

      public static ConsumerFilter select(String subscriptionId, long revision, int version, String format, List<ConsumerFilter.PayloadType> payloadTypes, List<ConsumerFilter.RoutePattern> routes, List<ConsumerFilter.PayloadType> upcastInputs)
      Builds a selection from complete handler facts. Null lists indicate unknown constraints; explicit flags on the wire preserve that distinction even for peers whose JSON collection handling normalizes null to empty.
    • unrestricted

      public static ConsumerFilter unrestricted()
      Builds an unrestricted projection for metadata that cannot safely be narrowed.
    • union

      public static ConsumerFilter union(Collection<ConsumerFilter> filters)
      Combines alternative handlers; an unknown constraint widens the corresponding selection.
    • forRevision

      public ConsumerFilter forRevision(String subscriptionId, long revision, String format, List<ConsumerFilter.PayloadType> upcastInputs)
      Returns the same contract with its lifecycle revision and current serializer migration inputs.
    • asReference

      public ConsumerFilter asReference()
      Compact reference to a full snapshot. An unknown reference must be resolved before claiming or scanning.
    • compile

      public Predicate<SerializedMessage> compile()
      Compiles once at the subscription boundary; no regex compilation or application class loading occurs per message.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • subscriptionId

      public String subscriptionId()
      Returns the value of the subscriptionId record component.
      Returns:
      the value of the subscriptionId record component
    • revision

      public long revision()
      Returns the value of the revision record component.
      Returns:
      the value of the revision record component
    • version

      public int version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • format

      public String format()
      Returns the value of the format record component.
      Returns:
      the value of the format record component
    • payloadTypes

      public List<ConsumerFilter.PayloadType> payloadTypes()
      Returns the value of the payloadTypes record component.
      Returns:
      the value of the payloadTypes record component
    • routes

      Returns the value of the routes record component.
      Returns:
      the value of the routes record component
    • upcastInputs

      public List<ConsumerFilter.PayloadType> upcastInputs()
      Returns the value of the upcastInputs record component.
      Returns:
      the value of the upcastInputs record component
    • payloadRestricted

      public boolean payloadRestricted()
      Returns the value of the payloadRestricted record component.
      Returns:
      the value of the payloadRestricted record component
    • routeRestricted

      public boolean routeRestricted()
      Returns the value of the routeRestricted record component.
      Returns:
      the value of the routeRestricted record component
    • referenceOnly

      public boolean referenceOnly()
      Returns the value of the referenceOnly record component.
      Returns:
      the value of the referenceOnly record component