com.esri.mKit
Class ArcWebServiceProxy

java.lang.Object
  |
  +--com.esri.mKit.ArcWebServiceProxy

public class ArcWebServiceProxy
extends java.lang.Object

This class allows access to functionality and data available in ArcWeb Services. The properties of this class establish a connection with ArcWeb Services, and the methods initiate specific functional requests.


Field Summary
protected  java.lang.String sg
           
protected  java.lang.String token
           
protected  java.lang.String url
           
 
Constructor Summary
ArcWebServiceProxy(java.lang.String url, java.lang.String sg, java.lang.String token)
          Initializes an ArcWebServiceProxy object using values passed in the parameters.
 
Method Summary
 void cancel()
          Cancels all existing requests and closes all open streams and connections.
 java.util.Vector doAddPoiRequest(com.esri.mKit.POI[] pois, java.util.Hashtable name2fields)
          Adds a point feature (POI) to a data file accessible through the Data Manager web service.
 java.lang.String doDeletePoiRequest(java.lang.String[] poiIds)
          Removes a point feature (POI) from a data file accessible through the Data Manager web service.
 com.esri.mKit.GeocodeResponse doGeocodeByAddressRequest(com.esri.mKit.Address address)
          Requests the location of an address or place.
 com.esri.mKit.GeocodeResponse doGeocodeByLandLineRequest(java.lang.String phone)
          Requests the location of a land line phone number.
 com.esri.mKit.MappedResponse doGeocodeMapByAddressRequest(com.esri.mKit.Address address, int width, int height)
          Requests the location and a map of a specific mobile device.
 com.esri.mKit.MappedResponse doGeocodeMapByLandLineRequest(java.lang.String phoneNumber, int width, int height)
          Requests the location and a map of a land line phone number.
 com.esri.mKit.POI[] doGetListRequest(java.util.Vector fields, java.util.Hashtable name2fields, int start, int count)
          Returns an array of POI features from a data file accessible through the Data Manager Web Service.
 com.esri.mKit.MappedResponse doLocationMapRequest(java.lang.String locId, int width, int height)
          Requests the location and a map of a specific mobile device.
 com.esri.mKit.MappedResponse doMapByUrlRequest(java.lang.String url)
          Requests a map image that already has been created and is accessible from a URL.
 com.esri.mKit.MappedResponse doMapRequest(com.esri.mKit.Point[] point, int width, int height, com.esri.mKit.Envelope env)
          Requests a map of a certain area.
 com.esri.mKit.POIResponse doQueryRequest(java.lang.Object shpObj, java.lang.String maxC, java.lang.String startC, int width, int height, java.util.Vector rFields, java.util.Vector filters)
          Requests point and attribute information from a spatial query Web Service that matches a certain search criteria, as well as a map showing the location of the search results.
 com.esri.mKit.GeocodeResponse doReverseGeocodeRequest(java.lang.String x, java.lang.String y)
          Requests an interpolated address of a point location.
 com.esri.mKit.MappedResponse doRouteMapRequest(java.lang.Object[] objList, int width, int height, com.esri.mKit.Envelope env, boolean rteMap, java.lang.String rteType, java.lang.String hwyPref)
          Requests multiple-stop driving directions and a route map.
 java.lang.String doUpdatePoiRequest(com.esri.mKit.POI[] pois, java.util.Hashtable name2fields)
          Updates a point feature (POI) in a data file accessible through the Data Manager web service.
 void setCustomMapDataSource(java.lang.String customMapDataSource)
          Overrides the Map Image service referred to by the service group defined in the ArcWebServiceProxy.sg property for specific map requests.
 void setCustomQueryDataSource(java.lang.String customQueryDataSource)
          Overrides the Spatial Query service referred to by the service group defined in the ArcWebServiceProxy.sg property for specific query requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

protected java.lang.String url

sg

protected java.lang.String sg

token

protected java.lang.String token
Constructor Detail

ArcWebServiceProxy

public ArcWebServiceProxy(java.lang.String url,
                          java.lang.String sg,
                          java.lang.String token)
Initializes an ArcWebServiceProxy object using values passed in the parameters.

Parameters:
url - The URL to ArcWeb Services for mobile toolkit users. The correct url is "http://www.arcwebservices.com/services/v2006/servlet/LBSConnector".
sg - The String value specifying which service group requests ArcWeb Services should use. Valid values listed here.
token - Token required for Authentication. Retrieved from TokenServiceProxy.
Method Detail

setCustomMapDataSource

public void setCustomMapDataSource(java.lang.String customMapDataSource)
Overrides the Map Image service referred to by the service group defined in the ArcWebServiceProxy.sg property for specific map requests.


setCustomQueryDataSource

public void setCustomQueryDataSource(java.lang.String customQueryDataSource)
Overrides the Spatial Query service referred to by the service group defined in the ArcWebServiceProxy.sg property for specific query requests.


cancel

public void cancel()
            throws java.lang.Exception
Cancels all existing requests and closes all open streams and connections. It is advisable to spawn a new thread and have that thread call this method to guarantee execution of this method.

Throws:
java.lang.Exception - If any error occurs.

