com.esri.adf.web.ags.data.geometry
Class AGSLocalGeometryResource

java.lang.Object
  extended by com.esri.adf.web.data.GISResource
      extended by com.esri.adf.web.ags.data.geometry.AGSGeometryResource
          extended by com.esri.adf.web.ags.data.geometry.AGSLocalGeometryResource
All Implemented Interfaces:
WebContextInitialize, WebLifecycle, Serializable

public class AGSLocalGeometryResource
extends AGSGeometryResource

The AGSLocalGeometryResource represents a GISResource for ArcGIS Server local geometry services. User need to provide the server object name , host and the user's credentials to connect to the local server.

It is important to note that for some AGS functionalities to share code between the internet and local resources, we use SOAP to communicate with the server wherever possible. Given this scenario, this class is implemented as a sub-class of the internet map resource represented by the AGSGeometryResource class.

This object uses the capabilities exposed by the GeometryServerPort interface wherever possible in order to facilitate code-sharing among certain AGS functionalities.

See Also:
Serialized Form

Field Summary
protected  AGSLocalConnection delegate
          A delegate which handles certain calls to the ArcGIS Server.
 
Fields inherited from class com.esri.adf.web.ags.data.geometry.AGSGeometryResource
endPointURL, generatedAlias, geometryServer, serviceCatalogURL, user
 
Fields inherited from class com.esri.adf.web.data.GISResource
alias, context, defaultSpatialReference, functionalities, hasFailedFunctionalities, init
 
Constructor Summary
AGSLocalGeometryResource()
           Creates a new AGSLocalGeometryResource with no input parameters set.
AGSLocalGeometryResource(String serverObjectName, List<String> hosts, String clusterType, AGSUser user)
           Creates a new AGSLocalGeometryResource with the given set of input parameters.
 
Method Summary
 void activate()
           This method is called by the associated WebContext when the context itself is being activated.
protected  void createGeometryServer()
           This method connects to the ArcGIS Server Geometry Service end point and creates a remote stub to the server.
 void destroy()
           The cleanup (final) chores of the resource like releasing held resources must be performed in this method.
 boolean equals(String resource)
          Determines whether the resource string represents this AGSLocalGeometryResource.
 String getAlias()
           Returns a reader friendly name for this resource.
 String getClusterType()
          Returns the cluster configuration for this resource.
 int getFailRecheckValue()
          Return the fail recheck value.
 com.esri.arcgisws.GeometryServerPort getGeometryServer()
           Returns The remote stub to the geometry service that this resource represents.
 List<String> getHosts()
          Returns the List of server hosts that this resource connects.
 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.IServerObjectManager getServerObjectManager()
          Returns the IServerObjectManager object from the server.
 String getServerObjectName()
          Returns the name of the geometry server object that this resource represents.
 AGSUser getUser()
           Returns the AGSUser to authenticate connections to secure web services.
 void init(WebContext webContext)
           This method is called by the WebContext to initialize the resource.
 void passivate()
           This method is called by the associated WebContext when the context itself is being passivated.
 void setClusterType(String clusterType)
          Sets the cluster configuration for this resource.
 void setFailRecheckValue(int value)
          Sets the fail recheck value, used for checking if the server is alive after n bypass rounds.
 void setHosts(List<String> hosts)
          Sets the List of server hosts that this resource connects.
 void setServerObjectName(String serverObjectName)
          Sets the name of the geometry server object that this resource represents.
 void setUser(AGSUser user)
           Sets the AGSUser to authenticate connections to secure web services.
 
Methods inherited from class com.esri.adf.web.ags.data.geometry.AGSGeometryResource
getEndPointURL, getServiceCatalogURL, setEndPointURL, setServiceCatalogURL
 
Methods inherited from class com.esri.adf.web.data.GISResource
addFunctionality, getDefaultSpatialReference, getFunctionalities, getFunctionality, getWebContext, setAlias, setFunctionalities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected AGSLocalConnection delegate
A delegate which handles certain calls to the ArcGIS Server. This delegate should not be used by consumers of this resource. This is provided for usage within this class as well as for classes that inherit from this class.

