com.esri.arcgis.location
Interface IInitGeocodeServer

All Superinterfaces:
Serializable
All Known Implementing Classes:
GeocodeServer

public interface IInitGeocodeServer
extends Serializable

Provides access to members for initializing a geocode server.

Remarks

This interface is available only if the GeocodeServer was obtained for use in a stateful manner (i.e., either by co-creating the GeocodeServer object or by obtaining a reference using a GISServerConnection object.)

When To Use

Use the IInitGeocodeServer interface to define the properties of a GeocodeServer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void attachToLocator(ILocatorName locName)
          Attach this service to the locator specified by the locator name.
 String getAdjustableProperties()
          The list of properties (comma delimited) that can be modified at runtime (for a given method).
 int getSuggestedBatchSize()
          The suggested number of addresses to send to a server in one batch request.
 void setAdjustableProperties(String propertyList)
          The list of properties (comma delimited) that can be modified at runtime (for a given method).
 void setSuggestedBatchSize(int size)
          The suggested number of addresses to send to a server in one batch request.
 

Method Detail

attachToLocator

void attachToLocator(ILocatorName locName)
                     throws IOException,
                            AutomationException
Attach this service to the locator specified by the locator name. This is the locator that the service will use internally.

Remarks

To create a new GeocodeServer in a Desktop or Engine environment, simply create a new GeocodeServer object and attach the address locator on which you want to base the GeocodeServer using the AttachToLocator method.

    Dim pLocatorManager As esriLocation.ILocatorManager

    Dim pLocatorWorkspace As esriGeoDatabase.ILocatorWorkspace

    Dim pLocatorName As esriGeoDatabase.ILocatorName

    Dim pInitGeocodeServer As esriLocation.IInitGeocodeServer



    '+++ get a reference to the locator on which to base the GeocodeServer

    Set pLocatorManager = New esriLocation.LocatorManager

    Set pLocatorWorkspace = _

        pLocatorManager.GetLocatorWorkspaceFromPath("D:\Workspace\ArcGIS Developer Help\GeocodeServer")

    Set pLocatorName = pLocatorWorkspace.GetLocatorName("Redlands Streets")



    '+++ create a new GeocodeServer

    Set pInitGeocodeServer = New esriLocation.GeocodeServer

    pInitGeocodeServer.AttachToLocator pLocatorName

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
locName - A reference to a com.esri.arcgis.geodatabase.ILocatorName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAdjustableProperties

String getAdjustableProperties()
                               throws IOException,
                                      AutomationException
The list of properties (comma delimited) that can be modified at runtime (for a given method).

Remarks

The IInitGeocodeServer interface is available only if the GeocodeServer was obtained for use in a stateful manner (i.e., either by co-creating the GeocodeServer object or by obtaining a reference using a GISServerConnection object.)

The AdjustableProperties method returns a comma-delimited string containing the list of properties that a user or developer can modify at runtime when using a GeocodeServer. Use this method to inspect and restrict the set of properties that users and developers can modify. Refer to the IGeocodeServer::GetLocatorProperties method for a list of property names that can be used.

The following example illustrates how to modify the set of adjustable properties so that users and developers cannot change the minimum candidate score used by the GeocodeServer at runtime:

Public Sub SetAdjustableProperties()

    Dim pGISServerConnection As esriServer.IGISServerConnection

    Dim pServerObjectManager As esriServer.IServerObjectManager

    Dim pServerContext As esriServer.IServerContext

    Dim pInitGeocodeServer As esriLocation.IInitGeocodeServer

    Dim varAdjustableProperties As Variant

    Dim strAdjustableProperties() As String

    Dim lngPropertyIndex As Long



    On Error GoTo ErrorHandler



    '+++ connect to an ArcGIS Server and get the server object manager

    Set pGISServerConnection = New esriServer.GISServerConnection

    pGISServerConnection.Connect ("napanee")

    Set pServerObjectManager = pGISServerConnection.ServerObjectManager



    '+++ get a GeocodeServer object from its server context

    Set pServerContext = pServerObjectManager.CreateServerContext("RedlandsStreets", "GeocodeServer")

    Set pInitGeocodeServer = pServerContext.ServerObject



    '+++ get the set of adjustable properties and remove the minimum candidate score

    varAdjustableProperties = Split(pInitGeocodeServer.AdjustableProperties, ",")

    For lngPropertyIndex = LBound(varAdjustableProperties) To UBound(varAdjustableProperties)

        If varAdjustableProperties(lngPropertyIndex) <> "MinimumCandidateScore" Then

            ReDim Preserve strAdjustableProperties(0 To UBound(strAdjustableProperties) + 1)

            strAdjustableProperties(UBound(strAdjustableProperties)) = _

                varAdjustableProperties(lngPropertyIndex)

        End If

    Next lngPropertyIndex

    pInitGeocodeServer.AdjustableProperties = Join(strAdjustableProperties, ",")



    '+++ release the server context after completing work with the GeocodeServer

    pServerContext.ReleaseContext



    Exit Sub



ErrorHandler:

    If Err.Number = 9 Then  '+++ subscript out of range error

        ReDim strAdjustableProperties(0 To 0)

        Resume Next

    End If



End Sub

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The propertyList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAdjustableProperties

void setAdjustableProperties(String propertyList)
                             throws IOException,
                                    AutomationException
The list of properties (comma delimited) that can be modified at runtime (for a given method).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
propertyList - The propertyList (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSuggestedBatchSize

int getSuggestedBatchSize()
                          throws IOException,
                                 AutomationException
The suggested number of addresses to send to a server in one batch request.

Remarks

Refer to the ArcGIS Server Administrator and Developer Guide for more information on the suggested batch size.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The size
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSuggestedBatchSize

void setSuggestedBatchSize(int size)
                           throws IOException,
                                  AutomationException
The suggested number of addresses to send to a server in one batch request.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
size - The size (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.