public static class TokenOptions.Builder
extends java.lang.Object
TokenOptions| Constructor and Description |
|---|
TokenOptions.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(double expireTime)
Sets the expiration time for the token.
|
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, in clients using the OpenTok.js 2.2 library, a moderator can call the
forceUnpublish() and forceDisconnect() method of the
Session object.public TokenOptions.Builder expireTime(double 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 build()