View Javadoc

1   /*
2    * This file is part of Domingo
3    * an Open Source Java-API to Lotus Notes/Domino
4    * hosted at http://domingo.sourceforge.net
5    *
6    * Copyright (c) 2003-2007 Beck et al. projects GmbH Munich, Germany (http://www.bea.de)
7    *
8    * This library is free software; you can redistribute it and/or
9    * modify it under the terms of the GNU Lesser General Public
10   * License as published by the Free Software Foundation; either
11   * version 2.1 of the License, or (at your option) any later version.
12   *
13   * This library is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   * Lesser General Public License for more details.
17   *
18   * You should have received a copy of the GNU Lesser General Public
19   * License along with this library; if not, write to the Free Software
20   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21   */
22  
23  package de.bea.domingo.groupware;
24  
25  import java.util.Calendar;
26  import java.util.Iterator;
27  import java.util.List;
28  
29  /***
30   * Interface to the calendar functionality of a Notes mail database.
31   *
32   * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
33   */
34  public interface CalendarInterface {
35  
36      /***
37       * Saves a new calendar entry.
38       *
39       * @param entry the calendar entry to save
40       */
41      void save(final CalendarEntry entry);
42  
43      /***
44       * Returns calendar objects within the specified time frame.
45       *
46       * @param from start date
47       * @param to end date
48       * @return list of calendar entries
49       */
50      List getObjects(Calendar from, Calendar to);
51  
52      /***
53       * Returns an iterator over all entries in the Calendar.
54       *
55       * @return iterator over all entries in the Calendar.
56       */
57      Iterator getCalendar();
58  
59      /***
60       * Returns an iterator over all entries in the Calendar.
61       *
62       * <p>Depending on how the Calendar is sorted (ascending or descending by
63       * date), choose where to start reading entries.</p>
64       *
65       * @param reverseOrder <code>true</code> if iterator should iterate in
66       *            reverse order
67       * @return iterator over all entries in the Calendar.
68       */
69      Iterator getCalendar(final boolean reverseOrder);
70  
71      /***
72       * Given a CalendarEntryDigest, retrieve the corresponding CalendarEntry.
73       * @param ced the calendar entry digest
74       * @return CalendarEntry
75       */
76      Object getCalendarEntry(final CalendarEntryDigest ced);
77  
78      /***
79       * Returns a calendar entry for a given unid.
80       * @see de.bea.domingo.groupware.CalendarEntry#getAppointmentUnid()
81       *
82       * @param unid the Notes document unid
83       * @return the calendar entry
84       * @throws GroupwareException if the calendar entry cannot be
85       * found or mapped.
86       */
87       Object getCalendarEntry(final String unid) throws GroupwareException;
88  
89      /***
90       * Deletes an existing calendar entry.
91       *
92       * @param entry an entry to delete
93       */
94      void remove(final CalendarEntry entry);
95  
96      /***
97       * Deletes an existing calendar entry.
98       *
99       * @param digest a calendar entry digest to delete
100      */
101     void remove(final CalendarEntryDigest digest);
102 
103 
104 }