Package com.opentok
Class OpenTok.Builder
- java.lang.Object
-
- com.opentok.OpenTok.Builder
-
- Enclosing class:
- OpenTok
public static class OpenTok.Builder extends java.lang.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, java.lang.String apiSecret)
Constructs a new OpenTok.Builder object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenTok.Builder
apiUrl(java.lang.String apiUrl)
Do not use.OpenTok.Builder
appendToUserAgent(java.lang.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(java.net.Proxy proxy)
Sets a proxy server that the HTTP client will use when making calls to the OpenTok REST API.OpenTok.Builder
proxy(java.net.Proxy proxy, com.opentok.util.HttpClient.ProxyAuthScheme proxyAuthScheme, java.lang.String principal, java.lang.String password)
OpenTok.Builder
requestTimeout(int requestTimeout)
Specify the timeout for HTTP requests (in seconds).
-
-
-
Constructor Detail
-
Builder
public Builder(int apiKey, java.lang.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.
-
-
Method Detail
-
apiUrl
public OpenTok.Builder apiUrl(java.lang.String apiUrl)
Do not use. This method is used by Vonage for testing.
-
proxy
public OpenTok.Builder proxy(java.net.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(java.net.Proxy proxy, com.opentok.util.HttpClient.ProxyAuthScheme proxyAuthScheme, java.lang.String principal, java.lang.String password)
-
appendToUserAgent
public OpenTok.Builder appendToUserAgent(java.lang.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.
-
-