doLocationMapRequest

public com.esri.mKit.MappedResponse doLocationMapRequest(java.lang.String locId,
                                                         int width,
                                                         int height)
                                                  throws java.lang.Exception
Requests the location and a map of a specific mobile device.

Parameters:
locId - The string id of the wireless device which is unique to the device and is used for locating the device on the cell phone network.
width - The width of the map image requested from the server.
height - The height of the map image requested from the server.
Returns:
A MappedResponse object, which contains location information and a map.
Throws:
java.lang.Exception - If any error occurs.

doMapRequest

public com.esri.mKit.MappedResponse doMapRequest(com.esri.mKit.Point[] point,
                                                 int width,
                                                 int height,
                                                 com.esri.mKit.Envelope env)
                                          throws java.lang.Exception
Requests a map of a certain area. Points can be overlayed on these maps.

Parameters:
point - An array of Point objects used to display points on the map.
width - The width of the map image requested from the server.
height - The height of the map image requested from the server.
env - The envelope area of the map image requested.
Returns:
A MappedResponse object, which contains a map.
Throws:
java.lang.Exception - If any error occurs.

doMapByUrlRequest

public com.esri.mKit.MappedResponse doMapByUrlRequest(java.lang.String url)
                                               throws java.lang.Exception
Requests a map image that already has been created and is accessible from a URL.

Parameters:
url - The URL where the map image is available.
Returns:
A MappedResponse object, which contains a map.
Throws:
java.lang.Exception - If any error occurs.

doGeocodeByAddressRequest

public com.esri.mKit.GeocodeResponse doGeocodeByAddressRequest(com.esri.mKit.Address address)
                                                        throws java.lang.Exception
Requests the location of an address or place.

Parameters:
address - The address being geocoded. If the address has multiple candidates, an array of Address objects is returned.
Returns:
A GeocodeResponse object.
Throws:
java.lang.Exception - If any error occurs.

doGeocodeByLandLineRequest

public com.esri.mKit.GeocodeResponse doGeocodeByLandLineRequest(java.lang.String phone)
                                                         throws java.lang.Exception
Requests the location of a land line phone number.

Parameters:
phone - The phone number being found.
Returns:
A GeocodeResponse object.
Throws:
java.lang.Exception - If any error occurs.

doGeocodeMapByAddressRequest

public com.esri.mKit.MappedResponse doGeocodeMapByAddressRequest(com.esri.mKit.Address address,
                                                                 int width,
                                                                 int height)
                                                          throws java.lang.Exception
Requests the location and a map of a specific mobile device.

Parameters:
address - The address being geocoded and mapped. If the address has multiple candidates, the first candidate will be returned.
width - The width of the map image requested from the server.
height - The height of the map image requested from the server.
Returns:
A MappedResponse object, which contains the location of the requested address and a map.
Throws:
java.lang.Exception - If any error occurs.

doGeocodeMapByLandLineRequest

public com.esri.mKit.MappedResponse doGeocodeMapByLandLineRequest(java.lang.String phoneNumber,
                                                                  int width,
                                                                  int height)
                                                           throws java.lang.Exception
Requests the location and a map of a land line phone number.

Parameters:
phoneNumber - The phone number being found and mapped.
width - The width of the map image requested from the server.
height - The height of the map image requested from the server.
Returns:
A MappedResponse object, which contains the location of the requested phone number and a map.
Throws:
java.lang.Exception - If any error occurs.

doReverseGeocodeRequest

public com.esri.mKit.GeocodeResponse doReverseGeocodeRequest(java.lang.String x,
                                                             java.lang.String y)
                                                      throws java.lang.Exception
Requests an interpolated address of a point location.

Parameters:
x - The X coordinate of the Point.
y - The Y coordinate of the Point.
Returns:
A GeocodeResponse object.
Throws:
java.lang.Exception - If any error occurs.

doRouteMapRequest

public com.esri.mKit.MappedResponse doRouteMapRequest(java.lang.Object[] objList,
                                                      int width,
                                                      int height,
                                                      com.esri.mKit.Envelope env,
                                                      boolean rteMap,
                                                      java.lang.String rteType,
                                                      java.lang.String hwyPref)
                                               throws java.lang.Exception
Requests multiple-stop driving directions and a route map.

Parameters:
objList - An array of either Address or Point objects between which the route has to be determined. The first element will always be the starting point, the second will always be the end point, and the third, fourth and fifth elements will be the way points.
width - The width of the route map image requested from the server.
height - The height of the route map image requested from the server.
env - The envelope area of the route map image requested. Only used if rteMap=true.
rteMap - A flag indicating if it is a request for a turn image (true) or a complete route (false).
rteType - Determines if the shortest or quickest route should be generated. Valid values are "shortest | quickest".
hwyPref - Contains the preference for using highways. Valid values are between "1" and "100". The value of "1" means to avoid highways if possible, and the value of "100" means to use highways as much as possible. Default value is "80". If you set the value to "0", hwyPref defaults to "80". hwyPref is not used with routeType "shortest".
Returns:
A MappedResponse object, which contains route information and a map.
Throws:
java.lang.Exception - If any error occurs.

