com.esri.core.tasks.ags.geoprocessing
Class Geoprocessor

java.lang.Object
  extended by com.esri.core.tasks.ags.geoprocessing.Geoprocessor

public class Geoprocessor
extends Object

This class represents a GeoProcessing task. A GeoProcessing task is a single task running against a GeoProcessing service published using the ArcGIS Server and it supports one of the following two main operations:

  • execute: performed on a GeoProcessing task when the execution type is synchronous.
  • submitJob: performed on an asynchronous GeoProcessing task.
  • The process and output spatial references can be specified, respectively, through setProcessSR(SpatialReference) and setOutSR(SpatialReference).


    Constructor Summary
    Geoprocessor(String serviceUrl)
              Initializes the Geoprocessor object using the geoprocessing service URL.
    Geoprocessor(String serviceUrl, UserCredentials credentials)
              Initializes the Geoprocessor object using the geoprocessing service URL and credentials.
     
    Method Summary
     GPJobResource checkJobStatus(String jobId)
              Provides basic information about a submitted job such as the job ID, status and messages.
     GPResultResource execute(List<GPParameter> parameters)
              The execute method is performed on a GP service when the execution type desired is synchronous (on the server side).
     SpatialReference getOutSR()
              Returns the output spatial reference set for this geoprocessing task.
     SpatialReference getProcessSR()
              Returns the process spatial reference set for this geoprocessing task.
     GPParameter getResultData(String jobId, String parameterName)
              Retrieves the result parameter information for a specific job.
     GPParameter getResultImage(String jobId, String parameterName)
              Retrieves the result parameter information as a map image for a specific job.
     String getUrl()
              Gets the URL to the geoprocessing service.
     void setOutSR(SpatialReference outSR)
              Sets the well-known ID of the spatial reference of the output geometries.
     void setProcessSR(SpatialReference processSR)
              Sets the well-known ID of the spatial reference that the model will use to perform geometry operations.
     void setUrl(String url)
              Sets the URL to the geoprocessing service.
     GPJobResource submitJob(List<GPParameter> parameters)
              The submitJob method is performed on a GP service when the execution type desired is asynchronous (on the server side).
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    Geoprocessor

    public Geoprocessor(String serviceUrl)
    Initializes the Geoprocessor object using the geoprocessing service URL.

    Parameters:
    serviceUrl - ArcGIS Server Rest API endpoint to the service that receives the geoprocessing request.

    Geoprocessor

    public Geoprocessor(String serviceUrl,
                        UserCredentials credentials)
    Initializes the Geoprocessor object using the geoprocessing service URL and credentials.

    Parameters:
    serviceUrl - ArcGIS Server Rest API endpoint to the service that receives the geoprocessing request.
    credentials - the credentials used for accessing a secure geoprocessing service.
    Method Detail

    getUrl

    public String getUrl()
    Gets the URL to the geoprocessing service.

    Returns:
    the url of the geoprocessing service

    setUrl

    public void setUrl(String url)
    Sets the URL to the geoprocessing service.

    Parameters:
    url - the url of the geoprocessing service to set

    getOutSR

    public SpatialReference getOutSR()
    Returns the output spatial reference set for this geoprocessing task.

    Returns:
    The spatial reference of the output geometries

    getProcessSR

    public SpatialReference getProcessSR()
    Returns the process spatial reference set for this geoprocessing task.

    Returns:
    The spatial reference that the model will use to perform geometry operations

    setOutSR

    public void setOutSR(SpatialReference outSR)
    Sets the well-known ID of the spatial reference of the output geometries. If the output spatial reference is not specified, the output geometries are in the spatial reference of the input geometries. If the process spatial reference is specified and the output spatial reference is not specified, the output geometries are in the spatial reference of the process spatial reference.

    Parameters:
    outSR - The spatial reference of the output geometries to set.

    setProcessSR

    public void setProcessSR(SpatialReference processSR)
    Sets the well-known ID of the spatial reference that the model will use to perform geometry operations. If the process spatial reference is specified and the output spatial reference is not specified, the output geometries are in the spatial reference of the process spatial reference.

    Parameters:
    processSR - The spatial reference that the model will use to perform geometry operations to set

    execute

    public GPResultResource execute(List<GPParameter> parameters)
                             throws Exception
    The execute method is performed on a GP service when the execution type desired is synchronous (on the server side).
    The result of this operation is a GPResultResource containing an array of result parameters and the GP task execution messages.

    Parameters:
    parameters - The various input parameters accepted by the corresponding GP task
    Returns:
    a GPResultResource containing an array of result parameters and the GP task execution messages
    Throws:
    Exception

    submitJob

    public GPJobResource submitJob(List<GPParameter> parameters)
                            throws Exception
    The submitJob method is performed on a GP service when the execution type desired is asynchronous (on the server side).
    The result of this operation is a GPJobResource containing information about the job submitted.

    Parameters:
    parameters - The various input parameters accepted by the corresponding GP task.
    Returns:
    a GPJobResource object containing information about the job submitted.
    Throws:
    Exception

    checkJobStatus

    public GPJobResource checkJobStatus(String jobId)
                                 throws Exception
    Provides basic information about a submitted job such as the job ID, status and messages.
    Additionally, if the job has successfully completed, it provides information about the result parameters as well as input parameters.

    Parameters:
    jobId - The job ID.
    Returns:
    a GPJobResource object containing information about the job submitted.
    Throws:
    Exception

    getResultData

    public GPParameter getResultData(String jobId,
                                     String parameterName)
                              throws Exception
    Retrieves the result parameter information for a specific job. It provides information about the result parameter such as its name, data type and value. The value will have different structures based on the data type

    Parameters:
    jobId - The job ID of the job this result pertains to
    parameterName - The name of the parameter to be retrieved
    Returns:
    an instance of one of the subclasses of GPParameter
    Throws:
    Exception

    getResultImage

    public GPParameter getResultImage(String jobId,
                                      String parameterName)
                               throws Exception
    Retrieves the result parameter information as a map image for a specific job. It provides the URL and the format of the image.

    Parameters:
    jobId - The job ID of the job this result pertains to
    parameterName - The name of the parameter to be retrieved
    Returns:
    an instance of one of the subclasses of GPParameter (necessarily GPRasterDataLayer or GPFeatureRecordSetLayer in this case)
    Throws:
    Exception


    Copyright © 2012. All Rights Reserved.