Module com.esri.arcgisruntime
Class LocalGeoprocessingService
java.lang.Object
com.esri.arcgisruntime.localserver.LocalService
com.esri.arcgisruntime.localserver.LocalGeoprocessingService
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.
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
Modifier and TypeClassDescriptionstatic enum
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
ConstructorDescriptionLocalGeoprocessingService
(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
Modifier and TypeMethodDescriptionint
Gets the maximum number of records the service will return.Gets the parameters needed to start the local service.Returns the service type.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 Details
-
LocalGeoprocessingService
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 Details
-
setServiceType
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
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
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
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
-