|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IInitGeocodeServer
Provides access to members for initializing a geocode server.
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.)
Use the IInitGeocodeServer interface to define the properties of a GeocodeServer.
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 |
---|
void attachToLocator(ILocatorName locName) throws IOException, AutomationException
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
locName
- A reference to a com.esri.arcgis.geodatabase.ILocatorName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getAdjustableProperties() throws IOException, AutomationException
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
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setAdjustableProperties(String propertyList) throws IOException, AutomationException
propertyList
- The propertyList (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getSuggestedBatchSize() throws IOException, AutomationException
Refer to the ArcGIS Server Administrator and Developer Guide for more information on the suggested batch size.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.void setSuggestedBatchSize(int size) throws IOException, AutomationException
size
- The size (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |