com.esri.arcgis.gisclient
Class AGSServerConnectionFactory

java.lang.Object
  extended by com.esri.arcgis.gisclient.AGSServerConnectionFactory
All Implemented Interfaces:
IAGSServerConnectionFactory, IAGSServerConnectionFactory2, IAGSServerConnectionFactory3, ISetDefaultAgsConnectionInfo, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class AGSServerConnectionFactory
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IAGSServerConnectionFactory, IAGSServerConnectionFactory2, IAGSServerConnectionFactory3, ISetDefaultAgsConnectionInfo

A factory object for ArcGIS Server Connections.

Remarks

An AGSServerConnectionFactory is a dispenser of AGSServerConnection objects and allows a client to connect to an ArcGIS Server either directly over a LAN or indirectly to a specified web service catalog. An AGSServerConnection represents a GIS server or web service catalog that containe one of more server objects. Types of server objects are MapServer and GeocodeServer. An AGSServerConnectionFactory maintains a pool of currently connected, active connections that are being referenced by the application. Connection properties are specified using a PropertySet object and can be saved to a connection file.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Singleton:

This type is a singleton.

AGSServerConnectionFactory on Unix can only use Internet connections (i.e., through the web service endpoints) to connect to ArcGIS Servers. It cannot connect over LAN connections.

See Also:
Serialized Form

Constructor Summary
AGSServerConnectionFactory()
          Constructs a AGSServerConnectionFactory using ArcGIS Engine.
AGSServerConnectionFactory(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
AGSServerConnectionFactory theAGSServerConnectionFactory = (AGSServerConnectionFactory) obj;
 
Method Summary
 void clearParameters(IPropertySet pConnectionProperties)
          Clears an ArcGIS Server connection's user entered parameters.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int getDefaultHttpTimeout()
          The default timeout for http requests to the server (in seconds).
 IEnumAGSServerConnectionName getHostedServers(int hWnd)
          Returns server object names for the hosted servers accessible to the user.
 IAGSServerConnectionName getInServerConnectionName()
          Returns a server connection name that can be used to connect to the server from within a server process.
 int hashCode()
          the hashcode for this object
 IAGSServerConnection open(IPropertySet pConnectionProperties, int hWnd)
          Opens the GIS server connection specified by the connection properties.
 IAGSServerConnection openFromFile(String fileName, int hWnd)
          Opens the server connection specified by the given file name.
 IPropertySet readConnectionPropertiesFromFile(String fileName)
          The connection properties from the specified file.
 void setDefaultHttpTimeout(int seconds)
          The default timeout for http requests to the server (in seconds).
 
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

AGSServerConnectionFactory

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

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

AGSServerConnectionFactory

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

Construct a AGSServerConnectionFactory using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to AGSServerConnectionFactory.

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

open

public IAGSServerConnection open(IPropertySet pConnectionProperties,
                                 int hWnd)
                          throws IOException,
                                 AutomationException
Opens the GIS server connection specified by the connection properties.

Remarks

Use the Open method to create an AGSServerConnection based on a property set. The properties required in the property set depend on whether you are connecting directly to a GIS server over a LAN, or if you are connecting to a web service catalog. When connecting to a GIS server over the LAN, you need to set the machine property to be the name of the GIS server machine. When connecting to a web service catalog, you need to set the url property to the url of the web service catalog.

If the web service catalog you are connecting to is secure and requires a username and password, include them in the property set as the user and password properties, respectivly.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
open in interface IAGSServerConnectionFactory
Parameters:
pConnectionProperties - A reference to a com.esri.arcgis.system.IPropertySet (in)
hWnd - The hWnd (A COM typedef) (in)
Returns:
A reference to a com.esri.arcgis.gisclient.IAGSServerConnection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

openFromFile

public IAGSServerConnection openFromFile(String fileName,
                                         int hWnd)
                                  throws IOException,
                                         AutomationException
Opens the server connection specified by the given file name.

Product Availability

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

Specified by:
openFromFile in interface IAGSServerConnectionFactory2
Parameters:
fileName - The fileName (in)
hWnd - The hWnd (A COM typedef) (in)
Returns:
A reference to a com.esri.arcgis.gisclient.IAGSServerConnection
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

readConnectionPropertiesFromFile

public IPropertySet readConnectionPropertiesFromFile(String fileName)
                                              throws IOException,
                                                     AutomationException
The connection properties from the specified file.

Product Availability

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

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

setDefaultHttpTimeout

public void setDefaultHttpTimeout(int seconds)
                           throws IOException,
                                  AutomationException
The default timeout for http requests to the server (in seconds).

Product Availability

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

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

getDefaultHttpTimeout

public int getDefaultHttpTimeout()
                          throws IOException,
                                 AutomationException
The default timeout for http requests to the server (in seconds).

Product Availability

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

Specified by:
getDefaultHttpTimeout in interface IAGSServerConnectionFactory2
Returns:
The seconds
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHostedServers

public IEnumAGSServerConnectionName getHostedServers(int hWnd)
                                              throws IOException,
                                                     AutomationException
Returns server object names for the hosted servers accessible to the user.

Product Availability

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

Specified by:
getHostedServers in interface IAGSServerConnectionFactory3
Parameters:
hWnd - The hWnd (A COM typedef) (in)
Returns:
A reference to a com.esri.arcgis.gisclient.IEnumAGSServerConnectionName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getInServerConnectionName

public IAGSServerConnectionName getInServerConnectionName()
                                                   throws IOException,
                                                          AutomationException
Returns a server connection name that can be used to connect to the server from within a server process. Fails if run outside a server process.

Product Availability

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

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

clearParameters

public void clearParameters(IPropertySet pConnectionProperties)
                     throws IOException,
                            AutomationException
Clears an ArcGIS Server connection's user entered parameters.

Product Availability

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

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