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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LocalGeoprocessingService.ServiceType
The geoprocessing service types.-
Nested classes/interfaces inherited from class com.esri.arcgisruntime.localserver.LocalService
LocalService.StatusChangedEvent, LocalService.StatusChangedListener
-
-
Field Summary
-
Fields inherited from class com.esri.arcgisruntime.localserver.LocalService
mEndpoints
-
-
Constructor Summary
Constructors Constructor Description LocalGeoprocessingService(String packagePath)
Creates a local geoprocessing service from a package (.gpk file).LocalGeoprocessingService(String packagePath, LocalGeoprocessingService.ServiceType serviceType)
Creates a local geoprocessing service from a package (.gpk file) and sets the service type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMaxRecords()
Gets the maximum number of records the service will return.protected Map<String,String>
getParameters()
Gets the parameters needed to start the local service.LocalGeoprocessingService.ServiceType
getServiceType()
Returns the service type.String
getUrl()
Returns the URL of this geoprocessing service.void
setMaxRecords(int maxRecords)
Sets the maximum number of records returned by the service.void
setServiceType(LocalGeoprocessingService.ServiceType serviceType)
Sets the service type.-
Methods inherited from class com.esri.arcgisruntime.localserver.LocalService
addStatusChangedListener, getError, getName, getPackagePath, getStatus, removeStatusChangedListener, startAsync, stopAsync
-
-
-
-
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 packageserviceType
- the service type- Throws:
IllegalArgumentException
- if the package path is null or emptyIllegalArgumentException
- if the service type is null or empty- Since:
- 100.0.0
-
-
Method Detail
-
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 stoppedIllegalArgumentException
- 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 lessIllegalStateException
- 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 classLocalService
- 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 classLocalService
- Returns:
- returns a map containing the parameters
- Throws:
UnsupportedEncodingException
-
-