Interface AgendaCalendarService


  • public interface AgendaCalendarService
    • Method Detail

      • getCalendars

        List<Calendar> getCalendars​(int offset,
                                    int limit,
                                    String username)
                             throws Exception
        Retrieve list of calendars for a designated user
        Parameters:
        offset - Offset of the search
        limit - Limit of results to retrieve
        username - User name accessing calendars
        Returns:
        List of Calendar
        Throws:
        Exception - when an error occurs while retrieving calendars from database
      • countCalendars

        int countCalendars​(String username)
                    throws Exception
        Count available calendars for a designated user
        Parameters:
        username - User name accessing calendars
        Returns:
        count of available calendars
        Throws:
        Exception - when an error occurs while accessing database
      • getCalendarById

        Calendar getCalendarById​(long calendarId,
                                 String username)
                          throws IllegalAccessException
        Retrieves a calendar identified by its technical identifier.
        Parameters:
        calendarId - technical identifier of a calendar
        username - User name accessing calendar
        Returns:
        A Calendar object
        Throws:
        IllegalAccessException - when user is not authorized to access calendar
      • getCalendarById

        Calendar getCalendarById​(long calendarId)
        Retrieves a calendar identified by its technical identifier.
        Parameters:
        calendarId - technical identifier of a calendar
        Returns:
        A Calendar object
      • getOrCreateCalendarByOwnerId

        Calendar getOrCreateCalendarByOwnerId​(long ownerId)
        Parameters:
        ownerId - Calendar technical identifier
        Returns:
        Calendar if found in database else create it
      • createCalendar

        Calendar createCalendar​(Calendar calendar,
                                String username)
                         throws IllegalAccessException
        Creates a new calendar
        Parameters:
        calendar - Calendar object to create
        username - User name creating calendar
        Returns:
        created Calendar with generated technical identifier
        Throws:
        IllegalAccessException - when user is not authorized to create a calendar for the designated owner defined in object
      • createCalendar

        Calendar createCalendar​(Calendar calendar)
        Creates a new calendar
        Parameters:
        calendar - Calendar object to create
        Returns:
        created Calendar with generated technical identifier
      • createCalendarInstance

        Calendar createCalendarInstance​(long ownerId)
        Create new Calendar object instance
        Parameters:
        ownerId - Identity technical id of the Calendar
        Returns:
        Calendar object instance
      • createCalendarInstance

        Calendar createCalendarInstance​(long ownerId,
                                        long userIdentityId)
                                 throws IllegalAccessException
        Create new Calendar object instance
        Parameters:
        ownerId - Identity technical id of the Calendar
        userIdentityId - user identity Technical Identifier accessing Calendar
        Returns:
        Calendar object instance
        Throws:
        IllegalAccessException - when user is not authorized to access calendar of the designated owner
      • updateCalendar

        void updateCalendar​(Calendar calendar,
                            String username)
                     throws IllegalAccessException,
                            org.exoplatform.commons.exception.ObjectNotFoundException
        Updates an existing calendar
        Parameters:
        calendar - Calendar object to update
        username - User name updating calendar
        Throws:
        IllegalAccessException - when user is not authorized to update the calendar
        org.exoplatform.commons.exception.ObjectNotFoundException - when the calendar identified by its technical identifier is not found
      • updateCalendar

        void updateCalendar​(Calendar calendar)
                     throws org.exoplatform.commons.exception.ObjectNotFoundException
        Updates an existing calendar
        Parameters:
        calendar - Calendar object to update
        Throws:
        org.exoplatform.commons.exception.ObjectNotFoundException - when the calendar identified by its technical identifier is not found
      • deleteCalendarById

        void deleteCalendarById​(long calendarId,
                                String username)
                         throws IllegalAccessException,
                                org.exoplatform.commons.exception.ObjectNotFoundException
        Deletes an existing calendar
        Parameters:
        calendarId - Calendar technical identifier to delete
        username - User name deleting calendar
        Throws:
        IllegalAccessException - when user is not authorized to delete the calendar
        org.exoplatform.commons.exception.ObjectNotFoundException - when the calendar identified by its technical identifier is not found
      • deleteCalendarById

        void deleteCalendarById​(long calendarId)
                         throws org.exoplatform.commons.exception.ObjectNotFoundException
        Deletes an existing calendar
        Parameters:
        calendarId - Calendar technical identifier to delete
        Throws:
        org.exoplatform.commons.exception.ObjectNotFoundException - when the calendar identified by its technical identifier is not found