Constructor and Description |
---|
Builder(android.content.Context context)
Creates a new builder
|
Modifier and Type | Method and Description |
---|---|
<O extends Plugin.Options> |
addPlugin(Plugin<O> plugin,
O opt) |
BaasBox.Builder |
addPlugin(Plugin<Plugin.Options.Empty> plugin) |
BaasBox |
init()
Initializes a BaasBox client based on this builder
|
BaasBox.Builder |
setApiBasepath(java.lang.String basepath)
Sets the api basePath prefix
|
BaasBox.Builder |
setApiDomain(java.lang.String domain)
Sets the host this client will connect to
|
BaasBox.Builder |
setAppCode(java.lang.String code)
Sets the app code for this client
|
BaasBox.Builder |
setAuthentication(BaasBox.Config.AuthType auth)
Sets the authentication type, defaults to
BaasBox.Config.AuthType.SESSION_TOKEN |
BaasBox.Builder |
setExceptionHandler(ExceptionHandler handler) |
BaasBox.Builder |
setHttpCharset(java.lang.String charset)
Sets the charset to use defaults to 'UTF-8'.
|
BaasBox.Builder |
setHttpConnectionTimeout(int timeout)
Sets the connection timeout for this client
|
BaasBox.Builder |
setHttpSocketTimeout(int timeout)
Sets the read timeout for this client
|
BaasBox.Builder |
setPort(int port)
Sets the port this client will connect to
|
BaasBox.Builder |
setPushSenderId(java.lang.String... senderIds)
Sets gcm sender id to use for notifications
|
BaasBox.Builder |
setRestClient(RestClient client) |
BaasBox.Builder |
setSessionTokenExpires(boolean expires)
Sets if the session token will expire, defaults to false.
|
BaasBox.Builder |
setUseHttps(boolean useHttps) |
BaasBox.Builder |
setWorkerThreads(int workers) |
public Builder(android.content.Context context)
context
- spublic BaasBox.Builder setSessionTokenExpires(boolean expires)
expires
- true if you want the session token not to be refreshedpublic BaasBox.Builder setPushSenderId(java.lang.String... senderIds)
senderIds
- the senderIds to usepublic BaasBox.Builder setHttpCharset(java.lang.String charset)
charset
- public BaasBox.Builder setExceptionHandler(ExceptionHandler handler)
public BaasBox.Builder setAuthentication(BaasBox.Config.AuthType auth)
BaasBox.Config.AuthType.SESSION_TOKEN
auth
- public BaasBox.Builder setPort(int port)
port
- public BaasBox.Builder setApiBasepath(java.lang.String basepath)
basepath
- public BaasBox.Builder setHttpConnectionTimeout(int timeout)
timeout
- public BaasBox.Builder setHttpSocketTimeout(int timeout)
timeout
- public BaasBox.Builder setApiDomain(java.lang.String domain)
domain
- public BaasBox.Builder setAppCode(java.lang.String code)
code
- public BaasBox.Builder setUseHttps(boolean useHttps)
public BaasBox.Builder setWorkerThreads(int workers)
public BaasBox.Builder setRestClient(RestClient client)
public BaasBox init()
BaasBox
clientpublic <O extends Plugin.Options> BaasBox.Builder addPlugin(Plugin<O> plugin, O opt)
public BaasBox.Builder addPlugin(Plugin<Plugin.Options.Empty> plugin)