com.esri.arcgis.networkanalyst
Interface INALayer2

All Superinterfaces:
INALayer, Serializable
All Known Subinterfaces:
INALayer3
All Known Implementing Classes:
NALayer

public interface INALayer2
extends INALayer, Serializable

Provides access to the network analysis layer.

Remarks

The INALayer2 interface is used to access the NAContext, access individual sublayers by specifying the name of the NAClass, manage the sublayers within the NALayer, as well as manage the state of an NALayer's context within the server environment.

CopyContext makes a copy of the NALayer's NAContext that can be persisted within a user's session state. AttachContext re-attaches an NAContext to the NALayer.

CopyContext, AttachContext, and DataLayerByNAClassName should not be used from within ArcMap because user interface components listening to events on the NAContext will not have an opportunity to switch to the new NAContext.

Product Availability

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


Method Summary
 void attachContext(INAContext nAContext)
          Sets the NALayer to reference the NAContext and the sublayers to reference the NAClasses of the NAContext.
 INAContext copyContext()
          Returns a copy of the NAContext referenced by the NALayer.
 IDataLayer getDataLayerByNAClassName(String name)
          The network analysis layer or standalone table by class name.
 
Methods inherited from interface com.esri.arcgis.networkanalyst.INALayer
add, clear, delete, getContext, getLayerByNAClassName, isExpanded, setContextByRef, setExpanded
 

Method Detail

copyContext

INAContext copyContext()
                       throws IOException,
                              AutomationException
Returns a copy of the NAContext referenced by the NALayer.

Remarks

CopyContext makes a copy of the NALayer's NAContext that can later be re-applied to the NALayer. This method should only be used in conjunction with the AttachContext within Server or Engine applications.

Product Availability

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

Returns:
A reference to a com.esri.arcgis.networkanalyst.INAContext
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

attachContext

void attachContext(INAContext nAContext)
                   throws IOException,
                          AutomationException
Sets the NALayer to reference the NAContext and the sublayers to reference the NAClasses of the NAContext.

Remarks

AttachContext sets the NALayer's NAContext to be the input context and reconnects the NALayer's sublayers to the context.

You must first call INAContextEdit.Bind on the NAContext prior to passing it in to AttachContext.

This method should only be used with NAContext objects created via INALayer2.CopyContext. It should also only be used within Server or Engine applications, using these functions within ArcMap will lead to unexpected behavior within the Network Analyst tools.

Product Availability

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

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

getDataLayerByNAClassName

IDataLayer getDataLayerByNAClassName(String name)
                                     throws IOException,
                                            AutomationException
The network analysis layer or standalone table by class name.

Product Availability

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

Parameters:
name - The name (in)
Returns:
A reference to a com.esri.arcgis.carto.IDataLayer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.