Constructor Detail

AGSLocalGeometryResource

public AGSLocalGeometryResource()

Creates a new AGSLocalGeometryResource with no input parameters set. This constructor is typically used when one configures this resource in a JSF config file. If you are to programmatically create this resource, it is recommended that you use the other constructor that takes various input parameters.

See Also:
AGSLocalGeometryResource(String, List, String, AGSUser)

AGSLocalGeometryResource

public AGSLocalGeometryResource(String serverObjectName,
                                List<String> hosts,
                                String clusterType,
                                AGSUser user)

Creates a new AGSLocalGeometryResource with the given set of input parameters. If you are to programmatically create this resource, it is recommended that you use this constructor.

Parameters:
serverObjectName - the name of the geometry server object that this resource represents
hosts - the List of server hosts that this resource connects to
clusterType - if multiple hosts are provided, cluster types of AGSLocalConnection.FAIL_OVER or AGSLocalConnection.ROUND_ROBIN can be provided. A value of null or AGSLocalConnection.NONE_CLUSTER_TYPE can be used in order to not use clustering
user - the AGSUser to impersonate connections to the server
See Also:
AGSLocalGeometryResource()
Method Detail

createGeometryServer

protected void createGeometryServer()
Description copied from class: AGSGeometryResource

This method connects to the ArcGIS Server Geometry Service end point and creates a remote stub to the server. If user's credentials is provided it will attempt to connect to the server with that user's credentials.

Overrides:
createGeometryServer in class AGSGeometryResource

init

public void init(WebContext webContext)
Description copied from class: GISResource

This method is called by the WebContext to initialize the resource. This is typically called when the context itself is initialized or when users add a new resource to the context by using the WebContext.addResource(String, GISResource) method. A GISResource is usable only after this method has been called.

This method iterates through all its supported GISFunctionalitys and calls the GISFunctionality.initFunctionality(GISResource) on them all.

Sub-classes that want to do custom initialization should override this method and make the super call first before doing the custom stuff:

 public void init(WebContext context) {
   super.init(context);
   myInit();
 }
 

Specified by:
init in interface WebContextInitialize
Overrides:
init in class AGSGeometryResource
Parameters:
webContext - the WebContext that maintains a reference to this resource
See Also:
WebContextInitialize.init(com.esri.adf.web.data.WebContext), GISFunctionality.initFunctionality(GISResource), WebContext.init(WebContext), WebContext.addResource(String, GISResource)

destroy

public void destroy()
Description copied from class: GISResource

The cleanup (final) chores of the resource like releasing held resources must be performed in this method. This is typically called when the context itself is being destroyed or when users remove this resource from the context by using the WebContext.removeResource(GISResource) method. A GISResource is unusable after this method has been called.

This method iterates through all its supported GISFunctionalitys and calls the GISFunctionality.destroyFunctionality() on them all.

Sub-classes that want to do custom cleanup chores should override this method and do the custom cleanup first before making the super call:

 public void destroy() {
   myDestroy();
   super.destroy();
 }
 

Specified by:
destroy in interface WebContextInitialize
Overrides:
destroy in class GISResource
See Also:
WebContextInitialize.destroy(), GISFunctionality.destroyFunctionality(), WebContext.destroy(), WebContext.removeResource(GISResource)

activate

public void activate()
Description copied from class: GISResource

This method is called by the associated WebContext when the context itself is being activated. This typically happens when a new user request is received to perform a set of operations. A GISResource is available for the execution of these operations only after this method has been called.

This method iterates through all its supported GISFunctionalitys and calls the activate() method on those functionalities that implement WebLifecycle.

Sub-classes that want to do custom activation should override this method and make the super call first before doing the custom stuff:

 public void activate() {
   super.activate();
   myActivate();
 }
 

Specified by:
activate in interface WebLifecycle
Overrides:
activate in class GISResource
See Also:
WebLifecycle.activate(), WebContext.activate()

passivate

public void passivate()
Description copied from class: GISResource

This method is called by the associated WebContext when the context itself is being passivated. This typically happens after a user request to perform a set of operations has been serviced. A GISResource is unavailable for the execution of more operations after this method has been called.

