Class Subscription

java.lang.Object
de.chojo.universalis.websocket.subscriber.Subscription

public class Subscription extends Object
Class implementing a subscription for a channel.

Allows setting world filters and defined the subscribed channel

See Also:
  • Constructor Details

    • Subscription

      protected Subscription(String channel)
      Create a new subscription for a channel
      Parameters:
      channel - channel
  • Method Details

    • hasWorlds

      public boolean hasWorlds()
      True when the subscription is restricted to worlds.
      Returns:
      true when restricted
    • channel

      public List<String> channel()
      Gets a list of all channels this subscription represents
      Returns:
      list of channel
    • restrict

      public Subscription restrict(World world)
      Adds a world filter. Already set filters persist.
      Parameters:
      world - world to add
      Returns:
      subscription instance for chaining.
    • restrict

      public Subscription restrict(DataCenter datacenter)
      Adds all worlds from a datacenter as a filter. Already set filters persist.
      Parameters:
      datacenter - datacenter to add
      Returns:
      subscription instance for chaining.
    • forRegion

      public Subscription forRegion(Region region)
      Adds all worlds from a region as a filter. Already set filters persist.
      Parameters:
      region - region to add
      Returns:
      subscription instance for chaining.