com.veriplace.client.factory
Class DefaultClientFactory

java.lang.Object
  extended by com.veriplace.client.factory.DefaultClientFactory
All Implemented Interfaces:
ClientFactory

public class DefaultClientFactory
extends java.lang.Object
implements ClientFactory

Factory for constructing Client instances from Properties.

The minimal properties file must contain:

 veriplace.application.consumer.key=<your consumer key>
 veriplace.application.consumer.secret=<your consumer secret>
 

It is also common to include:

 veriplace.application.token.value=<your application token>
 veriplace.application.token.secret=<your application token secret>
 

Other configuration properties are documented below and additional properties specific to your application can be added as needed. If you are unsure how to specify any of the above properties, consult the Veriplace Developer Portal.


Field Summary
static java.lang.String APPLICATION_TOKEN_SECRET
          The property key for the application-specific Access Token secret<: "veriplace.application.token.secret".
static java.lang.String APPLICATION_TOKEN_SECRET_PROPERTY
          Deprecated. Obsolete; use APPLICATION_TOKEN_SECRET.
static java.lang.String APPLICATION_TOKEN_VALUE
          The property key for the application-specific Access Token value, if any: "veriplace.application.token.value".
static java.lang.String APPLICATION_TOKEN_VALUE_PROPERTY
          Deprecated. Obsolete; use APPLICATION_TOKEN_VALUE.
static java.lang.String CALLBACK_EXCLUDE_PARAMETERS
          The property key for specifying the names of request parameters not to be copied to the callback URL, if you don't want all parameters to be copied: "veriplace.application.callback.exclude-params".
static java.lang.String CALLBACK_EXCLUDE_PARAMETERS_PROPERTY
          Deprecated. Obsolete; use CALLBACK_EXCLUDE_PARAMETERS.
static java.lang.String CALLBACK_HOST
          The property key for specifying the hostname for callback URLs, if it can't be detected automatically due to your network configuration: "veriplace.application.callback.host".
static java.lang.String CALLBACK_INCLUDE_PARAMETERS
          The property key for specifying the names of request parameters to be copied to the callback URL, if you don't want all parameters to be copied: "veriplace.application.callback.include-params".
static java.lang.String CALLBACK_INCLUDE_PARAMETERS_PROPERTY
          Deprecated. Obsolete; use CALLBACK_INCLUDE_PARAMETERS.
static java.lang.String CALLBACK_PATH
          The property key for specifying an exact subpath for callback URLs, if it can't be detected automatically due to your network configuration: "veriplace.callback.path".
static java.lang.String CALLBACK_PATH_PROPERTY
          Deprecated. Obsolete; use CALLBACK_PATH.
static java.lang.String CALLBACK_PORT
          The property key for specifying the port for callback URLs, if it can't be detected automatically due to your network configuration: "veriplace.application.callback.port".
static java.lang.String CALLBACK_PORT_PROPERTY
          Deprecated. Obsolete; use CALLBACK_PORT.
static java.lang.String CALLBACK_SERVER_NAME_PROPERTY
          Deprecated. Obsolete; use CALLBACK_HOST.
protected  ClientConfiguration clientConfiguration
           
static java.lang.String CONSUMER_KEY
          The property key for the OAuth consumer key: "veriplace.application.consumer.key".
static java.lang.String CONSUMER_KEY_PROPERTY
          Deprecated. Obsolete; use CONSUMER_KEY.
static java.lang.String CONSUMER_SECRET
          The property key for the OAuth consumer secret: "veriplace.application.consumer.secret".
static java.lang.String CONSUMER_SECRET_PROPERTY
          Deprecated. Obsolete; use CONSUMER_SECRET.
static java.lang.String DEFAULT_LOCATION_MODE
          The property key for specifying the default location mode for the GetLocation API, if any: "veriplace.application.location.mode".
static java.lang.String DEFAULT_LOCATION_MODE_PROPERTY
          Deprecated. Obsolete; use DEFAULT_LOCATION_MODE.
