com.esri.arcgis.gisclient
Class AGSServerConnection

java.lang.Object
  extended by com.esri.arcgis.gisclient.AGSServerConnection
All Implemented Interfaces:
IAGSServerConnection, IAGSServerConnection2, IAGSServerConnection3, IAGSServerConnectionAdmin, com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, Serializable

public class AGSServerConnection
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IAGSServerConnection, IAGSServerConnection2, IAGSServerConnection3, IAGSServerConnectionAdmin, ISupportErrorInfo

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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
IServerObjectAdmin, IGISServerConnection, IServerContext, IServerObjectManager, IServerObject, GISServerConnection, Serialized Form

Constructor Summary
AGSServerConnection()
          Constructs a AGSServerConnection using ArcGIS Engine.
AGSServerConnection(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
AGSServerConnection theAGSServerConnection = (AGSServerConnection) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 IStream getFile(String uRL)
          Retrieves a file from the specified url.
 Object getFileAsVariant(String uRL)
          Retrieves the stream as variant from the specified url.
 IEnumBSTR getFolders(String reserved)
          Returns an enumeration of folder names beneath the specified folder.
 IName getFullName()
          The AGSServerConnectionName object assiated with the GIS server connection.
 String getName()
          The name of the connection.
 IServerObjectAdmin getServerObjectAdmin()
          The server object admin for the connected GIS server.
 IServerObjectConfiguration getServerObjectConfiguration(String name, 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(String folderName)
          The ServerObjectNames in the GIS server folder.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void setFullNameByRef(IName ppNameObject)
          The AGSServerConnectionName object assiated with the GIS server connection.
 void setName(String name)
          The name of the connection.
 
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

AGSServerConnection

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

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

AGSServerConnection

public AGSServerConnection(Object obj)
                    throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
AGSServerConnection theAGSServerConnection = (AGSServerConnection) obj;

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.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
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

setName

public void setName(String name)
             throws IOException,
                    AutomationException
The name of the connection.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the connection.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getServerObjectNames

public IAGSEnumServerObjectName getServerObjectNames()
                                              throws IOException,
                                                     AutomationException
The ServerObjectNames in the GIS server.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getFullName

public IName getFullName()
                  throws IOException,
                         AutomationException
The AGSServerConnectionName object assiated with the GIS server connection.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setFullNameByRef

public void setFullNameByRef(IName ppNameObject)
                      throws IOException,
                             AutomationException
The AGSServerConnectionName object assiated with the GIS server connection.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getServerObjectNamesEx

public IAGSEnumServerObjectName getServerObjectNamesEx(String folderName)
                                                throws IOException,
                                                       AutomationException
The ServerObjectNames in the GIS server folder.

Product Availability

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

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

getFolders

public IEnumBSTR getFolders(String reserved)
                     throws IOException,
                            AutomationException
Returns an enumeration of folder names beneath the specified folder.

Product Availability

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

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

getFile

public IStream getFile(String uRL)
                throws IOException,
                       AutomationException
Retrieves a file from the specified url.

Product Availability

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

Specified by:
getFile in interface IAGSServerConnection3
Parameters:
uRL - The uRL (in)
Returns:
A reference to a com.esri.arcgis.system.IStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFileAsVariant

public Object getFileAsVariant(String uRL)
                        throws IOException,
                               AutomationException
Retrieves the stream as variant from the specified url.

Product Availability

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

Specified by:
getFileAsVariant in interface IAGSServerConnection3
Parameters:
uRL - The uRL (in)
Returns:
A Variant
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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getServerObjectManager in interface IAGSServerConnectionAdmin
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

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getServerObjectAdmin in interface IAGSServerConnectionAdmin
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.

getServerObjectConfiguration

public IServerObjectConfiguration getServerObjectConfiguration(String name,
                                                               String type)
                                                        throws IOException,
                                                               AutomationException
The server object configuration with the specified Name and TypeName.

Product Availability

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

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:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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