This method iterates through all its supported GISFunctionalitys and calls the passivate() method on those functionalities that implement WebLifecycle.

Sub-classes that want to do custom passivation should override this method and do the custom passivation first before making the super call:

 public void passivate() {
   myPassivate();
   super.passivate();
 }
 

Specified by:
passivate in interface WebLifecycle
Overrides:
passivate in class GISResource
See Also:
WebLifecycle.passivate(), WebContext.passivate()

equals

public boolean equals(String resource)
Determines whether the resource string represents this AGSLocalGeometryResource.

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

getGeometryServer

public com.esri.arcgisws.GeometryServerPort getGeometryServer()
Description copied from class: AGSGeometryResource

Returns The remote stub to the geometry service that this resource represents.

Overrides:
getGeometryServer in class AGSGeometryResource
Returns:
The remote stub to the geometry service that this resource represents

getAlias

public String getAlias()
Description copied from class: GISResource

Returns a reader friendly name for this resource.

It is a good practice for users to explicitly set an alias when the resource is created programmatically or declaratively. Resource providers should provide an auto-generated alias anyway in case users don't explicitly set an alias themselves.

Overrides:
getAlias in class AGSGeometryResource
Returns:
a reader friendly name for this resource

getServerObjectManager

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

Returns:
IServerObjectManager- the IServerObjectMananger object

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

getServerObjectName

public String getServerObjectName()
Returns the name of the geometry server object that this resource represents.

Returns:
the geometry server object name

setServerObjectName

public void setServerObjectName(String serverObjectName)
Sets the name of the geometry server object that this resource represents.

Parameters:
serverObjectName - the name of the geometry server object that this resource represents

getHosts

public List<String> getHosts()
Returns the List of server hosts that this resource connects.

Returns:
the list of server hosts

setHosts

public void setHosts(List<String> hosts)
Sets the List of server hosts that this resource connects.

Parameters:
hosts - the List of server hosts that this resource connects

setUser

public void setUser(AGSUser user)
Description copied from class: AGSGeometryResource

Sets the AGSUser to authenticate connections to secure web services.

Overrides:
setUser in class AGSGeometryResource
Parameters:
user - the AGSUser to authenticate connections to secure web services

getUser

public AGSUser getUser()
Description copied from class: AGSGeometryResource

Returns the AGSUser to authenticate connections to secure web services.

Overrides:
getUser in class AGSGeometryResource
Returns:
the AGSUser to authenticate connections to secure web services

getClusterType

public String getClusterType()
Returns the cluster configuration for this resource. If multiple hosts are provided, cluster types of AGSLocalConnection.FAIL_OVER or AGSLocalConnection.ROUND_ROBIN can be provided. A value of null or AGSLocalConnection.NONE_CLUSTER_TYPE can be used in order to not use clustering.

Returns:
the cluster configuration for this resource. if multiple hosts are provided, cluster types of AGSLocalConnection.FAIL_OVER or AGSLocalConnection.ROUND_ROBIN can be provided. A value of null or AGSLocalConnection.NONE_CLUSTER_TYPE can be used in order to not use clustering

setClusterType

public void setClusterType(String clusterType)
Sets the cluster configuration for this resource. If multiple hosts are provided, cluster types of AGSLocalConnection.FAIL_OVER or AGSLocalConnection.ROUND_ROBIN can be provided. A value of null or AGSLocalConnection.NONE_CLUSTER_TYPE can be used in order to not use clustering.

Parameters:
clusterType - the cluster configuration for this resource. if multiple hosts are provided, cluster types of AGSLocalConnection.FAIL_OVER or AGSLocalConnection.ROUND_ROBIN can be provided. A value of null or AGSLocalConnection.NONE_CLUSTER_TYPE can be used in order to not use clustering

getFailRecheckValue

public int getFailRecheckValue()
Return the fail recheck value.

Returns:
the fail recheck value

setFailRecheckValue

public void setFailRecheckValue(int value)
Sets the fail recheck value, used for checking if the server is alive after n bypass rounds. The default value is 500

Parameters:
value - the fail recheck value