com.esri.adf.web.ags.data
Class AGSLocalConnection

java.lang.Object
  extended bycom.esri.adf.web.ags.data.AGSLocalConnection

public class AGSLocalConnection
extends java.lang.Object

An ArcGIS server resource. It can be of type MapServer or GeocodeServer. This class establishes a connection to the server, holds on to the server parameters and can activate() and passivate() the connections as required. It also provides convenience methods to create server objects within the server context as well as methods to save and load objects to and from their XML representations.


Field Summary
protected  com.esri.arcgis.server.ServerCluster cluster
           
protected  java.lang.String configTypeName
          The config type of this resource.
protected  com.esri.arcgis.server.ServerConnection connection
          The IServerConnection object.
protected  java.lang.String currentHost
          The name of the machine which hosts the ArcGIS server.
static java.lang.String FAIL_OVER
          The fail-over cluster type.
protected  java.util.List hosts
           
protected  boolean init
           
protected  com.esri.arcgis.server.IServerObjectManager manager
          The server object manager
static java.lang.String NONE_CLUSTER_TYPE
          No cluster type supported.
protected  boolean pooled
          Indicates whether the associated server object is pooled or not.
static java.lang.String ROUND_ROBIN
          The round-robin cluster type.
protected  com.esri.arcgis.server.ServerClusterType serverClusterType
           
protected  com.esri.arcgis.server.IServerContext serverContext
          The IServerContext of this resource
protected  com.esri.arcgis.server.IServerObject serverObject
          The IServerObject running within this context
protected  java.lang.String serverObjectName
          The name by which the server object in question can be accessed on the server.
protected  AGSUser user
           
 
Constructor Summary
AGSLocalConnection()
           
