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

java.lang.Object
  extended by com.esri.adf.web.data.GISResource
      extended by com.esri.adf.web.ags.data.AGSMapResource
All Implemented Interfaces:
WebContextInitialize, WebLifecycle, Serializable
Direct Known Subclasses:
AGSExtensionsResource, AGSLocalMapResource

public class AGSMapResource
extends GISResource

The AGSMapResource represents a GISResource for ArcGIS Server map services. More specifically, this is the internet resource to the ArcGIS Server. Users will need to provide a URL to a web service end point which serves an ArcGIS server map. Additionally, for secure web services, users will need to provide an AGSUser to authenticate against the service.

It is important to note that this resource uses the SOAP protocol to communicate with the server. More specifically, it uses SOAP over HTTP. In order for some of the AGS functionalities to share the same codebase we use SOAP to communicate with local services as well wherever possible. Given this scenario, this class serves as a super-class for the AGSLocalMapResource which represents a GISResource for ArcGIS Server local map services.

The capabilities of this service are restricted by the methods exposed by the MapServerPort interface to ArcGIS Server internet map services.

See Also:
Serialized Form

Field Summary
protected  String endPointURL
          The URL to a web service end point which serves an ArcGIS server map.
protected  String generatedAlias
          If the user does not provide an alias for the resource, an alias is generated by this object and is represented by this variable
protected  String mapName
          The name of the map (dataframe) in the map service that this resource represents
protected  com.esri.arcgisws.MapServerBindingStub mapServer
          The remote stub to the map service that this resource represents
protected  com.esri.arcgisws.MapServerInfo serverInfo
           
protected  String serviceCatalogURL
          The URL to a web service catalog end point.
protected  AGSUser user
          An AGSUser object to authenticate connections to secure web services
 
Fields inherited from class com.esri.adf.web.data.GISResource
alias, context, defaultSpatialReference, functionalities, hasFailedFunctionalities, init
 
Constructor Summary
AGSMapResource()
           Creates a new AGSMapResource with no URL set.
AGSMapResource(String endPointURL)
           Creates a new AGSMapResource to an ArcGIS Server map service at the given end point.
 
Method Summary
protected  void createMapServer()
           This method connects to the ArcGIS server map service end point and creates a remote stub to the server.
 String getAlias()
           Returns a reader friendly name for this resource.
 String getEndPointURL()
           Returns the URL to a web service end point which serves an ArcGIS server map
 com.esri.arcgisws.EsriImageFormat getImageFormat(String format)
          Returns an EsriImageFormat constant corresponding to format string.
 String getMapName()
           Returns The name of the map (dataframe) in the map service that this resource represents
 com.esri.arcgisws.MapServerPort getMapServer()
           Returns The remote stub to the map service that this resource represents
 com.esri.arcgisws.MapServerInfo getMapServerInfo()
          Returns the MapServerInfo for associated ArcGIS Server service.
 String getServiceCatalogURL()
          Returns the service catalog end point URL.
 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 setEndPointURL(String endPointURL)
           Sets the URL to a web service end point which serves an ArcGIS server map
 void setMapName(String mapName)
           Sets The name of the map (dataframe) in the map service that this resource represents
 void setServiceCatalogURL(String serviceCatalogURL)
          Sets the service catalog end point URL.
 void setUser(AGSUser user)
           Sets the AGSUser to authenticate connections to secure web services
 
Methods inherited from class com.esri.adf.web.data.GISResource
activate, addFunctionality, destroy, getDefaultSpatialReference, getFunctionalities, getFunctionality, getWebContext, passivate, setAlias, setFunctionalities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endPointURL

protected String endPointURL
The URL to a web service end point which serves an ArcGIS server map.


serviceCatalogURL

protected String serviceCatalogURL
The URL to a web service catalog end point.


mapName

protected String mapName
The name of the map (dataframe) in the map service that this resource represents


generatedAlias

protected String generatedAlias
If the user does not provide an alias for the resource, an alias is generated by this object and is represented by this variable


mapServer

protected transient com.esri.arcgisws.MapServerBindingStub mapServer
The remote stub to the map service that this resource represents


user

protected AGSUser user
An AGSUser object to authenticate connections to secure web services


serverInfo

protected com.esri.arcgisws.MapServerInfo serverInfo
Constructor Detail

AGSMapResource

public AGSMapResource()

Creates a new AGSMapResource with no URL 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 an end point URL as input.


AGSMapResource

public AGSMapResource(String endPointURL)

Creates a new AGSMapResource to an ArcGIS Server map service at the given end point. If you are to programmatically create this resource, it is recommended that you use this constructor

Parameters:
endPointURL - the URL to the ArcGIS Server map service
Method Detail

createMapServer

protected void createMapServer()

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

Throws:
ADFAGSException - if an error occurs while connecting to the endPointURL

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 GISResource
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)

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 GISResource
Returns:
a reader friendly name for this resource

getMapServer

public com.esri.arcgisws.MapServerPort getMapServer()

Returns The remote stub to the map service that this resource represents

Returns:
The remote stub to the map service that this resource represents

getMapServerInfo

public com.esri.arcgisws.MapServerInfo getMapServerInfo()
Returns the MapServerInfo for associated ArcGIS Server service.

Returns:
the MapServerInfo for associated ArcGIS Server service.

getEndPointURL

public String getEndPointURL()

Returns the URL to a web service end point which serves an ArcGIS server map

Returns:
the URL to a web service end point which serves an ArcGIS server map

setEndPointURL

public void setEndPointURL(String endPointURL)

Sets the URL to a web service end point which serves an ArcGIS server map

Parameters:
endPointURL - the URL to a web service end point which serves an ArcGIS server map

getServiceCatalogURL

public String getServiceCatalogURL()
Returns the service catalog end point URL.

Returns:
the service catalog end point URL

setServiceCatalogURL

public void setServiceCatalogURL(String serviceCatalogURL)
Sets the service catalog end point URL.

Parameters:
serviceCatalogURL - the service catalog end point URL

getMapName

public String getMapName()

Returns The name of the map (dataframe) in the map service that this resource represents

Returns:
The name of the map (dataframe) in the map service that this resource represents

setMapName

public void setMapName(String mapName)

Sets The name of the map (dataframe) in the map service that this resource represents

Parameters:
mapName - The name of the map (dataframe) in the map service that this resource represents

setUser

public void setUser(AGSUser user)

Sets the AGSUser to authenticate connections to secure web services

Parameters:
user - the AGSUser to authenticate connections to secure web services

getUser

public AGSUser getUser()

Returns the AGSUser to authenticate connections to secure web services

Returns:
the AGSUser to authenticate connections to secure web services

getImageFormat

public com.esri.arcgisws.EsriImageFormat getImageFormat(String format)
Returns an EsriImageFormat constant corresponding to format string. The following strings are permitted: "ai", "bmp", "dib", "emf", "gif", "jpg", "none", "pdf", "png", "png24", "png32", "ps", "svg", "tiff".

Parameters:
format - a String defining the image format
Returns:
an EsriImageFormat constant