com.opentok.OpenTok.Builder
Enclosing class: : OpenTok
public static class OpenTok.Builder extends Object
Used to create an OpenTok object with advanced settings. You can set the request timeout for API calls and a proxy to use for API calls.
If you do not need to set these advanced settings, you can use the
OpenTok() constructor to build the OpenTok object.
Constructor Summary
Constructors
Constructor
Description
Builder(int apiKey, String apiSecret)
Constructs a new OpenTok.Builder object.
Builder(String applicationId, Path privateKeyPath)
Method Summary
All MethodsInstance MethodsConcrete Methods
Modifier and Type
Method
Description
OpenTok.Builder
apiUrl(String apiUrl)
Do not use.
OpenTok.Builder
appendToUserAgent(String appendUserAgent)
Append a custom string to the client's User-Agent.
OpenTok
build()
Builds the OpenTok object with the settings provided to this Builder object.
OpenTok.Builder
proxy(Proxy proxy)
Sets a proxy server that the HTTP client will use when making calls to the OpenTok REST API.
OpenTok.Builder
proxy(Proxy proxy, com.opentok.util.HttpClient.ProxyAuthScheme proxyAuthScheme, String principal, String password)
OpenTok.Builder
requestTimeout(int requestTimeout)
Specify the timeout for HTTP requests (in seconds).
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Details
Builder
public Builder(int apiKey, String apiSecret)
Constructs a new OpenTok.Builder object.
Parameters:
: apiKey - The API key for your OpenTok project.
: apiSecret - The API secret for your OpenTok project. You can obtain
your API key and secret from your Video API account.
Do not publicly share your API secret.
Builder
public Builder(String applicationId, Path privateKeyPath)
Method Details
apiUrl
public OpenTok.Builder apiUrl(String apiUrl)
Do not use. This method is used by Vonage for testing.
proxy
public OpenTok.Builder proxy(Proxy proxy)
Sets a proxy server that the HTTP client will use when making calls to the OpenTok REST API.
requestTimeout
public OpenTok.Builder requestTimeout(int requestTimeout)
Specify the timeout for HTTP requests (in seconds). The default timeout is 60 seconds.
proxy
public OpenTok.Builder proxy(Proxy proxy, com.opentok.util.HttpClient.ProxyAuthScheme proxyAuthScheme, String principal, String password)
appendToUserAgent
public OpenTok.Builder appendToUserAgent(String appendUserAgent)
Append a custom string to the client's User-Agent. This is to enable tracking for custom integrations.
Parameters:
: appendUserAgent - The string to append to the user agent.
Returns: : This Builder with the additional user agent string.
build
public OpenTok build()
Builds the OpenTok object with the settings provided to this Builder object.
Returns: : The OpenTok object.