com.esri.arcgis.networkanalyst
Interface INAAgent

All Superinterfaces:
Serializable
All Known Implementing Classes:
NACompactStreetDirectionsAgent, NAStreetDirectionsAgent

public interface INAAgent
extends Serializable

Provides access to properties/methods common to all network analysis agents.

Remarks

INAAgent is the interface implemented by objects that wish to be attached to the NAContext and to be notified when various events occur like when the context or the context's results are updated.

The NAStreetDirectionsAgent is an extension to the NAContext that implements INAAgent to generate street directions.

Product Availability

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


Method Summary
 boolean applies(IDENetworkDataset network, INAContextHelper contextHelper)
          Indicates if the agent is appropriate to use with the given network dataset.
 String getName()
          The name of the agent.
 void initialize(IDENetworkDataset network, INAContextHelper contextHelper)
          Get the agent ready for action.
 void onContextUpdated()
          Called when the context is updated.
 void onResultUpdated()
          Called when a result is updated.
 

Method Detail

getName

String getName()
               throws IOException,
                      AutomationException
The name of the agent.

Remarks

Returns the name of the agent. This property is implemented within the agent; there is no need to set this property.

Product Availability

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

Returns:
The agentName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

applies

boolean applies(IDENetworkDataset network,
                INAContextHelper contextHelper)
                throws IOException,
                       AutomationException
Indicates if the agent is appropriate to use with the given network dataset.

Remarks

The method Applies indicates if the NAAgent should be attached to the NAContext referenced by the input INAContextHelper.


Applies returns true if the agent is applicable and has not already been attached to the NAContext. For example, a NAStreetDirectionsAgent will only apply to solvers that support driving directions.

Product Availability

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

Parameters:
network - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
contextHelper - A reference to a com.esri.arcgis.networkanalyst.INAContextHelper (in)
Returns:
The agentApplies
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initialize

void initialize(IDENetworkDataset network,
                INAContextHelper contextHelper)
                throws IOException,
                       AutomationException
Get the agent ready for action.

Remarks

Initialize is called when the NAContext::Bind is called and the NAContext is getting into a consistent state.

Product Availability

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

Parameters:
network - A reference to a com.esri.arcgis.geodatabase.IDENetworkDataset (in)
contextHelper - A reference to a com.esri.arcgis.networkanalyst.INAContextHelper (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onResultUpdated

void onResultUpdated()
                     throws IOException,
                            AutomationException
Called when a result is updated.

Remarks

OnResultUpdated is called when the NAContext::Result object has been updated. For example, this would be called after INASolver::Solve.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onContextUpdated

void onContextUpdated()
                      throws IOException,
                             AutomationException
Called when the context is updated.

Remarks

OnContextUpdated is called when the NAContext object has been updated. For example, this would be called after a network location has been added or removed.

Product Availability

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

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.