com.esri.arcgis.gisclient
Class AGSServerConnection

java.lang.Object
  extended bycom.esri.arcgis.gisclient.AGSServerConnection
All Implemented Interfaces:
IAGSServerConnection, IAGSServerConnection2, IAGSServerConnectionAdmin, ISupportErrorInfo, java.io.Serializable

public class AGSServerConnection
extends java.lang.Object
implements IAGSServerConnection, IAGSServerConnection2, IAGSServerConnectionAdmin, ISupportErrorInfo

The AGSServerConnection object for connecting to the GIS server and getting the ServerObjectManager and ServerObjectAdmin.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Remarks

An AGSServerConnection is a connection to a GIS server or web service catalog. Both contain server objects such as MapServer and GeocodeServer server objects. It provides methods to get references to server objects. If the AGSServerConnection is a direct connection to the GIS server over a LAN, there are methods to get references to the ServerObjectManager and ServerObjectAdmin objects for the GIS server.

An AGSServerConnection hands out a AGSServerConnectionName name object as the value of its FullName property. The AGSServerConnectionName for an AGSServerConnection can be persisted, for example, in a map document. An application can call the Open method on the AGSServerConnection name after loading it from persistent storage in order to connect to and get an object reference to the GIS server or web service catalog.

The MapServer and GeocodeServer objects that you obtain through an AGSServerConnection support only the coarse-grained, stateless methods associated with the server object. You can't use a MapServer or GeocodeServer object obtained from an AGSServerConnection to get references to the finer-grained objects associated with the server object, not can you change any aspects of the server object's state. Server objects obtained from LAN connections or web service catalog AGSServerConnections can be used in the same way, so if you are writing applications that need to work with both LAN and web service catalog conneciton to a GIS server, use AGSServerConnection and its associated objects.

When you get a server object using the ArcCatalog objects (GxAGSServerConnection) and ArcMap (MapServerLayer), you are working through an AGSServerConnection.

If you want to work with a server object in a stateful manner, or you want to work with the finer-grained ArcObjects associated with a server object, you must obtain that server object by getting a reference to its server context from the ServerObjectManager . You can get the ServerObjectManager by either connecting to the GIS server using a GISServerConnection object, or by getting it from the AGSServerConnection.

See Also:
AGSServerConnectionFactory, GISServerConnection, ServerObjectManager, AGSServerObjectName, Serialized Form

Constructor Summary
AGSServerConnection()
          Constructs a AGSServerConnection using ArcGIS Engine.
