public class

Geoprocessor

extends Object
java.lang.Object
   ↳ com.esri.core.tasks.ags.geoprocessing.Geoprocessor

Class Overview

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

    Summary

    Public Constructors
    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.
    Public Methods
    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).
    [Expand]
    Inherited Methods
    From class java.lang.Object

    Public Constructors

    public Geoprocessor (String serviceUrl)

    Initializes the Geoprocessor object using the geoprocessing service URL.

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

    public Geoprocessor (String serviceUrl, UserCredentials credentials)

    Initializes the Geoprocessor object using the geoprocessing service URL and credentials.

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

    Public Methods

    public GPJobResource checkJobStatus (String jobId)

    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 String: The job ID.
    Returns
    GPJobResource a GPJobResource object containing information about the job submitted.
    Throws
    Exception the exception

    public 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).
    The result of this operation is a GPResultResource containing an array of result parameters and the GP task execution messages.

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

    public SpatialReference getOutSR ()

    Returns the output spatial reference set for this geoprocessing task.

    Returns
    SpatialReference The spatial reference of the output geometries

    public SpatialReference getProcessSR ()

    Returns the process spatial reference set for this geoprocessing task.

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

    public GPParameter getResultData (String jobId, String parameterName)

    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 String: The job ID of the job this result pertains to
    parameterName String: The name of the parameter to be retrieved
    Returns
    GPParameter an instance of one of the subclasses of GPParameter
    Throws
    Exception the exception

    public GPParameter getResultImage (String jobId, String parameterName)

    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 String: The job ID of the job this result pertains to
    parameterName String: The name of the parameter to be retrieved
    Returns
    GPParameter an instance of one of the subclasses of GPParameter (necessarily GPRasterDataLayer or
    Throws
    Exception the exception GPFeatureRecordSetLayer in this case)

    public String getUrl ()

    Gets the URL to the geoprocessing service.

    Returns
    String the url of the geoprocessing service

    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 SpatialReference: The spatial reference of the output geometries to set.

    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 SpatialReference: The spatial reference that the model will use to perform geometry operations to set

    public void setUrl (String url)

    Sets the URL to the geoprocessing service.

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

    public 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).
    The result of this operation is a GPJobResource containing information about the job submitted.

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