001/*
002 *  Copyright 2014 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.workspaces.calendars;
017
018import java.time.ZonedDateTime;
019import java.util.List;
020import java.util.Map;
021
022import org.ametys.plugins.explorer.ExplorerNode;
023import org.ametys.plugins.repository.TraversableAmetysObject;
024import org.ametys.plugins.workspaces.calendars.events.CalendarEvent;
025import org.ametys.plugins.workspaces.calendars.events.CalendarEventOccurrence;
026
027/**
028 * Calendar Interface
029 */
030public interface Calendar extends ExplorerNode, TraversableAmetysObject
031{
032    /**
033     * Enumeration of calendar visiblity
034     */
035    public enum CalendarVisibility
036    {
037        /** Public */
038        PUBLIC,
039        /** Private */
040        PRIVATE;
041    }
042    
043    /**
044     * Get the color of the calendar
045     * @return the color of the calendar
046     */
047    public String getColor();
048    
049    /**
050     * Get the calendar visibility
051     * @return the calendar visibility
052     */
053    public CalendarVisibility getVisibility();
054    
055    /**
056     * Get the name of the workflow of the calendar
057     * @return the name of the workflow of the calendar
058     */
059    public String getWorkflowName();
060    
061    /**
062     * Get the template description of the calendar
063     * @return the template description of the calendar
064     */
065    public String getTemplateDescription();
066    
067    /**
068     * Get the events and its occurrences of the calendar between two dates
069     * @param startDate Begin date
070     * @param endDate End date
071     * @return the map of events and its occurrences
072     */
073    public Map<CalendarEvent, List<CalendarEventOccurrence>> getEvents(ZonedDateTime startDate, ZonedDateTime endDate);
074    
075    /**
076     * Get the token used by the ICS public URL
077     * @return The token, or null if no token exists for the calendar
078     */
079    public String getIcsUrlToken();
080}