All Packages Class Hierarchy This Package Previous Next Index
Class ajanta.apps.calendar.sequence.CalendarAgent
java.lang.Object
|
+----ajanta.agent.Agent
|
+----ajanta.agent.ItinAgent
|
+----ajanta.apps.calendar.sequence.CalendarAgent
- public class CalendarAgent
- extends ItinAgent
The CalendarAgent which uses the Sequence pattern extends the ItinAgent class.
A calendar agent is created with a list of possible options for meeting times.
This is encapsulated in the agent as an object called Briefcase}, which is a
list of choices. The agent first visits all servers to check for conflicts for
each of the choices. If at the end of the first round it finds at least one
choice when none of the participants have a conflict, it revisits them again
to insert an event in each participant's calendar database.
-
br
-
-
CalendarAgent(Credentials)
-
-
CalendarAgent(Credentials, Itinerary)
-
-
arrive()
- The arrive method obtains a reference to the calendar database object of the
the current server using the getResource primitive.
-
checkDepartStatus(int)
- This method uses a local flag firstRound to check if the first round for
checking conflicts is over.
-
Conflict()
-
The Conflict method is executed at a CalendarServer of a participant to check
if there are any conflicts with the participant's schedule and any of the
requested timings.
-
createItinerary(String)
-
It cretes Itinerary for the agent for methods "schedule" or "conflict"
by reading the briefcase
-
Schedule()
- The schedule method is executed at the participant's CalendarServer to
insert an event in the server's database.
-
schedulingPhase()
- It checks the results of the first round and creates another briefcase for
second round by inserting all the free slots.
-
setBriefcase(Briefcase)
- Sets the briefcase of the Agent to the "b" passed as argument
br
protected Briefcase br
CalendarAgent
public CalendarAgent(Credentials cred)
CalendarAgent
public CalendarAgent(Credentials cred,
Itinerary itin)
- Parameters:
- cred - Credentials of the agent
- itin - Itinerary object of the agent
arrive
public void arrive()
- The arrive method obtains a reference to the calendar database object of the
the current server using the getResource primitive.
- Overrides:
- arrive in class ItinAgent
checkDepartStatus
public void checkDepartStatus(int status)
- This method uses a local flag firstRound to check if the first round for
checking conflicts is over. If so, it resets the itinerary to execute the
second round of visit by the agent.This method is executed after depart method.
- Overrides:
- checkDepartStatus in class ItinAgent
setBriefcase
public void setBriefcase(Briefcase b)
- Sets the briefcase of the Agent to the "b" passed as argument
createItinerary
protected void createItinerary(String method)
- It cretes Itinerary for the agent for methods "schedule" or "conflict"
by reading the briefcase
- Parameters:
- method - name of the method
Conflict
public void Conflict()
- The Conflict method is executed at a CalendarServer of a participant to check
if there are any conflicts with the participant's schedule and any of the
requested timings. This is done by calling the checkConflict method of the
CalendarDatabase of that participant.
schedulingPhase
protected void schedulingPhase()
- It checks the results of the first round and creates another briefcase for
second round by inserting all the free slots.
Schedule
public void Schedule()
- The schedule method is executed at the participant's CalendarServer to
insert an event in the server's database. This is done by calling the
scheduleEvent method of the CalendarDatabase object through a proxy.
All Packages Class Hierarchy This Package Previous Next Index