Class SubscriptionFilter

java.lang.Object
com.iizix.server.push.engine.SubscriptionFilter
All Implemented Interfaces:
ISubscriptionFilter

public final class SubscriptionFilter extends Object implements ISubscriptionFilter
The subscription filter: the "group" a send targets, as a predicate over the store's dimensions plus a region selector.

Built with the fluent methods and then read through ISubscriptionFilter. User ids are the decimal form of UserInfoBase.id - push does not model identity and this is the only identity it names. The device dimension is not in the interface and is offered here for the client protocol's "this device" operations.

Author:
Christopher Mindus
  • Constructor Details

    • SubscriptionFilter

      public SubscriptionFilter()
      Creates an empty filter that matches every subscription.
  • Method Details

    • applications

      public SubscriptionFilter applications(String... ids)
      Adds application IDs to target.
      Parameters:
      ids - The application IDs.
      Returns:
      This filter.
    • users

      public SubscriptionFilter users(long... uids)
      Adds users to target.
      Parameters:
      uids - The unique user IDs.
      Returns:
      This filter.
    • topics

      public SubscriptionFilter topics(String... names)
      Adds topics to target.
      Parameters:
      names - The topics; the empty string is the application-level subscription.
      Returns:
      This filter.
    • devices

      public SubscriptionFilter devices(String... uuids)
      Adds devices to target.
      Parameters:
      uuids - The device UUIDs.
      Returns:
      This filter.
    • regions

      public SubscriptionFilter regions(IRegionScope scope)
      Sets the region selector.
      Parameters:
      scope - The region selector, null for unrestricted.
      Returns:
      This filter.
    • getApplicationIds

      public List<String> getApplicationIds()
      Description copied from interface: ISubscriptionFilter
      Gets the application ids this filter targets, empty for "any application".
      Specified by:
      getApplicationIds in interface ISubscriptionFilter
      Returns:
      An unmodifiable list of application ids; never null.
    • getUserIds

      public List<String> getUserIds()
      Description copied from interface: ISubscriptionFilter
      Gets the user ids this filter targets, empty for "any user".
      Specified by:
      getUserIds in interface ISubscriptionFilter
      Returns:
      An unmodifiable list of user ids; never null.
    • getTopics

      public List<String> getTopics()
      Description copied from interface: ISubscriptionFilter
      Gets the topics this filter targets, empty for "any topic".
      Specified by:
      getTopics in interface ISubscriptionFilter
      Returns:
      An unmodifiable list of topics; never null.
    • getDevices

      public List<String> getDevices()
      Gets the device UUIDs this filter targets, empty for any device.
      Returns:
      An unmodifiable list of device UUIDs.
    • getRegionSelector

      public IRegionScope getRegionSelector()
      Description copied from interface: ISubscriptionFilter
      Gets the region selector — the subtrees this filter targets. An unrestricted scope targets every region (subject still to the operator's authorization). A subscription whose region falls outside this selector is reported DeliveryOutcome.EXCLUDED_BY_REGION.
      Specified by:
      getRegionSelector in interface ISubscriptionFilter
      Returns:
      The region selector; never null.
    • toString

      public String toString()
      Gets a string representation.
      Overrides:
      toString in class Object
      Returns:
      The dimensions.