com.googlecode.janrain4j.conf
Class Config

java.lang.Object
  extended by com.googlecode.janrain4j.conf.Config

public class Config
extends Object

User-configurable properties. In most cases it is not needed to create a Config manually. To create a Config programatically, the recommended way is to statically import Config.Builder.* and invoke the static build method followed by the desired instance mutators:

 import static com.googlecode.janrain4j.conf.Config.Builder.*;
 
 ...
 
 // specify API key
 Config config = build().apiKey(apiKey);
 
 // specify API key and proxy
 Config config = build().apiKey(apiKey).proxy(proxyHost, proxyPort);
 
 // overview of all configurable properties
 Config config = build()
         .apiKey(apiKey)
         .applicationID(applicationID)
         .applicationDomain(applicationDomain)
         .tokenUrl(tokenUrl)
         .languagePreference(languagePreference)
         .proxyHost(proxyHost)
         .proxyPort(proxyHost)
         .proxyUsername(proxyUsername)
         .proxyPassword(proxyPassword)
         .connectTimeout(connectTimeout)
         .readTimeout(readTimeout)
         .setStatusProviderNames(setStatusProviderNames)
         .activityProviderNames(activityProviderNames);
 

Since:
1.0
Author:
Marcel Overdijk

Nested Class Summary
static class Config.Builder
          Contains static creation methods for Config.
 
Field Summary
static List<String> DEFAULT_ACTIVITY_PROVIDER_NAMES
           
static List<String> DEFAULT_SET_STATUS_PROVIDER_NAMES
           
 
Method Summary
 Config activityProviderNames(List<String> providerNames)
          Sets the provider names which support the activity API call.
 Config apiKey(String apiKey)
          Sets the Janrain API key.
 Config applicationDomain(String applicationDomain)
          Sets the Janrain application domain.
 Config applicationID(String applicationID)
          Sets the Janrain application ID.
 Config connectTimeout(int timeout)
          Set the connect timeout, in milliseconds, to be used when opening the communications link to the resource.
 List<String> getActivityProviderNames()
          Returns the provider names which support the activity API call.
 String getApiKey()
          Returns the Janrain API key.
 String getApplicationDomain()
          Returns the Janrain application domain.
 String getApplicationID()
          Returns the Janrain application ID.
 int getConnectTimeout()
          Returns the connect timeout.
 String getLanguagePreference()
          Returns the language preference.
 String getProxyHost()
          Returns the proxy host.
 String getProxyPassword()
          Returns the proxy password.
 int getProxyPort()
          Returns the proxy port.
 String getProxyUsername()
          Returns the proxy username.
 int getReadTimeout()
          Returns the read timeout.
 List<String> getSetStatusProviderNames()
          Returns the provider names which support the set_status API call.
 String getTokenUrl()
          Returns the token url.
 Config languagePreference(String languagePreference)
          Sets the language preference.
 Config proxyHost(String host)
          Sets the proxy host.
 Config proxyPassword(String password)
          Sets the proxy password.
 Config proxyPort(int port)
          Sets the proxy port.
 Config proxyUsername(String username)
          Sets the proxy username.
 Config readTimeout(int timeout)
          Sets the read timeout, in milliseconds, to be used when reading from the input steam.
 Config setStatusProviderNames(List<String> providerNames)
          Sets the provider names which support the set_status API call.
 Config tokenUrl(String tokenUrl)
          Sets the token url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SET_STATUS_PROVIDER_NAMES

public static List<String> DEFAULT_SET_STATUS_PROVIDER_NAMES

DEFAULT_ACTIVITY_PROVIDER_NAMES

public static List<String> DEFAULT_ACTIVITY_PROVIDER_NAMES
Method Detail

getApiKey

public String getApiKey()
Returns the Janrain API key.


getApplicationID

public String getApplicationID()
Returns the Janrain application ID.


getApplicationDomain

public String getApplicationDomain()
Returns the Janrain application domain.


getTokenUrl

public String getTokenUrl()
Returns the token url.


getLanguagePreference

public String getLanguagePreference()
Returns the language preference.


getProxyHost

public String getProxyHost()
Returns the proxy host.


getProxyPort

public int getProxyPort()
Returns the proxy port.


getProxyUsername

public String getProxyUsername()
Returns the proxy username.


getProxyPassword

public String getProxyPassword()
Returns the proxy password.


getConnectTimeout

public int getConnectTimeout()
Returns the connect timeout.


getReadTimeout

public int getReadTimeout()
Returns the read timeout.


getSetStatusProviderNames

public List<String> getSetStatusProviderNames()
Returns the provider names which support the set_status API call.


getActivityProviderNames

public List<String> getActivityProviderNames()
Returns the provider names which support the activity API call.


apiKey

public Config apiKey(String apiKey)
Sets the Janrain API key.

Parameters:
apiKey - Your Janrain API key.
Returns:
this (for chaining)

applicationID

public Config applicationID(String applicationID)
Sets the Janrain application ID.

Parameters:
applicationID - The application ID.
Returns:
this (for chaining)

applicationDomain

public Config applicationDomain(String applicationDomain)
Sets the Janrain application domain.

Parameters:
applicationDomain - The application domain.
Returns:
this (for chaining)

tokenUrl

public Config tokenUrl(String tokenUrl)
Sets the token url.

Parameters:
tokenUrl - The token url.
Returns:
this (for chaining)

languagePreference

public Config languagePreference(String languagePreference)
Sets the language preference.

Parameters:
languagePreference - The language preference.
Returns:
this (for chaining)

proxyHost

public Config proxyHost(String host)
Sets the proxy host.

Parameters:
host - The proxy host.
Returns:
this (for chaining)

proxyPort

public Config proxyPort(int port)
Sets the proxy port.

Parameters:
port - The proxy port.
Returns:
this (for chaining)

proxyUsername

public Config proxyUsername(String username)
Sets the proxy username.

Parameters:
username - The proxy username.
Returns:
this (for chaining)

proxyPassword

public Config proxyPassword(String password)
Sets the proxy password.

Parameters:
password - The proxy password.
Returns:
this (for chaining)

connectTimeout

public Config connectTimeout(int timeout)
Set the connect timeout, in milliseconds, to be used when opening the communications link to the resource.

0 implies that the option is disabled (i.e., timeout of infinity).

Parameters:
timeout - The connect timeout value in milliseconds.
Returns:
this (for chaining)

readTimeout

public Config readTimeout(int timeout)
Sets the read timeout, in milliseconds, to be used when reading from the input steam.

0 implies that the option is disabled (i.e., timeout of infinity).

Parameters:
timeout - The read timeout value in milliseconds.
Returns:
this (for chaining)

setStatusProviderNames

public Config setStatusProviderNames(List<String> providerNames)
Sets the provider names which support the set_status API call.

Parameters:
providerNames - The provider names.
Returns:
this (for chaining)
Since:
1.1

activityProviderNames

public Config activityProviderNames(List<String> providerNames)
Sets the provider names which support the activity API call.

Parameters:
providerNames - The provider names.
Returns:
this (for chaining)
Since:
1.1


Copyright © 2010. All Rights Reserved.