server
Class CalendarDatabase

java.lang.Object
  extended byserver.CalendarDatabase

public final class CalendarDatabase
extends java.lang.Object

A object of this class encapsulates the whole calendar database on the server side. This class is used for getting/modifying and adding/removing of calendar events.

Author:
buetow

Constructor Summary
CalendarDatabase(java.util.Vector vecCategories)
          Simple constructur.
 
Method Summary
 void addEvent(ClientRequest clientRequest)
          This method adds a calendar event to the calendar database.
 void deleteEvent(ClientRequest clientRequest)
          This method deletes a calendar event of the calendar database.
 void flush()
          This method flushes all the changed calendar categories of the calendar database to the filesystem.
 java.util.Vector getAllEvents()
          This method returns a Vector of all available calendar events.
 java.util.Vector getCategories()
          Gets all calendar categories.
 CalendarCategory getCategory(java.lang.String sCategoryName)
          Returns a specific calendar category using fast hash lookup.
 CalendarEvent getEvent(int iEventID)
          Returns a specific calendar event using fast hash lookup.
 java.util.Vector getMatchingEvents(ClientRequest clientRequest)
          This method looks for all calendar events which match the a given client request.
 void modifyEvent(ClientRequest clientRequest)
          This method modifies an calendar event of the calendar database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarDatabase

public CalendarDatabase(java.util.Vector vecCategories)
Simple constructur. Creates a calendar database.

Parameters:
vecCategories - Specifies the vector of CalendarCategory objects for initial database content.
Method Detail

getEvent

public CalendarEvent getEvent(int iEventID)
Returns a specific calendar event using fast hash lookup.

Parameters:
iEventID - Specifies the ID of the calendar event to lookup.
Returns:
Returns the requested calendar event.

getCategory

public CalendarCategory getCategory(java.lang.String sCategoryName)
Returns a specific calendar category using fast hash lookup.

Parameters:
sCategoryName - Specifies the name of the calendar category to lookup.
Returns:
Returns the requested calendar category.

getCategories

public java.util.Vector getCategories()
Gets all calendar categories.

Returns:
Returns a Vector of all available CalendarCategory objects.

getAllEvents

public java.util.Vector getAllEvents()
This method returns a Vector of all available calendar events.

Returns:
Returns all available CalendarEvent objects of the database.

getMatchingEvents

public java.util.Vector getMatchingEvents(ClientRequest clientRequest)
This method looks for all calendar events which match the a given client request.

Parameters:
clientRequest - Specifies the client request sent by the calendar client.
Returns:
Returns a Vector of all matching CalendarEvent objects.

addEvent

public void addEvent(ClientRequest clientRequest)
This method adds a calendar event to the calendar database.

Parameters:
clientRequest - Specifies the client request sent by the netcalendar client. Its containing the new event to add.

modifyEvent

public void modifyEvent(ClientRequest clientRequest)
This method modifies an calendar event of the calendar database.

Parameters:
clientRequest - Specifies the client request sent by the calendar client.

deleteEvent

public void deleteEvent(ClientRequest clientRequest)
This method deletes a calendar event of the calendar database. If the specified calendar event doesnt exist eny more, nothing will be changed.

Parameters:
clientRequest - Specifies the client request sent by the netcalendar client.

flush

public void flush()
This method flushes all the changed calendar categories of the calendar database to the filesystem.