doQueryRequest

public com.esri.mKit.POIResponse doQueryRequest(java.lang.Object shpObj,
                                                java.lang.String maxC,
                                                java.lang.String startC,
                                                int width,
                                                int height,
                                                java.util.Vector rFields,
                                                java.util.Vector filters)
                                         throws java.lang.Exception
Requests point and attribute information from a spatial query Web Service that matches a certain search criteria, as well as a map showing the location of the search results.

Parameters:
shpObj - The input search point.
maxC - The maximum number of records that can be returned from a single request.
startC - An index number indicating what record to start with when retrieving results.
width - The width of the poi map image requested from the server.
height - The height of the poi map image requested from the server.
rFields - A vector of field names that are to be returned from a specific query.
filters - A vector of QueryFilter objects that controls which features are returned from a specific query.
Returns:
A POIResponse object.
Throws:
java.lang.Exception - If any error occurs.

doDeletePoiRequest

public java.lang.String doDeletePoiRequest(java.lang.String[] poiIds)
                                    throws java.lang.Exception
Removes a point feature (POI) from a data file accessible through the Data Manager web service. You must set POI DB before invoking this method. POI DB can be specified using IServiceProxy#setCustomQueryDataSource("") method.

Parameters:
poiIds - An array of feature IDs to be deleted from the POI DB.
Returns:
A confirmation "Success" string from the server after processing the request.
Throws:
java.lang.Exception - If any error occurs.

doAddPoiRequest

public java.util.Vector doAddPoiRequest(com.esri.mKit.POI[] pois,
                                        java.util.Hashtable name2fields)
                                 throws java.lang.Exception
Adds a point feature (POI) to a data file accessible through the Data Manager web service. You must set POI DB before invoking this method. POI DB can be specified using IServiceProxy#setCustomQueryDataSource("") method.

Parameters:
pois - The array of POI features to be added to the POI data file.
name2fields - Mapping between POI attribute and POI data file's fields. This hashtable maps hardcoded attribute names to actual field(if they differ from defaults) in the data file. List of hardcoded attributes (@see com.esri.lbs.util.CPoi): "name" - NAME field, default - "STRING1" "type" - TYPE field, default - "STRING10" "code" - CODE/CATEGORY field, default - "STRING11" "ph" - PHONE, default - "STRING9" "bld" - Building number, default - "STRING2" "str" - Street, default - "STRING3" "istr" - Streets Intersection, default - "STRING4" "zip" - Postal code, default - "STRING5" "city", default - "STRING6" "stt" - State/Province, default - "STRING7" "ctry" - Country, default - "STRING8" For example, name2fields can have such entries: "ph"->"NEXTEL_PHONE_NUMBER" ("NEXTEL_PHONE_NUMBER") is custom, user-defined field.
Returns:
A collection of assigned feature IDs.
Throws:
java.lang.Exception - If any error occurs.

doUpdatePoiRequest

public java.lang.String doUpdatePoiRequest(com.esri.mKit.POI[] pois,
                                           java.util.Hashtable name2fields)
                                    throws java.lang.Exception
Updates a point feature (POI) in a data file accessible through the Data Manager web service. You must set POI DB before invoking this method. POI DB can be specified using IServiceProxy#setCustomQueryDataSource("") method.

Parameters:
pois - The array of POI features to be updated in the POI data file.
name2fields - Mapping between POI attribute and POI data file's fields. This hashtable maps hardcoded attribute names to actual field(if they differ from defaults) in the data file. List of hardcoded attributes (@see com.esri.lbs.util.CPoi): "name" - NAME field, default - "STRING1" "type" - TYPE field, default - "STRING10" "code" - CODE/CATEGORY field, default - "STRING11" "ph" - PHONE, default - "STRING9" "bld" - Building number, default - "STRING2" "str" - Street, default - "STRING3" "istr" - Streets Intersection, default - "STRING4" "zip" - Postal code, default - "STRING5" "city", default - "STRING6" "stt" - State/Province, default - "STRING7" "ctry" - Country, default - "STRING8" For example, name2fields can have such entries: "ph"->"NEXTEL_PHONE_NUMBER" ("NEXTEL_PHONE_NUMBER") is custom, user-defined field.
Returns:
A collection of assigned feature IDs.
Throws:
java.lang.Exception - If any error occurs.

doGetListRequest

public com.esri.mKit.POI[] doGetListRequest(java.util.Vector fields,
                                            java.util.Hashtable name2fields,
                                            int start,
                                            int count)
                                     throws java.lang.Exception
Returns an array of POI features from a data file accessible through the Data Manager Web Service. You must set POI DB before invoking this method. POI DB can be specified using IServiceProxy#setCustomQueryDataSource("") method.

Parameters:
fields - The data file fields to return, for example, {"name", "ph"}.
start - An index number indicating what record to start with when retrieving results.
count - The maximum number of records that can be returned from a single request.
Returns:
Array of POI objects.
Throws:
java.lang.Exception - If any error occurs.


Copyright © 2001 by Environmental Systems Research Institute Inc. All Rights Reserved.