static java.lang.String PREFERRED_ENCODING
          The property key for specifying the desired API response encoding: "veriplace.client.encoding".
protected  java.util.Properties properties
           
static java.lang.String PROTOCOL
          The property key for the protocol version to use: "veriplace.server.protocol".
static java.lang.String REQUEST_TOKEN_STORE_DIRECTORY_PROPERTY
          Deprecated. Obsolete; use REQUEST_TOKEN_STORE_PATH.
static java.lang.String REQUEST_TOKEN_STORE_PATH
          The property key for specifying the root directory of the request token store, if using type "file".
static java.lang.String REQUEST_TOKEN_STORE_PROPERTY
          Deprecated. Obsolete; use REQUEST_TOKEN_STORE_TYPE.
static java.lang.String REQUEST_TOKEN_STORE_TYPE
          The property key for specifying the type of the request token store.
static java.lang.String REV_A_PROPERTY
          Deprecated. Obsolete; specify protocol name with PROTOCOL.
static java.lang.String SERVER_URI
          The property key for the Veriplace server URI: "veriplace.url".
static java.lang.String USE_LAST_KNOWN_LOCATION
          The property key for specifying a DefaultLocationFilter that can suppress location errors if there is a last known location: "veriplace.application.location.use-last-known".
static java.lang.String VERIPLACE_URL_PROPERTY
          Deprecated. Obsolete; use SERVER_URI.
 
Constructor Summary
DefaultClientFactory(java.util.Properties properties)
          Create a new factory from a Properties object.
DefaultClientFactory(java.util.Properties properties, TokenStore requestTokenStore)
          Deprecated. Use getClientConfiguration().setTokenStore().
 
Method Summary
 Client getClient()
           
 ClientConfiguration getClientConfiguration()
          Returns the ClientConfiguration object that will be used to construct a client.
 java.util.Properties getProperties()
           
 TokenStore getRequestTokenStore()
          Deprecated. Use getClientConfiguration().getTokenStore().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSUMER_KEY

public static final java.lang.String CONSUMER_KEY
The property key for the OAuth consumer key: "veriplace.application.consumer.key".

Since:
2.1
See Also:
ClientConfiguration.setConsumerKey(String), Constant Field Values

CONSUMER_KEY_PROPERTY

@Deprecated
public static final java.lang.String CONSUMER_KEY_PROPERTY
Deprecated. Obsolete; use CONSUMER_KEY.
See Also:
Constant Field Values

CONSUMER_SECRET

public static final java.lang.String CONSUMER_SECRET
The property key for the OAuth consumer secret: "veriplace.application.consumer.secret".

Since:
2.1
See Also:
ClientConfiguration.setConsumerSecret(String), Constant Field Values

CONSUMER_SECRET_PROPERTY

@Deprecated
public static final java.lang.String CONSUMER_SECRET_PROPERTY
Deprecated. Obsolete; use CONSUMER_SECRET.
See Also:
Constant Field Values

PROTOCOL

public static final java.lang.String PROTOCOL
The property key for the protocol version to use: "veriplace.server.protocol". The value should be the name of one of the constants in Revision. If not specified, defaults to ClientConfiguration.DEFAULT_PROTOCOL.

Since:
2.1
See Also:
ClientConfiguration.setProtocol(Revision), Constant Field Values

REV_A_PROPERTY

@Deprecated
public static final java.lang.String REV_A_PROPERTY
Deprecated. Obsolete; specify protocol name with PROTOCOL.
See Also:
Constant Field Values

APPLICATION_TOKEN_VALUE

public static final java.lang.String APPLICATION_TOKEN_VALUE
The property key for the application-specific Access Token value, if any: "veriplace.application.token.value".

Since:
2.1
See Also:
ClientConfiguration.setApplicationToken(Token), Constant Field Values

APPLICATION_TOKEN_VALUE_PROPERTY

