com.veriplace.client
Class LocationOptions

java.lang.Object
  extended by com.veriplace.client.LocationOptions
All Implemented Interfaces:
java.lang.Cloneable

public class LocationOptions
extends java.lang.Object
implements java.lang.Cloneable

Specifies optional parameters for a location request. These can include the following:

LocationOptions may be configured globally for the application in the client configuration (see ClientConfiguration.setLocationOptions(LocationOptions)); some of these can also be set in a properties file using property names defined by DefaultClientFactory. For any given GetLocationAPI request that takes a LocationOptions reference, if that reference is null or if one of the object's properties has not been set, the corresponding property from the global configuration will be used instead.

Since:
2.7
See Also:
GetLocationAPI.getLocation(com.veriplace.oauth.consumer.Token, User), GetLocationAPI.requestLocation(com.veriplace.oauth.consumer.Token, User, String, String)

Nested Class Summary
static class LocationOptions.ExtraInfo
          Enumeration of extended location data structures that can be requested.
 
Constructor Summary
LocationOptions()
          Creates a new LocationOptions object with no properties overridden.
 
Method Summary
 LocationOptions addExtraInfo(LocationOptions.ExtraInfo... extraInfo)
          Adds a set of desired LocationOptions.ExtraInfo options to the previously specified options.
 LocationOptions addFilter(LocationFilter locationFilter)
          Deprecated.  
 LocationOptions addMode(java.lang.String locationMode)
          Deprecated.  
 LocationOptions addTimeout(java.lang.Integer timeoutMilliseconds)
          Deprecated.  
 LocationOptions clone()
          Returns an exact copy of the LocationOptions object.
 LocationOptions.ExtraInfo[] getExtraInfo()
          Returns an array of all the LocationOptions.ExtraInfo options that have been set on this LocationOptions instance.
 LocationFilter getLocationFilter()
           
 java.lang.String getLocationMode()
           
 java.lang.Integer getTimeoutMilliseconds()
           
 boolean hasExtraInfo(LocationOptions.ExtraInfo extraInfo)
          Returns true if the specified LocationOptions.ExtraInfo option has been set.
 boolean isSuppressCachedPosition()
           
 LocationOptions setExtraInfo(LocationOptions.ExtraInfo... extraInfo)
           
 LocationOptions setLocationFilter(LocationFilter locationFilter)
          Specifies a LocationFilter to be applied to the result of the location request, or null for no filter.
 LocationOptions setLocationMode(java.lang.String locationMode)
          Specifies the desired LocationMode, or null to use the default mode.
 LocationOptions setSuppressCachedPosition(boolean suppressCachedPosition)
          Setting this property to true tells Veriplace not to return a cached position if there is a PositionFailureException.
 LocationOptions setTimeoutMilliseconds(java.lang.Integer timeoutMilliseconds)
          Specifies the timeout interval, or null for no timeout.
static LocationOptions withExtraInfo(LocationOptions.ExtraInfo... extraInfo)
          Returns a LocationOptions object specifying any number of desired LocationOptions.ExtraInfo types, with no other overridden properties.
static LocationOptions withFilter(LocationFilter filter)
          Returns a LocationOptions object specifying a LocationFilter, with no other overridden properties.
static LocationOptions withMode(java.lang.String locationMode)
          Returns a LocationOptions object specifying a LocationMode, with no other overridden properties.
static LocationOptions withTimeout(java.lang.Integer timeoutMilliseconds)
          Returns a LocationOptions object specifying a timeout interval, with no other overridden properties.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationOptions

public LocationOptions()
Creates a new LocationOptions object with no properties overridden.

Method Detail

getExtraInfo

public LocationOptions.ExtraInfo[] getExtraInfo()
Returns an array of all the LocationOptions.ExtraInfo options that have been set on this LocationOptions instance.


hasExtraInfo

public boolean hasExtraInfo(LocationOptions.ExtraInfo extraInfo)
Returns true if the specified LocationOptions.ExtraInfo option has been set.


setExtraInfo

public LocationOptions setExtraInfo(LocationOptions.ExtraInfo... extraInfo)
Parameters:
extraInfo - any number of LocationOptions.ExtraInfo constants
Returns:
the same LocationOptions instance.

getLocationFilter

public LocationFilter getLocationFilter()
See Also:
setLocationFilter(LocationFilter)

setLocationFilter

public LocationOptions setLocationFilter(LocationFilter locationFilter)
Specifies a LocationFilter to be applied to the result of the location request, or null for no filter.

Returns:
the same LocationOptions instance.

getLocationMode

public java.lang.String getLocationMode()
See Also:
setLocationMode(String)

setLocationMode

public LocationOptions setLocationMode(java.lang.String locationMode)
Specifies the desired LocationMode, or null to use the default mode.

Returns:
the same LocationOptions instance.

getTimeoutMilliseconds

public java.lang.Integer getTimeoutMilliseconds()
See Also:
setTimeoutMilliseconds(Integer)

setTimeoutMilliseconds

public LocationOptions setTimeoutMilliseconds(java.lang.Integer timeoutMilliseconds)
Specifies the timeout interval, or null for no timeout.

If a synchronous location request takes longer than the specified timeout interval, it will fail with a TransportException.

Returns:
the same LocationOptions instance.

isSuppressCachedPosition

public boolean isSuppressCachedPosition()
See Also:
setSuppressCachedPosition(boolean)

setSuppressCachedPosition

public LocationOptions setSuppressCachedPosition(boolean suppressCachedPosition)
Setting this property to true tells Veriplace not to return a cached position if there is a PositionFailureException. By default, Veriplace will return a cached position if one is available.

Returns:
the same LocationOptions instance.

withExtraInfo

public static LocationOptions withExtraInfo(LocationOptions.ExtraInfo... extraInfo)
Returns a LocationOptions object specifying any number of desired LocationOptions.ExtraInfo types, with no other overridden properties.


withFilter

public static LocationOptions withFilter(LocationFilter filter)
Returns a LocationOptions object specifying a LocationFilter, with no other overridden properties.


withMode

public static LocationOptions withMode(java.lang.String locationMode)
Returns a LocationOptions object specifying a LocationMode, with no other overridden properties.


withTimeout

public static LocationOptions withTimeout(java.lang.Integer timeoutMilliseconds)
Returns a LocationOptions object specifying a timeout interval, with no other overridden properties.


addExtraInfo

public LocationOptions addExtraInfo(LocationOptions.ExtraInfo... extraInfo)
Adds a set of desired LocationOptions.ExtraInfo options to the previously specified options.

Returns:
the same LocationOptions instance

addFilter

public LocationOptions addFilter(LocationFilter locationFilter)
Deprecated. 

Adds a LocationFilter to the previously specified options, returning a new instance.

Returns:
a new LocationOptions instance with the specified properties

addMode

public LocationOptions addMode(java.lang.String locationMode)
Deprecated. 

Adds a LocationMode to the previously specified options, returning a new instance.

Returns:
a new LocationOptions instance with the specified properties

addTimeout

public LocationOptions addTimeout(java.lang.Integer timeoutMilliseconds)
Deprecated. 

Adds a timeout interval to the previously specified options, returning a new instance.

Returns:
a new LocationOptions instance with the specified properties

clone

public LocationOptions clone()
Returns an exact copy of the LocationOptions object.

Overrides:
clone in class java.lang.Object