net.rim.device.api.lbs
Class LocatorException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by net.rim.device.api.lbs.LocatorException

public class LocatorException
extends Exception

A LocatorException is thrown when a Locator request fails.
Contained are the reasons for the request failure. If there is a problem with the transport, the HTTP error code can be attained (see LocatorException.getHTTPCode()), but may be -1 if no HTTP connection was established.

Since:
BlackBerry API 4.6.0

Field Summary
static int AMBIGUOUS_ADDRESS
          The address results in mutiple choices.
static int CITY_AMBIGUOUS_PLEASE_SPECIFY_STATE
          The request was invalid because the city was considered to be ambiguous and needs to have the state/province specified.
static int CITY_COUNTRY_MISMATCH
          City mismatches the country.
static int CITY_NOT_FOUND
          City was not found.
static int CITY_NOT_SPECIFIED
          The city was not specified and must be in the request.
static int CITY_POSTAL_CODE_MISMATCH
          Postal code matches country and state but mismatches the postal code set for the city.
static int CITY_STATE_MISMATCH
          City did not match the state.
static int COUNTRY_POSTAL_CODE_MISMATCH
          Country mismatches the postal code.
static int DATA_UNAVAILABLE
          Address is out of data coverage.
static int DATA_UNAVAILABLE_FOR_SPECIFIED_ADMIN_LEVEL
          The bounding box data for the specified admin level in that region is unavailable.
static int INVALID_ADDRESS_NUMBER
          The address number was invalid because it was a negative number, 6+ digit number, or unrecognizable.
static int INVALID_ADMIN_LEVEL
          The admin level specified in the Reverse Geocoding with bounding box request is unknown to the server..
static int INVALID_COORDINATE
          The provided lat/lon coordinate is invalid.
static int INVALID_COUNTRY
          The submitted country was invalid.
static int INVALID_POSTAL_CODE
          The postal code is invalid.
static int INVALID_REQUEST
          The request was invalid due to, but not limited to: request is empty, incomplete data, or failed to decode request message.
static int INVALID_STATE
          The submitted state/province was invalid.
static int INVALID_STATE_AND_COUNTRY
          Both the submitted state/province and country were invalid.
static int ITEM_NOT_FOUND
          When an item is not found, it can include the city, street, address.
static int MALFORMED_INTERSECTION_ADDRESS
          The request failed because the intersection address was malformed.
static int MAX_LIMIT_EXCEEDED
          The max number of requets/batch is exceeded.
static int REDIRECT
          This address is in a restricted region.
static int SERVER_BUSY
          Server is currently busy so it cannot fulfill client's request.
static int SERVER_INTERNAL_ERROR
          A server internal error.
static int SPECIFY_CITY
          The request requires city to be specified.
static int SPECIFY_COUNTRY
          The request requires country to be specified.
static int SPECIFY_STATE_PROVINCE
          The request requires state/province to be specified.
static int STATE_POSTAL_CODE_MISMATCH
          Postal code matches country but does not match the state.
static int TOO_MANY_ITEMS
          The server got too many returned items from the query that it could not effectively perform a sort to get the first twenty.
static int UNSUPPORTED_ADDRESS_TYPE
          Unsupported address type means that only numeric address types are supported.
static int UNSUPPORTED_CHARACTER
          The request contained unsupported characters, including any wildcards in the search request.
 
Constructor Summary
LocatorException(int errorCode)
          Constructor.
LocatorException(int errorCode, String message, int httpCode)
          Constructor.
 
Method Summary
 int getErrorCode()
          Returns the error code for a failed geocoding request.
 int getHTTPCode()
          Returns the request's HTTP error code, as defined by HTTP_* in javax.microedition.io.HttpConnection.
 
Methods inherited from class java.lang.Throwable
getMessage, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 



Field Detail

INVALID_REQUEST

public static final int INVALID_REQUEST
The request was invalid due to, but not limited to: request is empty, incomplete data, or failed to decode request message.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

SERVER_INTERNAL_ERROR

public static final int SERVER_INTERNAL_ERROR
A server internal error.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

UNSUPPORTED_ADDRESS_TYPE

public static final int UNSUPPORTED_ADDRESS_TYPE
Unsupported address type means that only numeric address types are supported. For example, 115/32 Main St. will fail.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

INVALID_ADDRESS_NUMBER

public static final int INVALID_ADDRESS_NUMBER
The address number was invalid because it was a negative number, 6+ digit number, or unrecognizable.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

ITEM_NOT_FOUND

public static final int ITEM_NOT_FOUND
When an item is not found, it can include the city, street, address.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

TOO_MANY_ITEMS

public static final int TOO_MANY_ITEMS
The server got too many returned items from the query that it could not effectively perform a sort to get the first twenty.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

