com.veriplace.client
Class LocationRequestStatus

java.lang.Object
  extended by com.veriplace.client.AsyncRequestStatus
      extended by com.veriplace.client.LocationRequestStatus

public class LocationRequestStatus
extends AsyncRequestStatus

Holds information about the status of an asynchronous GetLocationAPI request.

Since:
2.6

Constructor Summary
LocationRequestStatus(java.lang.String id, User user)
           
LocationRequestStatus(java.lang.String id, User user, java.lang.Long locationId)
           
LocationRequestStatus(java.lang.String id, User user, java.lang.String mobileNumber)
           
LocationRequestStatus(java.lang.String id, User user, java.lang.String mobileNumber, GetLocationException exception)
           
LocationRequestStatus(java.lang.String id, User user, java.lang.String mobileNumber, Location location)
           
 
Method Summary
 GetLocationException getException()
          A PositionFailureException indicating the reason that the location could not be obtained, and possibly including a recent cached location.
 Location getLocation()
          The requested location, if the request has successfully completed and if the location details were included in the response.
 java.lang.Long getLocationId()
          The unique identifier of the requested location, if the request has successfully completed.
 java.lang.String getMobileNumber()
          The mobile number of the Veriplace user whose location was requested.
 User getUser()
          The Veriplace user identifier for the user whose location was requested.
 
Methods inherited from class com.veriplace.client.AsyncRequestStatus
getId, isFailed, isReady
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationRequestStatus

public LocationRequestStatus(java.lang.String id,
                             User user)

LocationRequestStatus

public LocationRequestStatus(java.lang.String id,
                             User user,
                             java.lang.String mobileNumber)

LocationRequestStatus

public LocationRequestStatus(java.lang.String id,
                             User user,
                             java.lang.String mobileNumber,
                             Location location)

LocationRequestStatus

public LocationRequestStatus(java.lang.String id,
                             User user,
                             java.lang.Long locationId)

LocationRequestStatus

public LocationRequestStatus(java.lang.String id,
                             User user,
                             java.lang.String mobileNumber,
                             GetLocationException exception)
Method Detail

getLocation

public Location getLocation()
The requested location, if the request has successfully completed and if the location details were included in the response.

The location details are included if you queried the result with GetLocationAPI.getResult(LocationRequestStatus), or if you used an extended callback - see CallbackOptions. If you used a summary callback (CallbackOptions.createSummaryCallback(String), then this property will be null and only getLocationId() will be available.


getLocationId

public java.lang.Long getLocationId()
The unique identifier of the requested location, if the request has successfully completed.

If the location details were not included in the response (i.e. if getLocation() returns null), you can pass the location ID to GetLocationAPI.getLocationById(com.veriplace.oauth.consumer.Token, User, long) to retrieve the location details.


getUser

public User getUser()
The Veriplace user identifier for the user whose location was requested.


getMobileNumber

public java.lang.String getMobileNumber()
The mobile number of the Veriplace user whose location was requested.

This property is provided in callback messages for convenience (in case your callback-processing logic prefers to use mobile numbers rather than Veriplace user IDs), but it is only provided if you used the extended callback format (see CallbackOptions) or if you queried the result with GetLocationAPI.getResult(LocationRequestStatus). If you used a summary callback, then this property will be null.


getException

public GetLocationException getException()
A PositionFailureException indicating the reason that the location could not be obtained, and possibly including a recent cached location. This will be present if the request itself was valid, but the device was not locatable at present.

Overrides:
getException in class AsyncRequestStatus