AGSServerConnection(java.lang.Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compare this object with another
 IAGSServerConnection getAsIAGSServerConnection()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IAGSServerConnection2 getAsIAGSServerConnection2()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 IAGSServerConnectionAdmin getAsIAGSServerConnectionAdmin()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
 ISupportErrorInfo getAsISupportErrorInfo()
          Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.
static java.lang.String getClsid()
           
 IEnumBSTR getFolders(java.lang.String reserved)
           
 IName getFullName()
          The AGSServerConnectionName object assiated with the GIS server connection.
 java.lang.String getName()
          The name of the connection.
 IServerObjectAdmin getServerObjectAdmin()
          The server object admin for the connected GIS server.
 IServerObjectConfiguration getServerObjectConfiguration(java.lang.String name, java.lang.String type)
          The server object configuration with the specified Name and TypeName.
 IServerObjectManager getServerObjectManager()
          The server object manager for the connected GIS server.
 IAGSEnumServerObjectName getServerObjectNames()
          The ServerObjectNames in the GIS server.
 IAGSEnumServerObjectName getServerObjectNamesEx(java.lang.String folderName)
          The ServerObjectNames in the GIS server folder.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          Supported Platforms
 void setFullNameByRef(IName ppNameObject)
          The AGSServerConnectionName object assiated with the GIS server connection.
 void setName(java.lang.String name)
          The name of the connection.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AGSServerConnection

public AGSServerConnection()
                    throws java.io.IOException,
                           java.net.UnknownHostException
Constructs a AGSServerConnection using ArcGIS Engine.

Throws:
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems

AGSServerConnection

public AGSServerConnection(java.lang.Object obj)
                    throws java.io.IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.

Construct a AGSServerConnection using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to AGSServerConnection.
AGSServerConnection theAGSServerConnection = (AGSServerConnection) obj;

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
java.io.IOException - if there are interop problems
Method Detail

getClsid

public static java.lang.String getClsid()

getAsIAGSServerConnection

public IAGSServerConnection getAsIAGSServerConnection()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIAGSServerConnection2

public IAGSServerConnection2 getAsIAGSServerConnection2()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsIAGSServerConnectionAdmin

public IAGSServerConnectionAdmin getAsIAGSServerConnectionAdmin()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


getAsISupportErrorInfo

public ISupportErrorInfo getAsISupportErrorInfo()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed.


equals

public boolean equals(java.lang.Object o)
Compare this object with another


hashCode

public int hashCode()
the hashcode for this object


setName

public void setName(java.lang.String name)
             throws java.io.IOException,
                    AutomationException
Description copied from interface: IAGSServerConnection
The name of the connection.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setName in interface IAGSServerConnection
Parameters:
name - The name (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

public java.lang.String getName()
                         throws java.io.IOException,
                                AutomationException
Description copied from interface: IAGSServerConnection
The name of the connection.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getName in interface IAGSServerConnection
Returns:
The name
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getServerObjectNames

public IAGSEnumServerObjectName getServerObjectNames()
                                              throws java.io.IOException,
                                                     AutomationException
Description copied from interface: IAGSServerConnection
The ServerObjectNames in the GIS server.

Supported Platforms

Windows, Solaris, Linux

Remarks

Returns an enumeration of the AGSServerObjectName objects in the GIS server or web service catalog. Note, if the application that uses this interface is running as a user in the GIS server's users group (agsusers), and connects directly to a GIS server over a LAN, this method will return only the server objects which are started. If the application that uses this interface is running as a user in the GIS server's administrators group (agsadmin), this method will return all server objects.

Specified by:
getServerObjectNames in interface IAGSServerConnection
Returns:
A reference to a com.esri.arcgis.gisclient.IAGSEnumServerObjectName
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getFullName

public IName getFullName()
                  throws java.io.IOException,
                         AutomationException
Description copied from interface: IAGSServerConnection
The AGSServerConnectionName object assiated with the GIS server connection.

Supported Platforms

Windows, Solaris, Linux

Remarks

The FullName property gets and sets the AGSServerConnectionName name object. The AGSServerConnectionName for an AGSServerConnection can be persisted, for example, in a map document. An application can call the Open method on the AGSServerConnection name after loading it from persistent storage in order to connect to and get an object reference to the GIS server or web service catalog.

Specified by:
getFullName in interface IAGSServerConnection
Returns:
A reference to a com.esri.arcgis.system.IName
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setFullNameByRef

public void setFullNameByRef(IName ppNameObject)
                      throws java.io.IOException,
                             AutomationException
Description copied from interface: IAGSServerConnection
The AGSServerConnectionName object assiated with the GIS server connection.

Specified by:
setFullNameByRef in interface IAGSServerConnection
Parameters:
ppNameObject - A reference to a com.esri.arcgis.system.IName (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerObjectNamesEx

public IAGSEnumServerObjectName getServerObjectNamesEx(java.lang.String folderName)
                                                throws java.io.IOException,
                                                       AutomationException
Description copied from interface: IAGSServerConnection2
The ServerObjectNames in the GIS server folder.

Specified by:
getServerObjectNamesEx in interface IAGSServerConnection2
Parameters:
folderName - The folderName (in)
Returns:
A reference to a com.esri.arcgis.gisclient.IAGSEnumServerObjectName
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFolders

public IEnumBSTR getFolders(java.lang.String reserved)
                     throws java.io.IOException,
                            AutomationException
Specified by:
getFolders in interface IAGSServerConnection2
Parameters:
reserved - The reserved (in)
Returns:
A reference to a com.esri.arcgis.system.IEnumBSTR
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getServerObjectManager

public IServerObjectManager getServerObjectManager()
                                            throws java.io.IOException,
                                                   AutomationException
Description copied from interface: IAGSServerConnectionAdmin
The server object manager for the connected GIS server.

Supported Platforms

Windows, Solaris, Linux

Remarks

If the application using this interface is running as a user in the GIS server's users group (agsusers), it can use the ServerObjectManager property to get a reference to the GIS server's ServerObjectManager. Using the ServerObjectManager , you can create server contexts, works with ArcObjects in the GIS server and so on.

Specified by:
getServerObjectManager in interface IAGSServerConnectionAdmin
Returns:
A reference to a com.esri.arcgis.server.IServerObjectManager
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.

getServerObjectAdmin

public IServerObjectAdmin getServerObjectAdmin()
                                        throws java.io.IOException,
                                               AutomationException
Description copied from interface: IAGSServerConnectionAdmin
The server object admin for the connected GIS server.

Supported Platforms

Windows, Solaris, Linux

Remarks

If the application using this interface is running as a user in the GIS server's administrators group (agadmin), it can use the ServerObjectAdmin property to get a reference to the GIS server's ServerObjectAdmin. Using the ServerObjectAdmin , you can perform administration tasks such as starting and stopping serever objects, and so on.

Specified by:
getServerObjectAdmin in interface IAGSServerConnectionAdmin
Returns:
A reference to a com.esri.arcgis.server.IServerObjectAdmin
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerObjectConfiguration

public IServerObjectConfiguration getServerObjectConfiguration(java.lang.String name,
                                                               java.lang.String type)
                                                        throws java.io.IOException,
                                                               AutomationException
Description copied from interface: IAGSServerConnectionAdmin
The server object configuration with the specified Name and TypeName.

Supported Platforms

Windows, Solaris, Linux

Remarks

The ServerObjectConfiguration property will return the ServerObjectConfiguration for the specified server object and type. The application must be running as a member of the GIS server's administrators group (agadmin) to succesfully get this property.

You can use the ServerObjectNames propety on IAGSServerConnection to get a list of the server objects configured in the server, then use the names and types as inputs to the ServerObjectConfiguration property. Once you have a ServerObjectConfiguration, you can update it, check its status and so on.

Specified by:
getServerObjectConfiguration in interface IAGSServerConnectionAdmin
Parameters:
name - The name (in)
type - The type (in)
Returns:
A reference to a com.esri.arcgis.server.IServerObjectConfiguration
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws java.io.IOException,
                                       AutomationException
Description copied from interface: ISupportErrorInfo

Supported Platforms

Windows, Solaris, Linux

Description

Indicates whether the interface supports IErrorInfo.

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.