Class Subscription
java.lang.Object
de.chojo.universalis.websocket.subscriber.Subscription
Class implementing a subscription for a channel.
Allows setting world filters and defined the subscribed channel
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Subscription
(String channel) Create a new subscription for a channel -
Method Summary
Modifier and TypeMethodDescriptionchannel()
Gets a list of all channels this subscription representsAdds all worlds from a region as a filter.boolean
True when the subscription is restricted to worlds.restrict
(DataCenter datacenter) Adds all worlds from a datacenter as a filter.Adds a world filter.
-
Constructor Details
-
Subscription
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
Gets a list of all channels this subscription represents- Returns:
- list of channel
-
restrict
Adds a world filter. Already set filters persist.- Parameters:
world
- world to add- Returns:
- subscription instance for chaining.
-
restrict
Adds all worlds from a datacenter as a filter. Already set filters persist.- Parameters:
datacenter
- datacenter to add- Returns:
- subscription instance for chaining.
-
forRegion
Adds all worlds from a region as a filter. Already set filters persist.- Parameters:
region
- region to add- Returns:
- subscription instance for chaining.
-