com.esri.arcgis.server
Class GISServerConnection

java.lang.Object
  extended by com.esri.arcgis.server.GISServerConnection
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IGISServerConnection, IGISServerConnection2, Serializable

public class GISServerConnection
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IGISServerConnection, IGISServerConnection2

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

Description

The GIServerConnection provides connections to an ArcGIS Server over a LAN. This object supports a single interface: IGISServerConnection. The GISServerConnection can be used to connect to an ArcGIS Server by calling the Connect method on IGISServerConnection and providing the name or IP address of the machine on which the ArcGIS Server server object manager is running.

Once connected to the ArcGIS Server, the GISServerConnection can be used to get a reference to the ServerObjectManager, and the ServerObjectAdmin for making use of server objects and administering server objects, respectivly.

Remarks

In order to succesfully connect to the ArcGIS Server using the Connect method on IGISServerConnection, the user account running the application must be a member of the agsusers user group on the ArcGIS Server. If the account running the application is not a member of this group, the Connect method will return an error.

Note: if connecting to the server with an ASP.NET web application, you may need to use impersonation to fix the identity of your application to a specific user account. For details about how to do this and how to encrypt the username and password, see article Q329290, "HOWTO: Use the ASP.NET Utility to Encrypt Credentials and Session State Connection Strings" in the Microsoft Knowledge Base.

Once connected, use the ServerObjectManager property on IGISServerConnection to get a reference on the ServerObjectManager. The ServerObjectManager provides methods for listing the server object types and server object configurations that have been configured on the server. The ServerObjectManager also provides methods for creating server contexts to provide access to and allow for the creation of server objects running within the server.

If the user account running the application is also a member of the agsadmin user group on the ArcGIS Server, the ServerObjectAdmin property on IGISServerConnection can be used to get a reference on the ServerObjectAdmin. If the user account running the application is not in the agsadmin user group, the ServerObjectAdmin property will return and error.

The ServerObjectAdmin provides methods for managing server object configurations, server object types and the machines that host sever objects in the ArcGIS Server.

Product Availability

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

Supported Platforms

Windows

GISServerConnection not supported on Unix, and can only be used on Windows.

See Also:
Serialized Form

Constructor Summary
GISServerConnection()
          Constructs a GISServerConnection using ArcGIS Engine.
GISServerConnection(Object obj)
          Construct a GISServerConnection using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 void connect(String machineName)
          Connects to the GIS server specified by the machineName.
 void connect2(String userInfo, String machineName)
          Connects the user specified by userInfo to the GIS server given by machineName.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 IServerObjectAdmin getServerObjectAdmin()
          The server object admin for the connected GIS server.
 IServerObjectManager getServerObjectManager()
          The server object manager for the connected GIS server.
 int hashCode()
          the hashcode for this object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

GISServerConnection

public GISServerConnection()
                    throws IOException,
                           UnknownHostException
Constructs a GISServerConnection using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

GISServerConnection

public GISServerConnection(Object obj)
                    throws IOException
Construct a GISServerConnection using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to GISServerConnection.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems GISServerConnection theGISServerConnection = (GISServerConnection) obj;
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

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

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

connect

public void connect(String machineName)
             throws IOException,
                    AutomationException
Connects to the GIS server specified by the machineName.

Remarks

In order to succesfully connect to the ArcGIS Server using the Connect method on IGISServerConnection, the user account running the application must be a member of the agsusers user group on the ArcGIS Server.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
connect in interface IGISServerConnection
Parameters:
machineName - The machineName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerObjectManager

public IServerObjectManager getServerObjectManager()
                                            throws IOException,
                                                   AutomationException
The server object manager for the connected GIS server.

Remarks

The ServerObjectManager property returns a reference to the ServerObjectManager of the ArcGIS Server. The ServerObjectManager supports interfaces for listing the server object configurations and server object types that have been configured on the server. The ServerObjectManager also supports interfaces for creating server contexts for use by the application.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getServerObjectAdmin

public IServerObjectAdmin getServerObjectAdmin()
                                        throws IOException,
                                               AutomationException
The server object admin for the connected GIS server.

Remarks

The ServerObjectAdmin property returns a reference to the ServerObjectAdmin of the ArcGIS Server. The user account running the application must be a member of the agsadmin user group on the ArcGIS Server, to get a reference on the ServerObjectAdmin. If the user account running the application is not in the agsadmin user group, the ServerObjectAdmin property will return and error.

The ServerObjectAdmin provides methods for managing server object configurations, server object types and the machines that host sever objects in the ArcGIS Server.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

connect2

public void connect2(String userInfo,
                     String machineName)
              throws IOException,
                     AutomationException
Connects the user specified by userInfo to the GIS server given by machineName.

Product Availability

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

Specified by:
connect2 in interface IGISServerConnection2
Parameters:
userInfo - The userInfo (in)
machineName - The machineName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.