com.sage.orion.sdata.servlet
Interface TrackingIDMap

All Known Implementing Classes:
TrackingIDMapImpl

public interface TrackingIDMap

The TrackingMap is a map designed to handle tracking numbers.

TrackingIDs can be mapped with or without an associated Object.

TrackingIDs without an Object are temporary TrackingIDs that are only required for a short period of time. These TrackingIDs have an expiry period. Once the TrackingID has expired a call to cleanup() will remove the trackingID from the map. This should keep the size of the map down to a reasonable size.

TrackingIDs with an associated Object never expire. The caller must explicitly call remove to remove them from the map.

Author:
cliwa01

Method Summary
 void add(java.lang.String trackingID)
          Adds the given Tracking ID to the map.
 void add(java.lang.String trackingID, java.lang.Object object)
          Adds the given Tracking ID and object to the map.
 void cleanup()
          Runs a clean up routine on the Tracking Map.
 void clear()
          Clears out the Tracking ID Map.
 boolean exists(java.lang.String trackingID)
          Determines if the given Tracking ID exists in the map.
 java.lang.Object get(java.lang.String trackingID)
          Gets the object associated with the tracking ID.
 void remove(java.lang.String trackingID)
          Removes the given Tracking ID from the map.
 int size()
          Gets the size of the Tracking ID map.
 

Method Detail

exists

boolean exists(java.lang.String trackingID)
Determines if the given Tracking ID exists in the map.

Parameters:
trackingID - the Tracking ID to check for
Returns:
true if the given Tracking ID exists in the map

add

void add(java.lang.String trackingID)
Adds the given Tracking ID to the map.

Parameters:
trackingID - the Tracking ID to add

add

void add(java.lang.String trackingID,
         java.lang.Object object)
Adds the given Tracking ID and object to the map.

Parameters:
trackingID - the Tracking ID to add
object - the object to add keyed by the given Tracking ID

remove

void remove(java.lang.String trackingID)
Removes the given Tracking ID from the map.

Parameters:
trackingID - the Tracking ID to remove

cleanup

void cleanup()
Runs a clean up routine on the Tracking Map.


size

int size()
Gets the size of the Tracking ID map.

Returns:
the number of items in the map

get

java.lang.Object get(java.lang.String trackingID)
Gets the object associated with the tracking ID.

Parameters:
trackingID - the Tracking ID whose object is to be returned
Returns:
the object associated with the Tracking ID or null if no object is associated with the Tracking ID.

clear

void clear()
Clears out the Tracking ID Map.



Copyright © 2011 Sage Software, Inc. All rights reserved.