Class TokenOptions.Builder

java.lang.Object
com.vonage.client.video.TokenOptions.Builder
Enclosing class:
TokenOptions

public static class TokenOptions.Builder extends Object
Use this class to create a TokenOptions object.
  • Method Details

    • role

      Sets the role for the token. Each role defines a set of permissions granted to the token.
      Parameters:
      role - The role for the token. Valid values are defined in the Role class:
      • SUBSCRIBER — A subscriber can only subscribe to streams.
      • PUBLISHER — A publisher can publish streams, subscribe to streams, and signal. (This is the default value if you do not specify a role.)
      • MODERATOR — In addition to the privileges granted to a publisher, a moderator can perform moderation functions, such as forcing clients to disconnect, to stop publishing streams, or to mute audio in published streams. See the Moderation developer guide.
      Returns:
      This builder.
    • expiryLength

      Sets the expiration time for the token.
      Parameters:
      ttl - The expiration length (time-to-live) The maximum duration is 30 days. Default is 24 hours.
      Returns:
      This builder.
    • data

      A string containing connection metadata describing the end-user. For example, you can pass the user ID, name, or other data describing the end-user. The length of the string is limited to 1000 characters. This data cannot be updated once it is set.
      Parameters:
      data - The connection metadata.
      Returns:
      This builder.
      Throws:
      IllegalArgumentException
    • initialLayoutClassList

      public TokenOptions.Builder initialLayoutClassList(List<String> initialLayoutClassList)
      A List of class names (strings) to be used as the initial layout classes for streams published by the client. Layout classes are used in customizing the layout of videos in live streaming broadcasts and composed archives.
      Parameters:
      initialLayoutClassList - The initial layout class list.
      Returns:
      This builder.
    • build

      public TokenOptions build()
      Builds the TokenOptions object.
      Returns:
      A new TokenOptions instance with this builder's properties.