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.
-
SeqItinerary()
-
-
SeqItinerary(URL)
- Creates an Itineray with a single destination.
-
SeqItinerary(Vector)
- Creates an Itineray.
-
clearLog()
- Clear the log (remove all entries).
-
dispatchHandler(URL)
- Dispatch an aglet to a specific URL.
-
getCurrentURL()
- Tells the URL of the current visited place on the tour.
-
getOrigin()
- returns the URL of the Origin.
-
go(String)
- "origin" and NEXT are supported.
-
gotoByIndex(int)
-
Dispatch an aglet to a new place with a specific index.
-
gotoErrorHandler()
- Dispatch an aglet to the handler.
-
gotoNext()
- Dispatch an aglet to the next place in the tour.
-
gotoNextAvailable()
- Dispatch an aglet to the next AVAILABLE place in the tour.
-
gotoOrigin()
-
Dispatch an aglet to the origin.
-
initialize()
- Initialize the itinerary.
-
isAtHandler()
- Tells whether the aglet is currently visiting the Handler host.
-
isAtLastDestination()
- Tells whether the aglet is currently visiting the last place in the tour.
-
isAtOrigin()
-
Tells whether the aglet is currently located in the Origin host
-
isAvailable(String)
- Currently, it always returns false
-
isCurrent(String)
- "origin" and LAST are supported.
-
keywords()
-
-
logToString()
- Converts the log to a string.
-
readExternal(ObjectInput)
-
-
reset()
-
Resets an aglet's tour as if the tour have not yet been started.
-
setHandler(URL)
- Defines the URL of an host to which the aglet can be
dispatched in cases of unexpected events during its tour.
-
setNumAllowedFailures(int)
- Defines maximum number of allowed failures to visit a place
during a tour.
-
setNumRetries(int)
- Defines maximum number of retries to dispatch an aglet to
a new place.
-
setSkipUnavailableHost(boolean)
- Configures so that it will skip the host which is not rearchable.
-
writeExternal(ObjectOutput)
-
SeqItinerary
public SeqItinerary(URL destination)
- Creates an Itineray with a single destination.
- Parameters:
- destination - the URL of the destinatibn to be visited.
SeqItinerary
public SeqItinerary()
SeqItinerary
public SeqItinerary(Vector destinations)
- Creates an Itineray.
- Parameters:
- itinVector - a vector of URLs to visit.
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
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.
initialize
protected void initialize()
- Initialize the itinerary.
- Overrides:
- initialize in class Itinerary
gotoNextAvailable
public void gotoNextAvailable() throws IOException, AgletException
- Dispatch an aglet to the next AVAILABLE place in the tour.
gotoNext
public void gotoNext() throws IOException, AgletException
- Dispatch an aglet to the next place in the tour.
gotoByIndex
public void gotoByIndex(int index) throws IOException, AgletException
- Dispatch an aglet to a new place with a specific index.
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
gotoOrigin
public void gotoOrigin() throws IOException, AgletException
- Dispatch an aglet to the origin.
gotoErrorHandler
public void gotoErrorHandler() throws IOException, AgletException
- Dispatch an aglet to the handler.
logToString
public String logToString()
- Converts the log to a string.
clearLog
public void clearLog()
- Clear the log (remove all entries).
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.
setNumRetries
public void setNumRetries(int num)
- Defines maximum number of retries to dispatch an aglet to
a new place.
setNumAllowedFailures
public void setNumAllowedFailures(int num)
- Defines maximum number of allowed failures to visit a place
during a tour.
getCurrentURL
public URL getCurrentURL()
- Tells the URL of the current visited place on the tour.
isAtOrigin
public boolean isAtOrigin()
- Tells whether the aglet is currently located in the Origin host
isAtHandler
public boolean isAtHandler()
- Tells whether the aglet is currently visiting the Handler host.
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.
getOrigin
public URL getOrigin()
- returns the URL of the Origin.
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.
go
public void go(String name) throws IOException, AgletException
- "origin" and NEXT are supported.
- Overrides:
- go in class Itinerary
isCurrent
public boolean isCurrent(String name)
- "origin" and LAST are supported.
- Overrides:
- isCurrent in class Itinerary
isAvailable
public boolean isAvailable(String name)
- Currently, it always returns false
- Overrides:
- isAvailable in class Itinerary
keywords
public String[] keywords()
- Overrides:
- keywords in class Itinerary
All Packages Class Hierarchy This Package Previous Next Index