GIS サーバのプロパティを取得・設定

ArcGIS Server 10 以前を対象

Public Sub GetGISServerConnection()
    Dim pGISServerConnection As IGISServerConnection
    Set pGISServerConnection = New GISServerConnection
    pGISServerConnection.Connect "zeke"
    
    Dim pServerObjectAdmin As IServerObjectAdmin
    Set pServerObjectAdmin = pGISServerConnection.ServerObjectAdmin
    
    ' create the new configuration
    Dim pConfiguration As IServerObjectConfiguration2
    Set pConfiguration = pServerObjectAdmin.GetConfiguration("test", "MapServer")   '既存のサービスを取得する場合
'    Set pConfiguration = pServerObjectAdmin.CreateConfiguration                     '接続情報を新規に作成する場合
    
'    pConfiguration.Name = "California"
'    pConfiguration.TypeName = "MapServer"
    
    Dim pPropertySet As IPropertySet
    Set pPropertySet = pConfiguration.Properties
'    Set pPropertySet = pConfiguration.RecycleProperties
'    Set pPropertySet = pConfiguration.Info
'    Set pPropertySet = pConfiguration.ExtensionInfo
'    Set pPropertySet = pConfiguration.ExtensionProperties("MapServer")
    
    'PropertySetを表示
    Dim varNames As Variant, varValues As Variant
    pPropertySet.GetAllProperties varNames, varValues
    Dim i As Long
    For i = 0 To pPropertySet.Count - 1
        Debug.Print varNames(i), varValues(i)
    Next i

'    'プロパティを新規に設定する場合
'    pPropertySet.SetProperty "LocatorWorkspacePath", "\\melange\Geocoding\California"
'    pPropertySet.SetProperty "Locator", "California"
'    pPropertySet.SetProperty "SuggestedBatchSize", "500"
'
'    pConfiguration.IsPooled = True
'    pConfiguration.MinInstances = 1
'    pConfiguration.MaxInstances = 1
'    pConfiguration.WaitTimeout = 10
'    pConfiguration.UsageTimeout = 120
'
    '作成した設定を追加
'    pServerObjectAdmin.AddConfiguration pConfiguration

End Sub
'参考:IServerObjectConfiguration2::Properties Property > Example