net.rim.device.api.lbs
Class LocatorException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--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 getHTTPCode()), but may be -1 if no HTTP connection was established.

Since:
JDE 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_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 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_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, 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

AMBIGUOUS_ADDRESS

public static final int AMBIGUOUS_ADDRESS
The address results in mutiple choices. Only applicable for Batch Geocoding.
Since:
JDE 4.7.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.
Since:
JDE 4.6.0

CITY_NOT_FOUND

public static final int CITY_NOT_FOUND
City was not found.
Since:
JDE 4.6.0

CITY_NOT_SPECIFIED

public static final int CITY_NOT_SPECIFIED
The city was not specified and must be in the request.
Since:
JDE 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.
Since:
JDE 4.7.0

DATA_UNAVAILABLE

public static final int DATA_UNAVAILABLE
Address is out of data coverage.
Since:
JDE 4.7.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.
Since:
JDE 4.7.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.
Since:
JDE 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..
Since:
JDE 4.7.0

INVALID_COORDINATE

public static final int INVALID_COORDINATE
The provided lat/lon coordinate is invalid.
Since:
JDE 4.7.0

INVALID_COUNTRY

public static final int INVALID_COUNTRY
The submitted country was invalid.
Since:
JDE 4.6.0

INVALID_POSTAL_CODE

public static final int INVALID_POSTAL_CODE
The postal code is invalid.
Since:
JDE 4.7.0

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.
Since:
JDE 4.6.0

INVALID_STATE

public static final int INVALID_STATE
The submitted state/province was invalid.
Since:
JDE 4.6.0

INVALID_STATE_AND_COUNTRY

public static final int INVALID_STATE_AND_COUNTRY
Both the submitted state/province and country were invalid.
Since:
JDE 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.
Since:
JDE 4.6.0

MALFORMED_INTERSECTION_ADDRESS

public static final int MALFORMED_INTERSECTION_ADDRESS
The request failed because the intersection address was malformed.
Since:
JDE 4.6.0

MAX_LIMIT_EXCEEDED

public static final int MAX_LIMIT_EXCEEDED
The max number of requets/batch is exceeded.
Since:
JDE 4.7.0

REDIRECT

public static final int REDIRECT
This address is in a restricted region.
Since:
JDE 4.7.0

SERVER_INTERNAL_ERROR

public static final int SERVER_INTERNAL_ERROR
A server internal error.
Since:
JDE 4.6.0

SPECIFY_CITY

public static final int SPECIFY_CITY
The request requires city to be specified.
Since:
JDE 4.6.0

SPECIFY_COUNTRY

public static final int SPECIFY_COUNTRY
The request requires country to be specified.
Since:
JDE 4.6.0

SPECIFY_STATE_PROVINCE

public static final int SPECIFY_STATE_PROVINCE
The request requires state/province to be specified.
Since:
JDE 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.
Since:
JDE 4.7.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.
Since:
JDE 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.
Since:
JDE 4.6.0

UNSUPPORTED_CHARACTER

public static final int UNSUPPORTED_CHARACTER
The request contained unsupported characters, including any wildcards in the search request.
Since:
JDE 4.6.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:
JDE 4.6.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:
JDE 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:
JDE 4.6.0



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.