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".
-
CalendarDB()
-
-
checkConflict(CalendarEvent)
- method checks if a given event clashes with an existing appointment.
-
deleteEvent(DayEvents, CalendarEvent)
- Delete a CalendarEvent from a given DayEvent
-
getDayEvents(Date)
- Return DayEvents for the given date
-
getProxy(Credentials)
- return proxy to the CalendarDB based on credentials
-
printDayEvents(Date)
- Print DayEvents for the given date
-
readCalDB()
- Initialize the hashtable by reading serialized hashtable
-
readHashTable()
- Update the hashtable by reading serialized hashtable
-
ScheduleEvent(CalendarEvent)
- method allows the agent to schedule a particular appointment by inserting
an entry into the database.
-
writeHashTable()
- hashtable is serialized to the file
CalendarDB
public CalendarDB()
ScheduleEvent
public synchronized void ScheduleEvent(CalendarEvent e)
- method allows the agent to schedule a particular appointment by inserting
an entry into the database.
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
getDayEvents
public DayEvents getDayEvents(Date day)
- Return DayEvents for the given date
printDayEvents
public void printDayEvents(Date day)
- Print DayEvents for the given date
checkConflict
public boolean checkConflict(CalendarEvent e)
- method checks if a given event clashes with an existing appointment.
- Returns:
- true if it clashes flase otherwise
getProxy
public Resource getProxy(Credentials cred)
- return proxy to the CalendarDB based on credentials
readHashTable
public void readHashTable()
- Update the hashtable by reading serialized hashtable
writeHashTable
public void writeHashTable()
- hashtable is serialized to the file
readCalDB
public void readCalDB()
- Initialize the hashtable by reading serialized hashtable
All Packages Class Hierarchy This Package Previous Next Index