Class 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 Detail

      • 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 Detail

      • 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