All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ajanta.apps.calendar.CalendarDB

java.lang.Object
   |
   +----ajanta.util.ResourceImpl
           |
           +----ajanta.apps.calendar.CalendarDB

public class CalendarDB
extends ResourceImpl
implements Calendar, AccessProtocol
CalendarDatabase is a Resource object serving as database recording the schedule of activities and appointments for a user. It stores DayEvents in a hash table keyed on the date. This Hashtable is serealized to the file "home_dir/.ajanta/servers/calendarServer/HashTableDB".


Constructor Index

 o CalendarDB()

Method Index

 o checkConflict(CalendarEvent)
method checks if a given event clashes with an existing appointment.
 o deleteEvent(DayEvents, CalendarEvent)
Delete a CalendarEvent from a given DayEvent
 o getDayEvents(Date)
Return DayEvents for the given date
 o getProxy(Credentials)
return proxy to the CalendarDB based on credentials
 o printDayEvents(Date)
Print DayEvents for the given date
 o readCalDB()
Initialize the hashtable by reading serialized hashtable
 o readHashTable()
Update the hashtable by reading serialized hashtable
 o ScheduleEvent(CalendarEvent)
method allows the agent to schedule a particular appointment by inserting an entry into the database.
 o writeHashTable()
hashtable is serialized to the file

Constructors

 o CalendarDB
 public CalendarDB()

Methods

 o ScheduleEvent
 public synchronized void ScheduleEvent(CalendarEvent e)
method allows the agent to schedule a particular appointment by inserting an entry into the database.

 o deleteEvent
 public synchronized void deleteEvent(DayEvents dEvent,
                                      CalendarEvent e)
Delete a CalendarEvent from a given DayEvent

Parameters:
dEvent - the DayEvent
e - CalendarEvent to be deleted
 o getDayEvents
 public DayEvents getDayEvents(Date day)
Return DayEvents for the given date

 o printDayEvents
 public void printDayEvents(Date day)
Print DayEvents for the given date

 o checkConflict
 public boolean checkConflict(CalendarEvent e)
method checks if a given event clashes with an existing appointment.

Returns:
true if it clashes flase otherwise
 o getProxy
 public Resource getProxy(Credentials cred)
return proxy to the CalendarDB based on credentials

 o readHashTable
 public void readHashTable()
Update the hashtable by reading serialized hashtable

 o writeHashTable
 public void writeHashTable()
hashtable is serialized to the file

 o readCalDB
 public void readCalDB()
Initialize the hashtable by reading serialized hashtable


All Packages  Class Hierarchy  This Package  Previous  Next  Index