Class ibm.aglets.util.SeqItinerary
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ibm.aglets.util.SeqItinerary

java.lang.Object
   |
   +----aglet.a4compatibility.Itinerary
           |
           +----ibm.aglets.util.SeqItinerary

public class SeqItinerary
extends Itinerary
implements Externalizable
The Itinerary class enables to define and take control over an aglet's tour.
Terminology:
tour   : a set of destinations to visit.
place  : a destination within a tour.
origin : the place which is considered as the original place from 
         which the tour is started. 
handler: the place to which an aglet can be dispatched in case of 
         unexpected events. The origin is the default handler.
log    : a record of messages to trace the aglet's tour.  

Constructor Index

 o SeqItinerary()
 o SeqItinerary(URL)
Creates an Itineray with a single destination.
 o SeqItinerary(Vector)
Creates an Itineray.

Method Index

 o clearLog()
Clear the log (remove all entries).
 o dispatchHandler(URL)
Dispatch an aglet to a specific URL.
 o getCurrentURL()
Tells the URL of the current visited place on the tour.
 o getOrigin()
returns the URL of the Origin.
 o go(String)
"origin" and NEXT are supported.
 o gotoByIndex(int)
Dispatch an aglet to a new place with a specific index.
 o gotoErrorHandler()
Dispatch an aglet to the handler.
 o gotoNext()
Dispatch an aglet to the next place in the tour.
 o gotoNextAvailable()
Dispatch an aglet to the next AVAILABLE place in the tour.
 o gotoOrigin()
Dispatch an aglet to the origin.
 o initialize()
Initialize the itinerary.
 o isAtHandler()
Tells whether the aglet is currently visiting the Handler host.
 o isAtLastDestination()
Tells whether the aglet is currently visiting the last place in the tour.
 o isAtOrigin()
Tells whether the aglet is currently located in the Origin host
 o isAvailable(String)
Currently, it always returns false
 o isCurrent(String)
"origin" and LAST are supported.
 o keywords()
 o logToString()
Converts the log to a string.
 o readExternal(ObjectInput)
 o reset()
Resets an aglet's tour as if the tour have not yet been started.
 o setHandler(URL)
Defines the URL of an host to which the aglet can be dispatched in cases of unexpected events during its tour.
 o setNumAllowedFailures(int)
Defines maximum number of allowed failures to visit a place during a tour.
 o setNumRetries(int)
Defines maximum number of retries to dispatch an aglet to a new place.
 o setSkipUnavailableHost(boolean)
Configures so that it will skip the host which is not rearchable.
 o writeExternal(ObjectOutput)

Constructors

 o SeqItinerary
  public SeqItinerary(URL destination)
Creates an Itineray with a single destination.
Parameters:
destination - the URL of the destinatibn to be visited.
 o SeqItinerary
  public SeqItinerary()
 o SeqItinerary
  public SeqItinerary(Vector destinations)
Creates an Itineray.
Parameters:
itinVector - a vector of URLs to visit.

Methods

 o writeExternal
  public void writeExternal(ObjectOutput out) throws IOException
 o readExternal
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
 o setSkipUnavailableHost
  public void setSkipUnavailableHost(boolean skip)
Configures so that it will skip the host which is not rearchable.
Parameters:
skip - true if you want to skip unavailable hosts. Default is false.
 o initialize
  protected void initialize()
Initialize the itinerary.
Overrides:
initialize in class Itinerary
 o gotoNextAvailable
  public void gotoNextAvailable() throws IOException, AgletException
Dispatch an aglet to the next AVAILABLE place in the tour.
 o gotoNext
  public void gotoNext() throws IOException, AgletException
Dispatch an aglet to the next place in the tour.
 o gotoByIndex
  public void gotoByIndex(int index) throws IOException, AgletException
Dispatch an aglet to a new place with a specific index.
 o reset
  public void reset()
Resets an aglet's tour as if the tour have not yet been started. The aglet is dispatched to the origin host.
Overrides:
reset in class Itinerary
 o gotoOrigin
  public void gotoOrigin() throws IOException, AgletException
Dispatch an aglet to the origin.
 o gotoErrorHandler
  public void gotoErrorHandler() throws IOException, AgletException
Dispatch an aglet to the handler.
 o logToString
  public String logToString()
Converts the log to a string.
 o clearLog
  public void clearLog()
Clear the log (remove all entries).
 o setHandler
  public void setHandler(URL handler)
Defines the URL of an host to which the aglet can be dispatched in cases of unexpected events during its tour.
 o setNumRetries
  public void setNumRetries(int num)
Defines maximum number of retries to dispatch an aglet to a new place.
 o setNumAllowedFailures
  public void setNumAllowedFailures(int num)
Defines maximum number of allowed failures to visit a place during a tour.
 o getCurrentURL
  public URL getCurrentURL()
Tells the URL of the current visited place on the tour.
 o isAtOrigin
  public boolean isAtOrigin()
Tells whether the aglet is currently located in the Origin host
 o isAtHandler
  public boolean isAtHandler()
Tells whether the aglet is currently visiting the Handler host.
 o isAtLastDestination
  public boolean isAtLastDestination()
Tells whether the aglet is currently visiting the last place in the tour. In case of an empty tour, it returns true.
 o getOrigin
  public URL getOrigin()
returns the URL of the Origin.
 o dispatchHandler
  protected void dispatchHandler(URL url) throws IOException, AgletException
Dispatch an aglet to a specific URL.
Throws: AgletException
if no traveller exists or dispatching is failed.
 o go
  public void go(String name) throws IOException, AgletException
"origin" and NEXT are supported.
Overrides:
go in class Itinerary
 o isCurrent
  public boolean isCurrent(String name)
"origin" and LAST are supported.
Overrides:
isCurrent in class Itinerary
 o isAvailable
  public boolean isAvailable(String name)
Currently, it always returns false
Overrides:
isAvailable in class Itinerary
 o keywords
  public String[] keywords()
Overrides:
keywords in class Itinerary

All Packages  Class Hierarchy  This Package  Previous  Next  Index