com.esri.arcgis.networkanalyst
Class NAServer

java.lang.Object
  extended by com.esri.arcgis.networkanalyst.NAServer
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, INAServer, INAServer2, IServerObjectExtension, ILogSupport, IObjectActivate, IObjectConstruct, IRequestHandler, IRequestHandler2, ISupportErrorInfo, Serializable

public class NAServer
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, INAServer, INAServer2, IServerObjectExtension, ILogSupport, IObjectActivate, IObjectConstruct, IRequestHandler, IRequestHandler2, ISupportErrorInfo

A MapServer object extension for performing network analysis within a stateless environment.

Remarks

The NAServer is a MapServer object extension that can be used to perform network analysis in a stateless environment using ArcGIS Server.

Product Availability

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.esri.arcgis.system.IObjectActivate
IID, IIDe3b78022_143e_4e61_9099_ed319ec061e7, xxDummy
 
Fields inherited from interface com.esri.arcgis.system.IRequestHandler
IID46a0e2ea_3b64_4a46_bd78_88a1660f35bb
 
Constructor Summary
NAServer()
          Constructs a NAServer using ArcGIS Engine.
NAServer(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
NAServer theNAServer = (NAServer) obj;
 
Method Summary
 void activate()
          Activates the object.
 void construct(IPropertySet props)
          Two phase object construction.
 void deactivate()
          Deactivates the object.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 String[] getNALayerNames(int layerType)
          Array of network analysis layers of a particular analysis type.
 INAServerNetworkDescription getNetworkDescription(String nALayerName)
          Description of the network dataset associated with the specified network analysis layer.
 INAServerSolverParams getSolverParameters(String nALayerName)
          Default solver parameters for the specified network analysis layer.
 INAServerSolverParams getSolverParameters2(String nALayerName, String layerToken, boolean populateNAClasses)
          Default solver parameters for the specified network analysis layer.
 byte[] handleBinaryRequest(byte[] request)
          Handles a binary request.
 byte[] handleBinaryRequest2(String capabilities, byte[] request)
          Handles a binary request with explicit capabilities.
 String handleStringRequest(String capabilities, String request)
          Handles a SOAP string request.
 int hashCode()
          the hashcode for this object
 void init(IServerObjectHelper pSOH)
          Initializes and starts the server object specified by the IServerObjectHelper reference.
 void initLogging(ILog log)
          Initializes an object with a log.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void shutdown()
          Stops the server object specified by the IServerObjectHelper reference.
 INAServerSolverResults solve(INAServerSolverParams nAServerSolverParams)
          Perform network analysis based on the input solve parameters.
 
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

NAServer

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

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

NAServer

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

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

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

getNALayerNames

public String[] getNALayerNames(int layerType)
                         throws IOException,
                                AutomationException
Array of network analysis layers of a particular analysis type.

Remarks

GetNALayerNames returns an array of names of NALayers of a given type. For example, you could use this method to find the names of all of the route analysis layers in the default map of the map server.

Product Availability

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

Specified by:
getNALayerNames in interface INAServer
Parameters:
layerType - A com.esri.arcgis.networkanalyst.esriNAServerLayerType constant (in)
Returns:
The nALayerNames
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNetworkDescription

public INAServerNetworkDescription getNetworkDescription(String nALayerName)
                                                  throws IOException,
                                                         AutomationException
Description of the network dataset associated with the specified network analysis layer.

Remarks

GetNetworkDescription returns an NAServerNetworkDescription object that allows you to retrieve things like the name of the network dataset as well as the sources and attributes within the network dataset.

Product Availability

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

Specified by:
getNetworkDescription in interface INAServer
Parameters:
nALayerName - The nALayerName (in)
Returns:
A reference to a com.esri.arcgis.networkanalyst.INAServerNetworkDescription
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSolverParameters

public INAServerSolverParams getSolverParameters(String nALayerName)
                                          throws IOException,
                                                 AutomationException
Default solver parameters for the specified network analysis layer.

Remarks

GetSolverParameters returns the NAServerSolverParams object (NAServerRouteParams, NAServerClosestFacilityParams, NAServerServiceAreaParams, NAServerLocationAllocationParams, NAServerODCostMatrixParams, NAServerVRPParams) corresponding to the NALayer name passed in. The parameter object returned will have defaults based on the NALayer it is referencing.

You can pass this resulting object into the Solve method on INAServer to perform network analysis.

Product Availability

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

Specified by:
getSolverParameters in interface INAServer
Parameters:
nALayerName - The nALayerName (in)
Returns:
A reference to a com.esri.arcgis.networkanalyst.INAServerSolverParams
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

solve

public INAServerSolverResults solve(INAServerSolverParams nAServerSolverParams)
                             throws IOException,
                                    AutomationException
Perform network analysis based on the input solve parameters.

Remarks

Solve performs network analysis based on the NAServerSolverParams object (NAServerRouteParams, NAServerClosestFacilityParams, NAServerServiceAreaParams) that was passed in and returns it's output through an NAServerSolverResults object (NAServerRouteResults, NAServerClosestFacilityResults, NAServerServiceAreaParams).

Product Availability

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

Specified by:
solve in interface INAServer
Parameters:
nAServerSolverParams - A reference to a com.esri.arcgis.networkanalyst.INAServerSolverParams (in)
Returns:
A reference to a com.esri.arcgis.networkanalyst.INAServerSolverResults
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSolverParameters2

public INAServerSolverParams getSolverParameters2(String nALayerName,
                                                  String layerToken,
                                                  boolean populateNAClasses)
                                           throws IOException,
                                                  AutomationException
Default solver parameters for the specified network analysis layer.

Remarks

GetSolverParameters2 returns the NAServerSolverParams object (NAServerRouteParams, NAServerClosestFacilityParams, NAServerServiceAreaParams, NAServerLocationAllocationParams, NAServerODCostMatrixParams, NAServerVRPParams) corresponding to the NALayerName and LayerToken passed in. if PopulateNAClasses was set to True, returned NAServerSolverParams instance will contain correspondent recordsets populated with content of NAClasses.

As opposed to GetSolverParameters, NAServerSolverParams instance returned by GetSolverParameters2 does not contain MapDescription and ImageDescription populated, which significantly reduces response size.

You can pass this resulting object into the Solve method on INAServer to perform network analysis.

LayerToken can be obtained from NAServerSolverResults object if the instance of NAServerSolverParams previously passed to the Solve method had SaveLayerOnServer set to True.

This method can be useful when, for example, multiple clients are working with a shared network analysis layer stored on server, or shared layer originally was created and saved on server by another client process.

Product Availability

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

Specified by:
getSolverParameters2 in interface INAServer2
Parameters:
nALayerName - The nALayerName (in)
layerToken - The layerToken (in)
populateNAClasses - The populateNAClasses (in)
Returns:
A reference to a com.esri.arcgis.networkanalyst.INAServerSolverParams
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

init

public void init(IServerObjectHelper pSOH)
          throws IOException,
                 AutomationException
Initializes and starts the server object specified by the IServerObjectHelper reference.

Product Availability

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

Specified by:
init in interface IServerObjectExtension
Parameters:
pSOH - A reference to a com.esri.arcgis.server.IServerObjectHelper (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

shutdown

public void shutdown()
              throws IOException,
                     AutomationException
Stops the server object specified by the IServerObjectHelper reference.

Product Availability

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

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

initLogging

public void initLogging(ILog log)
                 throws IOException,
                        AutomationException
Initializes an object with a log.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
initLogging in interface ILogSupport
Parameters:
log - A reference to a com.esri.arcgis.system.ILog (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

activate

public void activate()
              throws IOException,
                     AutomationException
Activates the object.

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

deactivate

public void deactivate()
                throws IOException,
                       AutomationException
Deactivates the object.

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

construct

public void construct(IPropertySet props)
               throws IOException,
                      AutomationException
Two phase object construction.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
construct in interface IObjectConstruct
Parameters:
props - A reference to a com.esri.arcgis.system.IPropertySet (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleBinaryRequest

public byte[] handleBinaryRequest(byte[] request)
                           throws IOException,
                                  AutomationException
Handles a binary request.

Specified by:
handleBinaryRequest in interface IRequestHandler
Parameters:
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleStringRequest

public String handleStringRequest(String capabilities,
                                  String request)
                           throws IOException,
                                  AutomationException
Handles a SOAP string request.

Specified by:
handleStringRequest in interface IRequestHandler
Parameters:
capabilities - The capabilities (in)
request - The request (in)
Returns:
The response
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

handleBinaryRequest2

public byte[] handleBinaryRequest2(String capabilities,
                                   byte[] request)
                            throws IOException,
                                   AutomationException
Handles a binary request with explicit capabilities.

Product Availability

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

Specified by:
handleBinaryRequest2 in interface IRequestHandler2
Parameters:
capabilities - The capabilities (in)
request - An unsigned byte (in)
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.