public static class TokenOptions.Builder
extends java.lang.Object
TokenOptions| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
TokenOptions |
build()
Builds the TokenOptions object.
|
TokenOptions.Builder |
data(java.lang.String data)
A string containing connection metadata describing the end-user.
|
TokenOptions.Builder |
expireTime(long expireTime)
Sets the expiration time for the token.
|
TokenOptions.Builder |
initialLayoutClassList(java.util.List<java.lang.String> initialLayoutClassList)
A List of class names (strings) to be used as the initial layout classes
for streams published by the client.
|
TokenOptions.Builder |
role(Role role)
Sets the role for the token.
|
public TokenOptions.Builder role(Role role)
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.
public TokenOptions.Builder expireTime(long expireTime)
expireTime - The expiration time, in seconds since the UNIX epoch. Pass in 0 to use
the default expiration time of 24 hours after the token creation time. The maximum
expiration time is 30 days after the creation time.public TokenOptions.Builder data(java.lang.String data) throws InvalidArgumentException
data - The connection metadata.InvalidArgumentExceptionpublic TokenOptions.Builder initialLayoutClassList(java.util.List<java.lang.String> initialLayoutClassList)
initialLayoutClassList - The initial layout class list.public TokenOptions build()