Sun ONE logo     Previous      Contents      Index      Next     
Sun ONE Web Services Platform Developer Edition Developer's Guide



Logistics Sample Application: Sample Data

Sample Data in Logistics

The Logistics Sample Application comes with pre-populated data. The data is loaded into the database when the schema is loaded into PointBase using the supplied .sql (cargoline.sql and insurance.sql) file. To make the application more interesting and easy to use, several objects were created in the system.

Ports

The following ports exist in the Cargo Line database system:

  • SFO: San Francisco
  • MUM: Mumbai
  • LON: London
  • SIN: Singapore

Routes

Routes are simply combinations of origin and destination ports. A route object has a route name, origin, and destination ports.

Voyages consist of one or more (in this case, two) routes.

The image below shows the routes in the system. The arrows represent the route, and the number, the route_id. For example, route_id 1 is from San Francisco (SFO) to London (LON).

Routes in the System
This screen capture shows the routes in the system.

Ships

Ships have name and capacity. Voyages attach ships to routes for particular dates.

The Ships table below shows the ships that are in the sample data.

   Ships

ARIZONA

 

ECSTACY

 

MAYFLOWER

 

VICTORIA

 

VIKRANT

 

PRITHVI

 

ELIZABETH

 

BLUEBIRD

 

Voyages

Voyages are important to being able to successfully create Shipment requests.

To make shipment creation simple, several voyages were added in the sample data. A frequency field was added in the voyage creation, making it easy for users to create large numbers of voyages. It is important to note that both dates and remaining quantity. Voyages are created in all the routes shown above.

To create shipments without creating voyages, use the following criteria.

  1. Select one of the routes as origin/destination ports.
  2. Specify the date needed by before July 2003.
  3. TEU Quantities should be < 100.

    For more information, refer to the data in the voyage table in the database.

Users

There are several kinds of users in Cargo Line. The two types are employees and customers. Employees can belong to one of three different roles. Manager, Routing Agent, and Customer Agent. Managers can create other employee roles and Customers. Creating new managers is not currently supported.

The Cargo Line organization data, which includes users, is stored in the Sun ONE Identity Server.

The following are the userid/passwords for users:

Managers: manager/manager

Routing Agents: ragent/ragent

Customer Agents: cagent/cagent

Customers: sam, alex, kalpana

(The password is the same as the user ID.)

Routing Algorithm

The Logistics Sample Application implements a simplistic Routing Algorithm to determine the shipment path taken. It limits to a maximum of a one hop between the source and destination.

This is how the Algorithm works:

  1. Check to see if there is a direct path which matches the criteria.
  2. If yes, return the value.

    If multiple voyages are found, return the one that is the cheapest (determined by the cost per unit of shipment for the voyage).

  3. If the direct path is not found, get all voyages that start from startPort, in between the two dates.
  4. If none are found, return null.

  5. Get all voyages that end on the destinationPort, in between the two dates.
  6. If none are found, return null.

    From the result sets of steps 2 and 3 above, check to see if there can be a Path with one routing hop (destinationPort from step 2 is the same as startPort from step 3, with end date from step 2 is less than start date from step 3). If such a condition is found, return the result (two voyages) as a Collection, or else return a null. If the condition yields more than one result, return the path that is cheapest.


Previous      Contents      Index      Next     
Copyright 2003 Sun Microsystems, Inc. All rights reserved.