@Deprecated
public static final java.lang.String APPLICATION_TOKEN_VALUE_PROPERTY
Deprecated. Obsolete; use APPLICATION_TOKEN_VALUE.
See Also:
Constant Field Values

APPLICATION_TOKEN_SECRET

public static final java.lang.String APPLICATION_TOKEN_SECRET
The property key for the application-specific Access Token secret<: "veriplace.application.token.secret".

Since:
2.1
See Also:
ClientConfiguration.setApplicationToken(Token), Constant Field Values

APPLICATION_TOKEN_SECRET_PROPERTY

@Deprecated
public static final java.lang.String APPLICATION_TOKEN_SECRET_PROPERTY
Deprecated. Obsolete; use APPLICATION_TOKEN_SECRET.
See Also:
Constant Field Values

CALLBACK_HOST

public static final java.lang.String CALLBACK_HOST
The property key for specifying the hostname for callback URLs, if it can't be detected automatically due to your network configuration: "veriplace.application.callback.host".

Since:
2.1
See Also:
ClientConfiguration.setCallbackServerName(String), Constant Field Values

CALLBACK_SERVER_NAME_PROPERTY

@Deprecated
public static final java.lang.String CALLBACK_SERVER_NAME_PROPERTY
Deprecated. Obsolete; use CALLBACK_HOST.
See Also:
Constant Field Values

CALLBACK_PORT

public static final java.lang.String CALLBACK_PORT
The property key for specifying the port for callback URLs, if it can't be detected automatically due to your network configuration: "veriplace.application.callback.port".

Since:
2.1
See Also:
ClientConfiguration.setCallbackServerPort(Integer), Constant Field Values

CALLBACK_PORT_PROPERTY

@Deprecated
public static final java.lang.String CALLBACK_PORT_PROPERTY
Deprecated. Obsolete; use CALLBACK_PORT.
See Also:
Constant Field Values

CALLBACK_PATH

public static final java.lang.String CALLBACK_PATH
The property key for specifying an exact subpath for callback URLs, if it can't be detected automatically due to your network configuration: "veriplace.callback.path".

Since:
2.1
See Also:
ClientConfiguration.setCallbackPath(String), Constant Field Values

CALLBACK_PATH_PROPERTY

@Deprecated
public static final java.lang.String CALLBACK_PATH_PROPERTY
Deprecated. Obsolete; use CALLBACK_PATH.
See Also:
Constant Field Values

CALLBACK_INCLUDE_PARAMETERS

public static final java.lang.String CALLBACK_INCLUDE_PARAMETERS
The property key for specifying the names of request parameters to be copied to the callback URL, if you don't want all parameters to be copied: "veriplace.application.callback.include-params". Value is a comma-delimited list.

Since:
2.1
See Also:
ClientConfiguration.setCallbackIncludeParameters(String[]), Constant Field Values

CALLBACK_INCLUDE_PARAMETERS_PROPERTY

@Deprecated
public static final java.lang.String CALLBACK_INCLUDE_PARAMETERS_PROPERTY
Deprecated. Obsolete; use CALLBACK_INCLUDE_PARAMETERS.
See Also:
Constant Field Values

CALLBACK_EXCLUDE_PARAMETERS

public static final java.lang.String CALLBACK_EXCLUDE_PARAMETERS
The property key for specifying the names of request parameters not to be copied to the callback URL, if you don't want all parameters to be copied: "veriplace.application.callback.exclude-params". Value is a comma-delimited list.

Since:
2.1
See Also:
ClientConfiguration.setCallbackExcludeParameters(String[]), Constant Field Values

CALLBACK_EXCLUDE_PARAMETERS_PROPERTY

@Deprecated
public static final java.lang.String CALLBACK_EXCLUDE_PARAMETERS_PROPERTY
Deprecated. Obsolete; use CALLBACK_EXCLUDE_PARAMETERS.
See Also:
Constant Field Values

SERVER_URI

