net.stff.ical
Class CalendarManager

java.lang.Object
  extended bynet.stff.ical.CalendarManager

public class CalendarManager
extends java.lang.Object


The CalendarManager presents the facade to the Calendar data. All access to Calendar data is routed through here.

Author:
buntekuh

Constructor Summary
CalendarManager()
           
 
Method Summary
 void addCalendar(ICal cal)
          Stores an ICal Object in the datastore
 void addCalendar(java.lang.String name, java.lang.String user)
          Adds a new Calendar.
 void delete(java.lang.String name, java.lang.String user)
          Deletes a calendar from the datastore.
 void deleteEvent(IEvent event)
          Deletes the given event from the datastore.
 ICal editEvent(IEvent event)
          Updates a given event in the datastore.
 ICal getCalendar(java.lang.String name, java.lang.String user)
          Retrieves a calendar.
 java.util.List getCalendarNames(java.lang.String user)
          Returns a List of all calendarnames associated to the given user.
 java.util.List getCalendars(java.lang.String user)
          Returns a List of all calendars associated to the given user.
 IEvent getEvent(java.lang.String id)
          Returns an event.
 java.util.List getEventsForPeriod(java.util.Date s, java.util.Date e, java.lang.String user, int which)
          Returns a List of events that start within the given time range.
 void rename(java.lang.String name, java.lang.String newName, java.lang.String user)
          Utility method to rename a given calendar
 void setColor(java.lang.String name, java.lang.String col, java.lang.String user)
          Utility method that saves the color attribute of a given calendar
 void setICalDAO(ICalDAO iCalDAO)
          Sets the DAO object.
 void setShown(java.lang.String name, boolean shown, java.lang.String user)
          Utility method that saves the shown attribute of a given calendar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarManager

public CalendarManager()
Method Detail

getCalendars

public java.util.List getCalendars(java.lang.String user)
Returns a List of all calendars associated to the given user.

Parameters:
user - The user associated to the calendars to be returned.
Returns:
Returns a List of all calendars created by the given user.

getCalendarNames

public java.util.List getCalendarNames(java.lang.String user)
Returns a List of all calendarnames associated to the given user.

Parameters:
user - The user associated to the calendarnames to be returned.
Returns:
Returns a list of all calendar names associated to the given user.

addCalendar

public void addCalendar(java.lang.String name,
                        java.lang.String user)
Adds a new Calendar.

Parameters:
name - The key under which the calendar is to be stored. The key must be unique for the given user.
user - The user to be associated to the new calendar.

addCalendar

public void addCalendar(ICal cal)
Stores an ICal Object in the datastore

Parameters:
cal - The Calendar object to be added

getCalendar

public ICal getCalendar(java.lang.String name,
                        java.lang.String user)
Retrieves a calendar.

Parameters:
name - The key under which the calendar is stored
user - The user that is associated to the calendar to return.
Returns:
The requested calendar.

getEventsForPeriod

public java.util.List getEventsForPeriod(java.util.Date s,
                                         java.util.Date e,
                                         java.lang.String user,
                                         int which)
Returns a List of events that start within the given time range.

Parameters:
s - The earliest moment a returned event is to sart at
e - The latest moment a returned event is to sart at
user - the associated user.
which - Discerns between available event types. @see iCalDAO
Returns:
Returns a List of events.

editEvent

public ICal editEvent(IEvent event)
Updates a given event in the datastore.

Parameters:
event - The event to be updated
Returns:
Returns the calendar wherein the event is stored in

getEvent

public IEvent getEvent(java.lang.String id)
Returns an event.

Parameters:
id - The event id.
Returns:

setShown

public void setShown(java.lang.String name,
                     boolean shown,
                     java.lang.String user)
Utility method that saves the shown attribute of a given calendar

Parameters:
name - The name under which the calendar is stored
shown - the value to be saved
user - The associated user

setColor

public void setColor(java.lang.String name,
                     java.lang.String col,
                     java.lang.String user)
Utility method that saves the color attribute of a given calendar

Parameters:
name - The name under which the calendar is stored
col - the value to be saved
user - The associated user

rename

public void rename(java.lang.String name,
                   java.lang.String newName,
                   java.lang.String user)
Utility method to rename a given calendar

Parameters:
name - The name under which the calendar is currently stored
newName - the new value for the calendar name
user - The associated user

delete

public void delete(java.lang.String name,
                   java.lang.String user)
Deletes a calendar from the datastore.

Parameters:
name - the name of the calendar to be deleted
user - the associated user

deleteEvent

public void deleteEvent(IEvent event)
Deletes the given event from the datastore.

Parameters:
event - the given event.

setICalDAO

public void setICalDAO(ICalDAO iCalDAO)
Sets the DAO object. The DAO object is the datastore specific implementation



Copyright © 2004-2005 stoffwechsel development GbR. All Rights Reserved.