com.esri.arcgis.geoprocessing
Class GeoProcessor

java.lang.Object
  extended by com.esri.arcgis.geoprocessing.GeoProcessor
All Implemented Interfaces:
IGeoProcessor, IGeoProcessor2, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class GeoProcessor
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IGeoProcessor, IGeoProcessor2

GeoProcessor Access.

Remarks

A geoprocessing tool is executed by a geoprocessor. The geoprocessor is a helper object that simplifies the task of executing tools. Toolboxes define the set of tools available for the geoprocessor. Toolboxes can be added and removed from the geoprocessor.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
GeoProcessor()
          Constructs a GeoProcessor using ArcGIS Engine.
GeoProcessor(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
GeoProcessor theGeoProcessor = (GeoProcessor) obj;
 
Method Summary
 void addError(String message)
          Output an error message.
 void addMessage(String message)
          Output an informative message.
 void addReturnMessage(int index)
          Output message from the last tool executed.
 void addToolbox(String toolbox)
          Add a toolbox to the current Geoprocessing session by catalog path.
 void addWarning(String message)
          Output a warning message.
 void checkResultStatus(IGeoProcessorResult pGPResult)
          Check for end of result.
 void clearMessages()
          Clear the messages to be returned as tool message when running within a script tool.
 IGeoProcessorResult createResult(String toolName, String jobID)
          Create a new result object.
 boolean equals(Object o)
          Compare this object with another
 IGeoProcessorResult execute(GPTool tool, ITrackCancel pTrackCancel)
          This method executes a GPTool.
 IGeoProcessorResult execute(String name, IVariantArray ipValues, ITrackCancel pTrackCancel)
          Execute a tool within the current Geoprocessing session.
 IGeoProcessorResult executeASync(GPTool tool)
          This method executes a GPTool in the background.
 IGeoProcessorResult executeASync(String name, IVariantArray ipValues)
          Execute a tool within the current Geoprocessing session.
 boolean exists(Object inputValue, Object pDataType)
          Test the existence of a given parameter value (GPValue or catalog path) the type of the data is optional.
static String getClsid()
          getClsid.
 IDataElement getDataElement(Object inputValue, Object pDataType)
          Make a dataelement from the given value.
 Object getEnvironmentValue(String environmentName)
          Retrieve the value of an environment by name.
 int getMaxSeverity()
          Return the maximum severity of the message of the last tool executed.
 String getMessage(int index)
          Return the message description by index of the last tool executed.
 int getMessageCount()
          Return the number of messages of the last tool executed.
 String getMessages(Object pSeverity)
          Return all of the message descriptions of the last tool executed.
 int getParameterCount()
          Return the number of input command line or script tool parameters.
 Object getParameterValue(int index)
          Return the input command line or script tool parameter by index as a GPValue.
 int getReturnCode(int index)
          Return the message error code (Error Messages Only) by index of the last tool executed.
 IGPMessages getReturnMessages()
          Return the GPMessages object which will be messages of the last tool executed.
 int getSeverity(int index)
          Return the message severity by index of the last tool executed.
 int hashCode()
          the hashcode for this object
 boolean isAddOutputsToMap()
          Set whether resulting output datasets should be added to the application display.
 boolean isAddToResults()
          Set whether to add results to result view.
 boolean isLogHistory()
          Set whether or not to log the execution of geoprocessing tools.
 boolean isOverwriteOutput()
          Set the overwrite outputs flag within the current Geoprocessing session.
 boolean isSynchronous(String toolName)
          Is server tool synchronous.
 boolean isTemporaryMapLayers()
          Set whether new map layers are temporary by default.
 IGpEnumList listDatasets(String wildCard, String datasetType)
          Return the list of feature datasets within the current workspace.
 IGpEnumList listEnvironments(String wildCard)
          Return the list of environments (properties) within the current Geoprocessing session.
 IGpEnumList listFeatureClasses(String wildCard, String featureType, String dataset)
          Return the list of feature classes within the current workspace or feature dataset within the workspace.
 IGpEnumList listRasters(String wildCard, String rasterType)
          Return the list of rasters within the current workspace.
 IGpEnumList listTables(String wildCard, String tableType)
          Return the list of tables within the current workspace.
 IGpEnumList listToolboxes(String wildCard)
          Return the list of toolboxes within the current Geoprocessing session.
 IGpEnumList listTools(String wildCard)
          Return the list of tools within the current Geoprocessing session.
 IGpEnumList listWorkspaces(String wildCard, String workspaceType)
          Return the list of workspaces within the current workspace (the workspace can be a folder).
 void loadSettings(String fileName)
          Load the current settings (toolboxes, environment values, etc) from a file on disk in XML format.
 Object open(Object value)
          Open an objector a namestring.
 String parseFieldName(String inputFieldName, String workspace)
          Parse a field name within the given workspace.
 String parseTableName(String inputTableName, String workspace)
          Parse a table name within the given workspace.
 String qualifyFieldName(String inputFieldName, String workspace)
          Qualify a field name within the given workspace.
 String qualifyTableName(String inputTableName, String workspace)
          Qualify a table name within the given workspace.
 void registerGeoProcessorEvents(IGeoProcessorEvents pGeoProcessorEvents)
          Register an object to recieve IGeoProcessorEvents.
 void registerGeoProcessorEvents3(IGeoProcessorEvents3 pGeoProcessorEvents3)
          Register an object to recieve IGeoProcessorEvents3.
 void removeToolbox(String toolbox)
          Remove a toolbox from the current Geoprocessing session by catalog path.
 void resetEnvironments()
          Reset the environments to their initial state.
 void saveSettings(String fileName)
          Save the current settings (toolboxes, environment values, etc) to a file on disk in XML format.
 void setAddOutputsToMap(boolean addToMap)
          Set whether resulting output datasets should be added to the application display.
 void setAddToResults(boolean addToResults)
          Set whether to add results to result view.
 void setEnvironmentValue(String environmentName, Object value)
          Update the value of an environment by name.
 void setLogHistory(boolean logHistory)
          Set whether or not to log the execution of geoprocessing tools.
 void setOverwriteOutput(boolean pOverrideOutput)
          Set the overwrite outputs flag within the current Geoprocessing session.
 void setParameterValue(int index, Object value)
          Set the output script tool parameter by index as a GPValue.
 void setTemporaryMapLayers(boolean temporaryMapLayers)
          Set whether new map layers are temporary by default.
 String testSchemaLock(String fileName)
          Test for the presence of a schema lock (already open for writing) of a given file or dataset.
 void unRegisterGeoProcessorEvents(IGeoProcessorEvents pGeoProcessorEvents)
          UnRegister an object to stop recieving IGeoProcessorEvents.
 void unRegisterGeoProcessorEvents3(IGeoProcessorEvents3 pGeoProcessorEvents3)
          UnRegister an object to stop recieving IGeoProcessorEvents3.
 String usage(String method)
          Returns the command line usage of a given tool by name.
 IGPMessages validate(GPTool tool, boolean bUpdateValues)
          This method validates the parameters of the tool before execution.
 IGPMessages validate(String name, IVariantArray ipValues, boolean bUpdateValues)
          Validate the parameters (input) of a tool within the current Geoprocessing session.
 String validateFieldName(String inputFieldName, String workspace)
          Validate a field name within the given workspace.
 String validateTableName(String inputTableName, String workspace)
          Validate a table or feature class name within the given workspace.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

GeoProcessor

public GeoProcessor()
             throws IOException,
                    UnknownHostException
Constructs a GeoProcessor using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

GeoProcessor

public GeoProcessor(Object obj)
             throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
GeoProcessor theGeoProcessor = (GeoProcessor) obj;

Construct a GeoProcessor using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to GeoProcessor.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getEnvironmentValue

public Object getEnvironmentValue(String environmentName)
                           throws IOException,
                                  AutomationException
Retrieve the value of an environment by name. The properties of the current Geoprocessing session.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getEnvironmentValue in interface IGeoProcessor
Specified by:
getEnvironmentValue in interface IGeoProcessor2
Parameters:
environmentName - The environmentName (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setEnvironmentValue

public void setEnvironmentValue(String environmentName,
                                Object value)
                         throws IOException,
                                AutomationException
Update the value of an environment by name. The properties of the current Geoprocessing session.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setEnvironmentValue in interface IGeoProcessor
Specified by:
setEnvironmentValue in interface IGeoProcessor2
Parameters:
environmentName - The environmentName (in)
value - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

resetEnvironments

public void resetEnvironments()
                       throws IOException,
                              AutomationException
Reset the environments to their initial state.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
resetEnvironments in interface IGeoProcessor
Specified by:
resetEnvironments in interface IGeoProcessor2
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

execute

public IGeoProcessorResult execute(String name,
                                   IVariantArray ipValues,
                                   ITrackCancel pTrackCancel)
                            throws IOException,
                                   AutomationException
Execute a tool within the current Geoprocessing session.

Remarks

To get examples on how to use the Execute method, read How to run a geoprocessing tool topic.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
execute in interface IGeoProcessor
Specified by:
execute in interface IGeoProcessor2
Parameters:
name - The name (in)
ipValues - A reference to a com.esri.arcgis.system.IVariantArray (in)
pTrackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validate

public IGPMessages validate(String name,
                            IVariantArray ipValues,
                            boolean bUpdateValues)
                     throws IOException,
                            AutomationException
Validate the parameters (input) of a tool within the current Geoprocessing session.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
validate in interface IGeoProcessor
Specified by:
validate in interface IGeoProcessor2
Parameters:
name - The name (in)
ipValues - A reference to a com.esri.arcgis.system.IVariantArray (in)
bUpdateValues - The bUpdateValues (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IGPMessages
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

open

public Object open(Object value)
            throws IOException,
                   AutomationException
Open an objector a namestring. Example a DEFeatureClass object will return an IFeatureClass.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
open in interface IGeoProcessor
Specified by:
open in interface IGeoProcessor2
Parameters:
value - A Variant (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataElement

public IDataElement getDataElement(Object inputValue,
                                   Object pDataType)
                            throws IOException,
                                   AutomationException
Make a dataelement from the given value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDataElement in interface IGeoProcessor
Specified by:
getDataElement in interface IGeoProcessor2
Parameters:
inputValue - A Variant (in)
pDataType - A Variant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IDataElement
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listTools

public IGpEnumList listTools(String wildCard)
                      throws IOException,
                             AutomationException
Return the list of tools within the current Geoprocessing session.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listTools in interface IGeoProcessor
Specified by:
listTools in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listEnvironments

public IGpEnumList listEnvironments(String wildCard)
                             throws IOException,
                                    AutomationException
Return the list of environments (properties) within the current Geoprocessing session.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listEnvironments in interface IGeoProcessor
Specified by:
listEnvironments in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listToolboxes

public IGpEnumList listToolboxes(String wildCard)
                          throws IOException,
                                 AutomationException
Return the list of toolboxes within the current Geoprocessing session.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listToolboxes in interface IGeoProcessor
Specified by:
listToolboxes in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addToolbox

public void addToolbox(String toolbox)
                throws IOException,
                       AutomationException
Add a toolbox to the current Geoprocessing session by catalog path.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
addToolbox in interface IGeoProcessor
Specified by:
addToolbox in interface IGeoProcessor2
Parameters:
toolbox - The toolbox (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeToolbox

public void removeToolbox(String toolbox)
                   throws IOException,
                          AutomationException
Remove a toolbox from the current Geoprocessing session by catalog path.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
removeToolbox in interface IGeoProcessor
Specified by:
removeToolbox in interface IGeoProcessor2
Parameters:
toolbox - The toolbox (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAddOutputsToMap

public void setAddOutputsToMap(boolean addToMap)
                        throws IOException,
                               AutomationException
Set whether resulting output datasets should be added to the application display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setAddOutputsToMap in interface IGeoProcessor
Specified by:
setAddOutputsToMap in interface IGeoProcessor2
Parameters:
addToMap - The addToMap (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isAddOutputsToMap

public boolean isAddOutputsToMap()
                          throws IOException,
                                 AutomationException
Set whether resulting output datasets should be added to the application display.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isAddOutputsToMap in interface IGeoProcessor
Specified by:
isAddOutputsToMap in interface IGeoProcessor2
Returns:
The addToMap
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setOverwriteOutput

public void setOverwriteOutput(boolean pOverrideOutput)
                        throws IOException,
                               AutomationException
Set the overwrite outputs flag within the current Geoprocessing session. True means outputs of tools will be overwritten.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setOverwriteOutput in interface IGeoProcessor
Specified by:
setOverwriteOutput in interface IGeoProcessor2
Parameters:
pOverrideOutput - The pOverrideOutput (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isOverwriteOutput

public boolean isOverwriteOutput()
                          throws IOException,
                                 AutomationException
Set the overwrite outputs flag within the current Geoprocessing session. True means outputs of tools will be overwritten.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isOverwriteOutput in interface IGeoProcessor
Specified by:
isOverwriteOutput in interface IGeoProcessor2
Returns:
The pOverrideOutput
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTemporaryMapLayers

public void setTemporaryMapLayers(boolean temporaryMapLayers)
                           throws IOException,
                                  AutomationException
Set whether new map layers are temporary by default.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setTemporaryMapLayers in interface IGeoProcessor
Specified by:
setTemporaryMapLayers in interface IGeoProcessor2
Parameters:
temporaryMapLayers - The temporaryMapLayers (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isTemporaryMapLayers

public boolean isTemporaryMapLayers()
                             throws IOException,
                                    AutomationException
Set whether new map layers are temporary by default.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isTemporaryMapLayers in interface IGeoProcessor
Specified by:
isTemporaryMapLayers in interface IGeoProcessor2
Returns:
The temporaryMapLayers
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setLogHistory

public void setLogHistory(boolean logHistory)
                   throws IOException,
                          AutomationException
Set whether or not to log the execution of geoprocessing tools.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setLogHistory in interface IGeoProcessor
Specified by:
setLogHistory in interface IGeoProcessor2
Parameters:
logHistory - The logHistory (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isLogHistory

public boolean isLogHistory()
                     throws IOException,
                            AutomationException
Set whether or not to log the execution of geoprocessing tools.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isLogHistory in interface IGeoProcessor
Specified by:
isLogHistory in interface IGeoProcessor2
Returns:
The logHistory
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getReturnMessages

public IGPMessages getReturnMessages()
                              throws IOException,
                                     AutomationException
Return the GPMessages object which will be messages of the last tool executed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getReturnMessages in interface IGeoProcessor
Specified by:
getReturnMessages in interface IGeoProcessor2
Returns:
A reference to a com.esri.arcgis.geodatabase.IGPMessages
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMessageCount

public int getMessageCount()
                    throws IOException,
                           AutomationException
Return the number of messages of the last tool executed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMessageCount in interface IGeoProcessor
Specified by:
getMessageCount in interface IGeoProcessor2
Returns:
The pCount
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMessage

public String getMessage(int index)
                  throws IOException,
                         AutomationException
Return the message description by index of the last tool executed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMessage in interface IGeoProcessor
Specified by:
getMessage in interface IGeoProcessor2
Parameters:
index - The index (in)
Returns:
The pMessage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSeverity

public int getSeverity(int index)
                throws IOException,
                       AutomationException
Return the message severity by index of the last tool executed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getSeverity in interface IGeoProcessor
Specified by:
getSeverity in interface IGeoProcessor2
Parameters:
index - The index (in)
Returns:
The pSeverity
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getReturnCode

public int getReturnCode(int index)
                  throws IOException,
                         AutomationException
Return the message error code (Error Messages Only) by index of the last tool executed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getReturnCode in interface IGeoProcessor
Specified by:
getReturnCode in interface IGeoProcessor2
Parameters:
index - The index (in)
Returns:
The pCode
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMessages

public String getMessages(Object pSeverity)
                   throws IOException,
                          AutomationException
Return all of the message descriptions of the last tool executed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMessages in interface IGeoProcessor
Specified by:
getMessages in interface IGeoProcessor2
Parameters:
pSeverity - A Variant (in)
Returns:
The pMessages
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaxSeverity

public int getMaxSeverity()
                   throws IOException,
                          AutomationException
Return the maximum severity of the message of the last tool executed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getMaxSeverity in interface IGeoProcessor
Specified by:
getMaxSeverity in interface IGeoProcessor2
Returns:
The pSeverity
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addMessage

public void addMessage(String message)
                throws IOException,
                       AutomationException
Output an informative message. When running within a script tool, message becomes part of the tool messages, otherwise outputs to console

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
addMessage in interface IGeoProcessor
Specified by:
addMessage in interface IGeoProcessor2
Parameters:
message - The message (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addError

public void addError(String message)
              throws IOException,
                     AutomationException
Output an error message. When running within a script tool, message becomes part of the tool messages, otherwise outputs to console

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
addError in interface IGeoProcessor
Specified by:
addError in interface IGeoProcessor2
Parameters:
message - The message (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addWarning

public void addWarning(String message)
                throws IOException,
                       AutomationException
Output a warning message. When running within a script tool, message becomes part of the tool messages, otherwise outputs to console

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
addWarning in interface IGeoProcessor
Specified by:
addWarning in interface IGeoProcessor2
Parameters:
message - The message (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addReturnMessage

public void addReturnMessage(int index)
                      throws IOException,
                             AutomationException
Output message from the last tool executed. When running within a script tool, message becomes part of the tool messages, otherwise outputs to console

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
addReturnMessage in interface IGeoProcessor
Specified by:
addReturnMessage in interface IGeoProcessor2
Parameters:
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearMessages

public void clearMessages()
                   throws IOException,
                          AutomationException
Clear the messages to be returned as tool message when running within a script tool.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
clearMessages in interface IGeoProcessor
Specified by:
clearMessages in interface IGeoProcessor2
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getParameterCount

public int getParameterCount()
                      throws IOException,
                             AutomationException
Return the number of input command line or script tool parameters.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getParameterCount in interface IGeoProcessor
Specified by:
getParameterCount in interface IGeoProcessor2
Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getParameterValue

public Object getParameterValue(int index)
                         throws IOException,
                                AutomationException
Return the input command line or script tool parameter by index as a GPValue.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getParameterValue in interface IGeoProcessor
Specified by:
getParameterValue in interface IGeoProcessor2
Parameters:
index - The index (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setParameterValue

public void setParameterValue(int index,
                              Object value)
                       throws IOException,
                              AutomationException
Set the output script tool parameter by index as a GPValue.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setParameterValue in interface IGeoProcessor
Specified by:
setParameterValue in interface IGeoProcessor2
Parameters:
index - The index (in)
value - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

exists

public boolean exists(Object inputValue,
                      Object pDataType)
               throws IOException,
                      AutomationException
Test the existence of a given parameter value (GPValue or catalog path) the type of the data is optional.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
exists in interface IGeoProcessor
Specified by:
exists in interface IGeoProcessor2
Parameters:
inputValue - A Variant (in)
pDataType - A Variant (in)
Returns:
The exists
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

usage

public String usage(String method)
             throws IOException,
                    AutomationException
Returns the command line usage of a given tool by name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows

Specified by:
usage in interface IGeoProcessor
Specified by:
usage in interface IGeoProcessor2
Parameters:
method - The method (in)
Returns:
The usage
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listFeatureClasses

public IGpEnumList listFeatureClasses(String wildCard,
                                      String featureType,
                                      String dataset)
                               throws IOException,
                                      AutomationException
Return the list of feature classes within the current workspace or feature dataset within the workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listFeatureClasses in interface IGeoProcessor
Specified by:
listFeatureClasses in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
featureType - The featureType (in)
dataset - The dataset (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listDatasets

public IGpEnumList listDatasets(String wildCard,
                                String datasetType)
                         throws IOException,
                                AutomationException
Return the list of feature datasets within the current workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listDatasets in interface IGeoProcessor
Specified by:
listDatasets in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
datasetType - The datasetType (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listWorkspaces

public IGpEnumList listWorkspaces(String wildCard,
                                  String workspaceType)
                           throws IOException,
                                  AutomationException
Return the list of workspaces within the current workspace (the workspace can be a folder).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listWorkspaces in interface IGeoProcessor
Specified by:
listWorkspaces in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
workspaceType - The workspaceType (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listTables

public IGpEnumList listTables(String wildCard,
                              String tableType)
                       throws IOException,
                              AutomationException
Return the list of tables within the current workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listTables in interface IGeoProcessor
Specified by:
listTables in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
tableType - The tableType (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

listRasters

public IGpEnumList listRasters(String wildCard,
                               String rasterType)
                        throws IOException,
                               AutomationException
Return the list of rasters within the current workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
listRasters in interface IGeoProcessor
Specified by:
listRasters in interface IGeoProcessor2
Parameters:
wildCard - The wildCard (in)
rasterType - The rasterType (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGpEnumList
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validateFieldName

public String validateFieldName(String inputFieldName,
                                String workspace)
                         throws IOException,
                                AutomationException
Validate a field name within the given workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
validateFieldName in interface IGeoProcessor
Specified by:
validateFieldName in interface IGeoProcessor2
Parameters:
inputFieldName - The inputFieldName (in)
workspace - The workspace (in)
Returns:
The outputFieldName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

validateTableName

public String validateTableName(String inputTableName,
                                String workspace)
                         throws IOException,
                                AutomationException
Validate a table or feature class name within the given workspace.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
validateTableName in interface IGeoProcessor
Specified by:
validateTableName in interface IGeoProcessor2
Parameters:
inputTableName - The inputTableName (in)
workspace - The workspace (in)
Returns:
The outputTableName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

qualifyFieldName

public String qualifyFieldName(String inputFieldName,
                               String workspace)
                        throws IOException,
                               AutomationException
Qualify a field name within the given workspace. This will add the connected user and database names.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
qualifyFieldName in interface IGeoProcessor
Specified by:
qualifyFieldName in interface IGeoProcessor2
Parameters:
inputFieldName - The inputFieldName (in)
workspace - The workspace (in)
Returns:
The outputFieldName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

qualifyTableName

public String qualifyTableName(String inputTableName,
                               String workspace)
                        throws IOException,
                               AutomationException
Qualify a table name within the given workspace. This will add the connected user and database names.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
qualifyTableName in interface IGeoProcessor
Specified by:
qualifyTableName in interface IGeoProcessor2
Parameters:
inputTableName - The inputTableName (in)
workspace - The workspace (in)
Returns:
The outputTableName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

parseFieldName

public String parseFieldName(String inputFieldName,
                             String workspace)
                      throws IOException,
                             AutomationException
Parse a field name within the given workspace. This will strip the connected user and database names.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
parseFieldName in interface IGeoProcessor
Specified by:
parseFieldName in interface IGeoProcessor2
Parameters:
inputFieldName - The inputFieldName (in)
workspace - The workspace (in)
Returns:
The outputParsedName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

parseTableName

public String parseTableName(String inputTableName,
                             String workspace)
                      throws IOException,
                             AutomationException
Parse a table name within the given workspace. This will strip the connected user and database names.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
parseTableName in interface IGeoProcessor
Specified by:
parseTableName in interface IGeoProcessor2
Parameters:
inputTableName - The inputTableName (in)
workspace - The workspace (in)
Returns:
The outputParsedName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

saveSettings

public void saveSettings(String fileName)
                  throws IOException,
                         AutomationException
Save the current settings (toolboxes, environment values, etc) to a file on disk in XML format.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
saveSettings in interface IGeoProcessor
Specified by:
saveSettings in interface IGeoProcessor2
Parameters:
fileName - The fileName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

loadSettings

public void loadSettings(String fileName)
                  throws IOException,
                         AutomationException
Load the current settings (toolboxes, environment values, etc) from a file on disk in XML format.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
loadSettings in interface IGeoProcessor
Specified by:
loadSettings in interface IGeoProcessor2
Parameters:
fileName - The fileName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

testSchemaLock

public String testSchemaLock(String fileName)
                      throws IOException,
                             AutomationException
Test for the presence of a schema lock (already open for writing) of a given file or dataset.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
testSchemaLock in interface IGeoProcessor
Specified by:
testSchemaLock in interface IGeoProcessor2
Parameters:
fileName - The fileName (in)
Returns:
The pStatus
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

registerGeoProcessorEvents

public void registerGeoProcessorEvents(IGeoProcessorEvents pGeoProcessorEvents)
                                throws IOException,
                                       AutomationException
Register an object to recieve IGeoProcessorEvents.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
registerGeoProcessorEvents in interface IGeoProcessor
Specified by:
registerGeoProcessorEvents in interface IGeoProcessor2
Parameters:
pGeoProcessorEvents - A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorEvents (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

unRegisterGeoProcessorEvents

public void unRegisterGeoProcessorEvents(IGeoProcessorEvents pGeoProcessorEvents)
                                  throws IOException,
                                         AutomationException
UnRegister an object to stop recieving IGeoProcessorEvents.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
unRegisterGeoProcessorEvents in interface IGeoProcessor
Specified by:
unRegisterGeoProcessorEvents in interface IGeoProcessor2
Parameters:
pGeoProcessorEvents - A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorEvents (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createResult

public IGeoProcessorResult createResult(String toolName,
                                        String jobID)
                                 throws IOException,
                                        AutomationException
Create a new result object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
createResult in interface IGeoProcessor
Specified by:
createResult in interface IGeoProcessor2
Parameters:
toolName - The toolName (in)
jobID - The jobID (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isSynchronous

public boolean isSynchronous(String toolName)
                      throws IOException,
                             AutomationException
Is server tool synchronous.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isSynchronous in interface IGeoProcessor
Specified by:
isSynchronous in interface IGeoProcessor2
Parameters:
toolName - The toolName (in)
Returns:
The isSynchronous
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

executeASync

public IGeoProcessorResult executeASync(String name,
                                        IVariantArray ipValues)
                                 throws IOException,
                                        AutomationException
Execute a tool within the current Geoprocessing session.

Description

Executes a tool in a background process, allowing the ArcGIS application and controls to remain responsive to user input.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
executeASync in interface IGeoProcessor2
Parameters:
name - The name (in)
ipValues - A reference to a com.esri.arcgis.system.IVariantArray (in)
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorResult
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

registerGeoProcessorEvents3

public void registerGeoProcessorEvents3(IGeoProcessorEvents3 pGeoProcessorEvents3)
                                 throws IOException,
                                        AutomationException
Register an object to recieve IGeoProcessorEvents3.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
registerGeoProcessorEvents3 in interface IGeoProcessor2
Parameters:
pGeoProcessorEvents3 - A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorEvents3 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

unRegisterGeoProcessorEvents3

public void unRegisterGeoProcessorEvents3(IGeoProcessorEvents3 pGeoProcessorEvents3)
                                   throws IOException,
                                          AutomationException
UnRegister an object to stop recieving IGeoProcessorEvents3.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
unRegisterGeoProcessorEvents3 in interface IGeoProcessor2
Parameters:
pGeoProcessorEvents3 - A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorEvents3 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

checkResultStatus

public void checkResultStatus(IGeoProcessorResult pGPResult)
                       throws IOException,
                              AutomationException
Check for end of result.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
checkResultStatus in interface IGeoProcessor2
Parameters:
pGPResult - A reference to a com.esri.arcgis.geoprocessing.IGeoProcessorResult (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAddToResults

public void setAddToResults(boolean addToResults)
                     throws IOException,
                            AutomationException
Set whether to add results to result view.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setAddToResults in interface IGeoProcessor2
Parameters:
addToResults - The addToResults (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isAddToResults

public boolean isAddToResults()
                       throws IOException,
                              AutomationException
Set whether to add results to result view.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isAddToResults in interface IGeoProcessor2
Returns:
The addToResults
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

execute

public IGeoProcessorResult execute(GPTool tool,
                                   ITrackCancel pTrackCancel)
                            throws IOException
This method executes a GPTool. After the execution the Geoprocessor, calling getReturnMessages to view the messages generated by executing this tool.

Parameters:
tool - GPTool - A tool with all it's required values set.
{@link - ITrackCancel} - If you do not wish to allow cancellation of a running Geoproceesing execution then you can pass in null
Returns:
Object The result from the Geoprocessor, which is usually a String or an Object representation of the a native type.
Throws:
IOException

executeASync

public IGeoProcessorResult executeASync(GPTool tool)
                                 throws IOException
This method executes a GPTool in the background. This method will return immediately after submitting the GPTool for execution. Notifications about the progress of the tool's execution will be sent through the IGeoProcessorEvents3 interface. Interested client programs should register an event listener that implements IGeoProcessoeEvents3, with the Geoprocessor Geoprocessor.

Parameters:
tool - GPTool - A tool with all it's required values set.
Returns:
IGeoProcessorResult The result from the Geoprocessor
Throws:
IOException

validate

public IGPMessages validate(GPTool tool,
                            boolean bUpdateValues)
                     throws IOException
This method validates the parameters of the tool before execution. Any errors will be returned in the IGPMessages. It can be helpful to call this method before calling execute to catch errors in parameter values on the tool.

Parameters:
tool - The tool to executed
bUpdateValues - determines whether or not to update the values.
Returns:
IGPMessagesthe GPmessages returned from the validate call.
Throws:
IOException