public static final java.lang.String SERVER_URI
The property key for the Veriplace server URI: "veriplace.url". If not specified, defaults to ClientConfiguration.DEFAULT_SERVER_URI.

Since:
2.1
See Also:
ClientConfiguration.setServerUri(String), Constant Field Values

VERIPLACE_URL_PROPERTY

@Deprecated
public static final java.lang.String VERIPLACE_URL_PROPERTY
Deprecated. Obsolete; use SERVER_URI.
See Also:
Constant Field Values

REQUEST_TOKEN_STORE_TYPE

public static final java.lang.String REQUEST_TOKEN_STORE_TYPE
The property key for specifying the type of the request token store. Supported values are "memory" and "file".

See Also:
ClientConfiguration.setTokenStore(TokenStore), Constant Field Values

REQUEST_TOKEN_STORE_PROPERTY

public static final java.lang.String REQUEST_TOKEN_STORE_PROPERTY
Deprecated. Obsolete; use REQUEST_TOKEN_STORE_TYPE.
See Also:
Constant Field Values

REQUEST_TOKEN_STORE_PATH

public static final java.lang.String REQUEST_TOKEN_STORE_PATH
The property key for specifying the root directory of the request token store, if using type "file".

See Also:
ClientConfiguration.setTokenStore(TokenStore), Constant Field Values

REQUEST_TOKEN_STORE_DIRECTORY_PROPERTY

public static final java.lang.String REQUEST_TOKEN_STORE_DIRECTORY_PROPERTY
Deprecated. Obsolete; use REQUEST_TOKEN_STORE_PATH.
See Also:
Constant Field Values

DEFAULT_LOCATION_MODE

public static final java.lang.String DEFAULT_LOCATION_MODE
The property key for specifying the default location mode for the GetLocation API, if any: "veriplace.application.location.mode".

Since:
2.1
See Also:
ClientConfiguration.setLocationOptions(com.veriplace.client.LocationOptions), Constant Field Values

DEFAULT_LOCATION_MODE_PROPERTY

@Deprecated
public static final java.lang.String DEFAULT_LOCATION_MODE_PROPERTY
Deprecated. Obsolete; use DEFAULT_LOCATION_MODE.
See Also:
Constant Field Values

PREFERRED_ENCODING

public static final java.lang.String PREFERRED_ENCODING
The property key for specifying the desired API response encoding: "veriplace.client.encoding".

Since:
2.7
See Also:
ClientConfiguration.setPreferredEncoding(String), Constant Field Values

USE_LAST_KNOWN_LOCATION

public static final java.lang.String USE_LAST_KNOWN_LOCATION
The property key for specifying a DefaultLocationFilter that can suppress location errors if there is a last known location: "veriplace.application.location.use-last-known". Value is "true" or "false"; default is false.

Since:
2.1
See Also:
Constant Field Values

properties

protected final java.util.Properties properties

clientConfiguration

protected final ClientConfiguration clientConfiguration
Constructor Detail

DefaultClientFactory

public DefaultClientFactory(java.util.Properties properties)
                     throws ConfigurationException
Create a new factory from a Properties object.

The following properties are required:

The following properties are optional:

Throws:
ConfigurationException

DefaultClientFactory

@Deprecated
public DefaultClientFactory(java.util.Properties properties,
                                       TokenStore requestTokenStore)
                     throws ConfigurationException
Deprecated. Use getClientConfiguration().setTokenStore().

Throws:
ConfigurationException
Method Detail

getProperties

public java.util.Properties getProperties()

getClientConfiguration

public ClientConfiguration getClientConfiguration()
Returns the ClientConfiguration object that will be used to construct a client. You can change properties of this object before creating the client.

Since:
2.1

getRequestTokenStore

@Deprecated
public TokenStore getRequestTokenStore()
Deprecated. Use getClientConfiguration().getTokenStore().


getClient

public Client getClient()
                 throws ConfigurationException
Specified by:
getClient in interface ClientFactory
Throws:
ConfigurationException