AGSLocalConnection(java.lang.String serverObjectName, java.util.List hosts, java.lang.String configTypeName, java.lang.String clusterType, AGSUser user)
           
 
Method Summary
 void activateResource()
           
 void addHost(java.lang.String host)
           
 java.lang.Object createArcObject(java.lang.String progId)
          Creates an ArcObject with this progId in the current server context.
 boolean equals(java.lang.String resource)
          Determines whether the resource string represents this AGSLocalConnection.
 java.lang.String getClusterType()
           
 java.lang.String getConfigTypeName()
           
 java.lang.String getCurrentHost()
           
 java.util.List getHosts()
           
 com.esri.arcgis.server.ServerConnection getServerConnection()
          Returns the ServerConnection object from the server.
 com.esri.arcgis.server.IServerContext getServerContext()
          Returns the IServerContext object from the server.
 com.esri.arcgis.server.IServerObject getServerObject()
          Returns the IServerObject from the server.
 com.esri.arcgis.server.IServerObjectManager getServerObjectManager()
          Returns the IServerObjectManager object from the server.
 java.lang.String getServerObjectName()
           
 AGSUser getUser()
           
 void initResource()
           
 boolean isPooled()
          Returns an indicator of whether the server object is pooled or not.
 java.lang.Object loadObject(java.lang.String xml)
          Deserializes the string to a server object by calling the loadObject method on the AGSWebContext.
 void passivateResource()
           
 java.lang.String saveObject(java.lang.Object persistObj)
          Serializes a server object to a String.
 void setClusterType(java.lang.String clusterType)
           
 void setConfigTypeName(java.lang.String configTypeName)
           
 void setHosts(java.util.List hosts)
           
 void setServerObjectName(java.lang.String serverObjectName)
           
 void setUser(AGSUser user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE_CLUSTER_TYPE

public static final java.lang.String NONE_CLUSTER_TYPE
No cluster type supported.

See Also:
Constant Field Values

FAIL_OVER

public static final java.lang.String FAIL_OVER
The fail-over cluster type.

See Also:
Constant Field Values

ROUND_ROBIN

public static final java.lang.String ROUND_ROBIN
The round-robin cluster type.

See Also:
Constant Field Values

connection

protected com.esri.arcgis.server.ServerConnection connection
The IServerConnection object. Represents the active connection with the ArcGIS server.


serverObject

protected com.esri.arcgis.server.IServerObject serverObject
The IServerObject running within this context


serverContext

protected com.esri.arcgis.server.IServerContext serverContext
The IServerContext of this resource


manager

protected com.esri.arcgis.server.IServerObjectManager manager
The server object manager


pooled

protected boolean pooled
Indicates whether the associated server object is pooled or not.


serverObjectName

protected java.lang.String serverObjectName
The name by which the server object in question can be accessed on the server. The first part of the resource string (ServerObjectName@Host) represents the serverObjectName


currentHost

protected java.lang.String currentHost
The name of the machine which hosts the ArcGIS server. The second part of the resource string (ServerObjectName@Host) represents the host


configTypeName

protected java.lang.String configTypeName
The config type of this resource. Possible values: "MapServer", "GeocodeServer", empty i.e. "", etc.


cluster

protected com.esri.arcgis.server.ServerCluster cluster

serverClusterType

protected com.esri.arcgis.server.ServerClusterType serverClusterType

init

protected boolean init

hosts

protected java.util.List hosts

user

protected AGSUser user
Constructor Detail

AGSLocalConnection

public AGSLocalConnection()

AGSLocalConnection

public AGSLocalConnection(java.lang.String serverObjectName,
                          java.util.List hosts,
                          java.lang.String configTypeName,
                          java.lang.String clusterType,
                          AGSUser user)
Method Detail

initResource

public void initResource()

activateResource

public void activateResource()

passivateResource

public void passivateResource()

createArcObject

public java.lang.Object createArcObject(java.lang.String progId)
Creates an ArcObject with this progId in the current server context.

Parameters:
progId - the class id
Returns:
Object- the ArcObject represented by this progId

saveObject

public java.lang.String saveObject(java.lang.Object persistObj)
Serializes a server object to a String.

Parameters:
persistObj - the object to store
Returns:
String- a string representation of the object

loadObject

public java.lang.Object loadObject(java.lang.String xml)
Deserializes the string to a server object by calling the loadObject method on the AGSWebContext.

Parameters:
xml - the string representation of the server object
Returns:
Object- the loaded Object

equals

public boolean equals(java.lang.String resource)
Determines whether the resource string represents this AGSLocalConnection.

Parameters:
resource - the resource string
Returns:
boolean- if true, the resource is the same

getServerObject

public com.esri.arcgis.server.IServerObject getServerObject()
Returns the IServerObject from the server.

Returns:
IServerObject- the IServerObject

getServerConnection

public com.esri.arcgis.server.ServerConnection getServerConnection()
Returns the ServerConnection object from the server.

Returns:
ServerConnection- the ServerConnection object

getServerContext

public com.esri.arcgis.server.IServerContext getServerContext()
Returns the IServerContext object from the server.

Returns:
IServerContext- the IServerContext object

getServerObjectManager

public com.esri.arcgis.server.IServerObjectManager getServerObjectManager()
Returns the IServerObjectManager object from the server.

Returns:
IServerObjectManager- the IServerObjectMananger object

getServerObjectName

public java.lang.String getServerObjectName()

getHosts

public java.util.List getHosts()

getConfigTypeName

public java.lang.String getConfigTypeName()

getClusterType

public java.lang.String getClusterType()

getUser

public AGSUser getUser()

isPooled

public boolean isPooled()
Returns an indicator of whether the server object is pooled or not.

Returns:
boolean- if true, server object is pooled

setServerObjectName

public void setServerObjectName(java.lang.String serverObjectName)

setHosts

public void setHosts(java.util.List hosts)

addHost

public void addHost(java.lang.String host)

getCurrentHost

public java.lang.String getCurrentHost()

setConfigTypeName

public void setConfigTypeName(java.lang.String configTypeName)

setClusterType

public void setClusterType(java.lang.String clusterType)

setUser

public void setUser(AGSUser user)