public static class SymwsClientConfig.Builder extends Object
Constructor and Description |
---|
Builder(String host,
String clientId)
Create a new Builder instance with the minimum required data.
|
Modifier and Type | Method and Description |
---|---|
SymwsClientConfig |
build()
Builds a new SymwsClientConfig using this Builder instance as a template.
|
SymwsClientConfig.Builder |
path(String path)
Overrides the default service path ("/") with the provided path.
|
SymwsClientConfig.Builder |
port(Integer port)
Overrides the default port (80) with the provided port number.
|
SymwsClientConfig.Builder |
protocol(String protocol)
Overrides the default protocol ("http") with the provided protocol.
|
SymwsClientConfig.Builder |
session(String sessionToken)
Provides a sessionToken to use when building the final SymwsClientConfig.
|
SymwsClientConfig.Builder |
session(String userId,
String password)
Provides a userId and password to use to retrieve a sessionToken when building the final SymwsClientConfig.
|
public Builder(String host, String clientId) throws NullPointerException, IllegalArgumentException
host
- the hostname or IP address of the server providing Symphony Web ServicesclientId
- the Symphony Web Services client ID to useNullPointerException
- if either the host or clientId are nullIllegalArgumentException
- if either the host or clientId are emptypublic SymwsClientConfig.Builder protocol(String protocol)
protocol
- the protocol to use with the service URI. If null, the default value will be restored.public SymwsClientConfig.Builder port(Integer port)
port
- the port to use with the service URI. If null, the default value will be restored.public SymwsClientConfig.Builder path(String path)
path
- the path to use with the service URI. If null, the default value will be restored.public SymwsClientConfig.Builder session(String userId, String password)
Note that if an error occurs while retrieving a sessionToken during SymwsClientConfig construction, no exception will be thrown. Rather, the resulting instance will simply have a null sessionToken. Use the SymwsClientConfig's hasSession() method after construction to verify the existence of a sessionToken.
userId
- the userId of the user to be authenticated. If null, no session info will be used with the final SymwsClientConfig.password
- the PIN/password of the user to be authenticatedpublic SymwsClientConfig.Builder session(String sessionToken)
sessionToken
- the session token to use. If null, no session info will be used with the final SymwsClientConfig.public SymwsClientConfig build()
Copyright © 2015. All rights reserved.