Class SubscriptionData

java.lang.Object
live.crowdcontrol.cc4j.websocket.data.SubscriptionData

public class SubscriptionData extends Object
Defines an attempt to subscribe to channels of information on the WebSocket.
  • Field Details

  • Constructor Details

    • SubscriptionData

      public SubscriptionData(@NotNull @NotNull Set<@NotNull String> topics, @Nullable @Nullable String token, @Nullable @Nullable String key)
      Creates a subscription body.
      Parameters:
      topics - the list of topics to subscribe to, conforming to TOPIC_PATTERN
      token - the token to authenticate with or null
      key - the overlay key to authenticate with or null
    • SubscriptionData

      public SubscriptionData(@NotNull @NotNull Set<@NotNull String> topics, @Nullable @Nullable String token)
      Creates a subscription body.
      Parameters:
      topics - the list of topics to subscribe to, conforming to TOPIC_PATTERN
      token - the token to authenticate with or null
    • SubscriptionData

      public SubscriptionData(@NotNull @NotNull Set<@NotNull String> topics)
      Creates a subscription body.
      Parameters:
      topics - the list of topics to subscribe to, conforming to TOPIC_PATTERN
  • Method Details

    • getTopics

      @NotNull public @NotNull Set<@NotNull String> getTopics()
      Gets the set of topics to be subscribed to. It is immutable.
      Returns:
      topic list
    • getToken

      @Nullable public @Nullable String getToken()
      Gets the token to authenticate with.
      Returns:
      JWT token
    • getKey

      @Nullable public @Nullable String getKey()
      Gets the key to authenticate with. This is given out to lesser third-party applications such as the official Overlay which lacks write permissions.
      Returns:
      overlay key