Class LocalGeoprocessingService

java.lang.Object
com.esri.arcgisruntime.localserver.LocalService
com.esri.arcgisruntime.localserver.LocalGeoprocessingService

public final class LocalGeoprocessingService extends LocalService
A class representing a local geoprocessing service which runs on an instance of Local Server.
A local geoprocessing service requires a geoprocessing package file (.gpk) which will have been authored in ArcGIS Desktop.
Since:
100.0.0
  • Constructor Details

    • LocalGeoprocessingService

      public LocalGeoprocessingService(String packagePath)
      Creates a local geoprocessing service from a package (.gpk file).
      Parameters:
      packagePath - the path to the package
      Throws:
      IllegalArgumentException - if the package path is null or empty
      Since:
      100.0.0
    • LocalGeoprocessingService

      public LocalGeoprocessingService(String packagePath, LocalGeoprocessingService.ServiceType serviceType)
      Creates a local geoprocessing service from a package (.gpk file) and sets the service type.
      Parameters:
      packagePath - the path to the package
      serviceType - the service type
      Throws:
      IllegalArgumentException - if the package path is null or empty
      IllegalArgumentException - if the service type is null or empty
      Since:
      100.0.0
  • Method Details

    • setServiceType

      public void setServiceType(LocalGeoprocessingService.ServiceType serviceType)
      Sets the service type. This can only be set before the service is started. It cannot be set on a running service.
      Parameters:
      serviceType - the service type
      Throws:
      IllegalStateException - if the service is not currently stopped
      IllegalArgumentException - if the service type is null
      Since:
      100.0.0
    • getServiceType

      public LocalGeoprocessingService.ServiceType getServiceType()
      Returns the service type.
      Returns:
      the service type
      Since:
      100.0.0
    • getMaxRecords

      public int getMaxRecords()
      Gets the maximum number of records the service will return. The default value is 10000.
      Returns:
      the maximum number of records the service will return
      Since:
      100.0.0
    • setMaxRecords

      public void setMaxRecords(int maxRecords)
      Sets the maximum number of records returned by the service. Cannot be set on a running service.
      Parameters:
      maxRecords - the maximum number of records
      Throws:
      IllegalArgumentException - if the value is zero or less
      IllegalStateException - if the service is not in the STOPPED state
      Since:
      100.0.0
    • getUrl

      public String getUrl()
      Returns the URL of this geoprocessing service. The URL is required for creating a geoprocessing task which takes the service URL and the task name as shown in the example below:
      GeoprocessingTask gpTask = new GeoprocessingTask(localGPService.getUrl() + "/MessageInABottle");
      Specified by:
      getUrl in class LocalService
      Returns:
      the URL
      Since:
      100.0.0
    • getParameters

      protected Map<String,String> getParameters() throws UnsupportedEncodingException
      Description copied from class: LocalService
      Gets the parameters needed to start the local service.
      Overrides:
      getParameters in class LocalService
      Returns:
      returns a map containing the parameters
      Throws:
      UnsupportedEncodingException