UNSUPPORTED_CHARACTER

public static final int UNSUPPORTED_CHARACTER
The request contained unsupported characters, including any wildcards in the search request.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

INVALID_STATE

public static final int INVALID_STATE
The submitted state/province was invalid.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

INVALID_COUNTRY

public static final int INVALID_COUNTRY
The submitted country was invalid.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

INVALID_STATE_AND_COUNTRY

public static final int INVALID_STATE_AND_COUNTRY
Both the submitted state/province and country were invalid.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

CITY_NOT_FOUND

public static final int CITY_NOT_FOUND
City was not found.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

CITY_STATE_MISMATCH

public static final int CITY_STATE_MISMATCH
City did not match the state.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

CITY_AMBIGUOUS_PLEASE_SPECIFY_STATE

public static final int CITY_AMBIGUOUS_PLEASE_SPECIFY_STATE
The request was invalid because the city was considered to be ambiguous and needs to have the state/province specified.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

MALFORMED_INTERSECTION_ADDRESS

public static final int MALFORMED_INTERSECTION_ADDRESS
The request failed because the intersection address was malformed.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

CITY_NOT_SPECIFIED

public static final int CITY_NOT_SPECIFIED
The city was not specified and must be in the request.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

SPECIFY_CITY

public static final int SPECIFY_CITY
The request requires city to be specified.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

SPECIFY_STATE_PROVINCE

public static final int SPECIFY_STATE_PROVINCE
The request requires state/province to be specified.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

SPECIFY_COUNTRY

public static final int SPECIFY_COUNTRY
The request requires country to be specified.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

INVALID_POSTAL_CODE

public static final int INVALID_POSTAL_CODE
The postal code is invalid.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

CITY_POSTAL_CODE_MISMATCH

public static final int CITY_POSTAL_CODE_MISMATCH
Postal code matches country and state but mismatches the postal code set for the city. This is more of a placeholder for when we get data with the required precision.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

STATE_POSTAL_CODE_MISMATCH

public static final int STATE_POSTAL_CODE_MISMATCH
Postal code matches country but does not match the state.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

REDIRECT

public static final int REDIRECT
This address is in a restricted region.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

AMBIGUOUS_ADDRESS

public static final int AMBIGUOUS_ADDRESS
The address results in mutiple choices. Only applicable for Batch Geocoding.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

MAX_LIMIT_EXCEEDED

public static final int MAX_LIMIT_EXCEEDED
The max number of requets/batch is exceeded.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

INVALID_COORDINATE

public static final int INVALID_COORDINATE
The provided lat/lon coordinate is invalid.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

INVALID_ADMIN_LEVEL

public static final int INVALID_ADMIN_LEVEL
The admin level specified in the Reverse Geocoding with bounding box request is unknown to the server..

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

DATA_UNAVAILABLE_FOR_SPECIFIED_ADMIN_LEVEL

public static final int DATA_UNAVAILABLE_FOR_SPECIFIED_ADMIN_LEVEL
The bounding box data for the specified admin level in that region is unavailable.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

DATA_UNAVAILABLE

public static final int DATA_UNAVAILABLE
Address is out of data coverage.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

SERVER_BUSY

public static final int SERVER_BUSY
Server is currently busy so it cannot fulfill client's request.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

COUNTRY_POSTAL_CODE_MISMATCH

public static final int COUNTRY_POSTAL_CODE_MISMATCH
Country mismatches the postal code.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0

CITY_COUNTRY_MISMATCH

public static final int CITY_COUNTRY_MISMATCH
City mismatches the country.

See Also:
Constant Field Values
Since:
BlackBerry API 5.0.0


Constructor Detail

LocatorException

public LocatorException(int errorCode,
                        String message,
                        int httpCode)
Constructor.

Parameters:
errorCode - the error code as defined in Locator
message - optional message relating to request failure. May be null.
httpCode - the HTTP code from the server request, as defined by HTTP_* in javax.microedition.io.HttpConnection. Can be -1 if unknown.
Since:
BlackBerry API 4.6.0

LocatorException

public LocatorException(int errorCode)
Constructor.

Parameters:
errorCode - the error code as defined in Locator
Since:
BlackBerry API 6.0.0


Method Detail

getErrorCode

public int getErrorCode()
Returns the error code for a failed geocoding request.

Returns:
error code for the failed Locator request.
Since:
BlackBerry API 4.6.0

getHTTPCode

public int getHTTPCode()
Returns the request's HTTP error code, as defined by HTTP_* in javax.microedition.io.HttpConnection.

Returns:
HTTP error code; may be -1 if not set from HTTP header.
Since:
BlackBerry API 4.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal