com.esri.arcgis.geodatabase
Class TrafficDataManager

java.lang.Object
  extended by com.esri.arcgis.geodatabase.TrafficDataManager
All Implemented Interfaces:
ITrafficDataManager, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class TrafficDataManager
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ITrafficDataManager

A class for creating/managing dynamic traffic files for dynamic traffic feeds.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
TrafficDataManager()
          Constructs a TrafficDataManager using ArcGIS Engine.
TrafficDataManager(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
TrafficDataManager theTrafficDataManager = (TrafficDataManager) obj;
 
Method Summary
 int convertTMCToKey(String tmcCode)
          Converts a TMC string to a unique integer key value.
 void deleteData(String feedFolderPath, Date utcCutoffDate)
          Deletes all dynamic traffic files in the specified folder which are older than the specified cutoff date.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 void insert(int key, IDoubleArray pTimeSliceSpeeds)
          Inserts the speed values per time slice for the specified TMC key.
 void startEditing(Date feedUTCStartTime, int estimatedKeyCount, int timeSliceCount, Date firstTimeSliceUTCStartTime, int timeSliceDurationInMinutes, int speedUnits, int updateIntervalInMinutes, int feedVersionNumber)
          Starts a new edit session for tracking edits to a new dynamic traffic file.
 void stopEditing(String feedFolderPath, boolean createCompressedFile)
          Stops the current edit session and writes all current edits to a new dynamic traffic file in the specified folder.
 
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

TrafficDataManager

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

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

TrafficDataManager

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

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

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

startEditing

public void startEditing(Date feedUTCStartTime,
                         int estimatedKeyCount,
                         int timeSliceCount,
                         Date firstTimeSliceUTCStartTime,
                         int timeSliceDurationInMinutes,
                         int speedUnits,
                         int updateIntervalInMinutes,
                         int feedVersionNumber)
                  throws IOException,
                         AutomationException
Starts a new edit session for tracking edits to a new dynamic traffic file.

Remarks

StartEditing must be called before Insert and StopEditing, in order to begin the process of creating a dynamic traffic file.

EstimatedKeyCount should be a value close to the number of keys that are going to be inserted into the traffic file. This value is used to help manage memory allocation for inserts.

TimeSliceCount is the number of time ranges for which each key will have a speed.

FirstTimeSliceUTCStartTime is the time associated with the first time range for each inserted key.

TimeSliceDurationInMinutes is the duration, in minutes, that each time slice should represent.

SpeedUnits is the units of measurement that will be associated with the speed values included in key inserts.

UpdateIntervalInMinutes is used by the solver to know when it should attempt to retrieve the next available DTF. When scheduling traffic updates that repeat periodically, make this update interval value match how often new data updates occur.


The combination of TimeSliceCount, TimeSliceDurationInMinutes, and FirstTimeSliceUTCStartTime give the TrafficDataManager the information it needs to set up the schema of the dynamic traffic file. For example, 2 time slices of 15 minutes each that start at 08:00 will create 2 ranges of time from 08:00 to 08:14:59 and 08:15 to 08:29:59.

Product Availability

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

Specified by:
startEditing in interface ITrafficDataManager
Parameters:
feedUTCStartTime - The feedUTCStartTime (in)
estimatedKeyCount - The estimatedKeyCount (in)
timeSliceCount - The timeSliceCount (in)
firstTimeSliceUTCStartTime - The firstTimeSliceUTCStartTime (in)
timeSliceDurationInMinutes - The timeSliceDurationInMinutes (in)
speedUnits - A com.esri.arcgis.geodatabase.esriNetworkAttributeUnits constant (in)
updateIntervalInMinutes - The updateIntervalInMinutes (in)
feedVersionNumber - The feedVersionNumber (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

insert

public void insert(int key,
                   IDoubleArray pTimeSliceSpeeds)
            throws IOException,
                   AutomationException
Inserts the speed values per time slice for the specified TMC key.

Remarks

StartEditing must be called before Insert and StopEditing, in order to begin the process of creating a dynamic traffic file.


The Key value should be retrieved by passing a TMC to ConvertTMCToKey. Keys are used to replace TMC values, in order to change the alpha-numeric TMC value into a unique unsigned integer.

pTimeSliceSpeeds is an array of double values that must have an equivalent number of entries as the value passed to TimeSliceCount in StartEditing. The values in the array represent the speed associated with the TMC for each of the time slices.

Product Availability

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

Specified by:
insert in interface ITrafficDataManager
Parameters:
key - The key (in)
pTimeSliceSpeeds - A reference to a com.esri.arcgis.system.IDoubleArray (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stopEditing

public void stopEditing(String feedFolderPath,
                        boolean createCompressedFile)
                 throws IOException,
                        AutomationException
Stops the current edit session and writes all current edits to a new dynamic traffic file in the specified folder.

Remarks

StartEditing must be called before Insert and StopEditing, in order to begin the process of creating a dynamic traffic file.

FeedFolderPath is a path to the directory that will hold the dynamic traffic files.

Product Availability

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

Specified by:
stopEditing in interface ITrafficDataManager
Parameters:
feedFolderPath - The feedFolderPath (in)
createCompressedFile - The createCompressedFile (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteData

public void deleteData(String feedFolderPath,
                       Date utcCutoffDate)
                throws IOException,
                       AutomationException
Deletes all dynamic traffic files in the specified folder which are older than the specified cutoff date.

Remarks

When real-time traffic is updated regularly, there is the potential for the dynamic traffic files to accumulate beyond what is needed. Use DeleteData to clean up the dynamic traffic file folder to only contain the files referring to traffic after a specified date and time.

FeedFolderPath is a path to an existing directory that contains dynamic traffic files.

Any files that represent traffic from before the UTCCutoffDate will be deleted.

Product Availability

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

Specified by:
deleteData in interface ITrafficDataManager
Parameters:
feedFolderPath - The feedFolderPath (in)
utcCutoffDate - The utcCutoffDate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

convertTMCToKey

public int convertTMCToKey(String tmcCode)
                    throws IOException,
                           AutomationException
Converts a TMC string to a unique integer key value.

Remarks

The alpha-numeric TMC string values must be converted to unique integer key values in order to be used by Insert to place associated speeds in a dynamic traffic file.

Product Availability

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

Specified by:
convertTMCToKey in interface ITrafficDataManager
Parameters:
tmcCode - The tmcCode (in)
Returns:
The pKey
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.