Package org.exoplatform.agenda.service
Interface AgendaCalendarService
-
public interface AgendaCalendarService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcountCalendars(String username)Count available calendars for a designated userCalendarcreateCalendar(Calendar calendar)Creates a new calendarCalendarcreateCalendar(Calendar calendar, String username)Creates a new calendarCalendarcreateCalendarInstance(long ownerId)Create newCalendarobject instanceCalendarcreateCalendarInstance(long ownerId, long userIdentityId)Create newCalendarobject instancevoiddeleteCalendarById(long calendarId)Deletes an existing calendarvoiddeleteCalendarById(long calendarId, String username)Deletes an existing calendarCalendargetCalendarById(long calendarId)Retrieves a calendar identified by its technical identifier.CalendargetCalendarById(long calendarId, String username)Retrieves a calendar identified by its technical identifier.List<Calendar>getCalendars(int offset, int limit, String username)Retrieve list of calendars for a designated userList<Calendar>getCalendarsByOwnerIds(List<Long> ownerIds, String username)CalendargetOrCreateCalendarByOwnerId(long ownerId)voidupdateCalendar(Calendar calendar)Updates an existing calendarvoidupdateCalendar(Calendar calendar, String username)Updates an existing calendar
-
-
-
Method Detail
-
getCalendars
List<Calendar> getCalendars(int offset, int limit, String username) throws Exception
Retrieve list of calendars for a designated user
-
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 calendarusername- User name accessing calendar- Returns:
- A
Calendarobject - 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
Calendarobject
-
getOrCreateCalendarByOwnerId
Calendar getOrCreateCalendarByOwnerId(long ownerId)
-
getCalendarsByOwnerIds
List<Calendar> getCalendarsByOwnerIds(List<Long> ownerIds, String username) throws IllegalAccessException
- Parameters:
ownerIds-ListofIdentitytechnical identifierusername- User accessing list of calendars- Returns:
ListCalendarcorresponding to calendar objects of owners.- Throws:
IllegalAccessException- when user doesn't have acces to one of the calendars
-
createCalendar
Calendar createCalendar(Calendar calendar, String username) throws IllegalAccessException
Creates a new calendar- Parameters:
calendar-Calendarobject to createusername- User name creating calendar- Returns:
- created
Calendarwith generated technical identifier - Throws:
IllegalAccessException- when user is not authorized to create a calendar for the designated owner defined in object
-
createCalendarInstance
Calendar createCalendarInstance(long ownerId)
Create newCalendarobject instance
-
createCalendarInstance
Calendar createCalendarInstance(long ownerId, long userIdentityId) throws IllegalAccessException
Create newCalendarobject instance- Parameters:
ownerId-Identitytechnical id of theCalendaruserIdentityId- user identity Technical Identifier accessingCalendar- Returns:
Calendarobject 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-Calendarobject to updateusername- User name updating calendar- Throws:
IllegalAccessException- when user is not authorized to update the calendarorg.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-Calendarobject 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.ObjectNotFoundExceptionDeletes an existing calendar- Parameters:
calendarId- Calendar technical identifier to deleteusername- User name deleting calendar- Throws:
IllegalAccessException- when user is not authorized to delete the calendarorg.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.ObjectNotFoundExceptionDeletes 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
-
-