Package org.exoplatform.agenda.service
Interface AgendaCalendarService
public interface AgendaCalendarService
-
Method Summary
Modifier and TypeMethodDescriptionintcountCalendars(String username) Count available calendars for a designated usercreateCalendar(Calendar calendar) Creates a new calendarcreateCalendar(Calendar calendar, String username) Creates a new calendarcreateCalendarInstance(long ownerId) Create newCalendarobject instancecreateCalendarInstance(long ownerId, long userIdentityId) Create newCalendarobject instancevoiddeleteCalendarById(long calendarId) Deletes an existing calendarvoiddeleteCalendarById(long calendarId, String username) Deletes an existing user (non-system) calendar.getCalendarById(long calendarId) Retrieves a calendar identified by its technical identifier.getCalendarById(long calendarId, String username) Retrieves a calendar identified by its technical identifier.getCalendarIdsByOwnerId(long ownerId) The technical identifiers of every calendar of the given owner, with no ACL check and no object hydration -- a caller that already knows it may see this owner's calendars uses this to build an exclusion or inclusion list without paying for a per-calendargetCalendarById(long).getCalendars(int offset, int limit, String username) Retrieve list of calendars for a designated usergetCalendarsByOwnerIds(List<Long> ownerIds, String username) getOrCreateCalendarByOwnerId(long ownerId) voidupdateCalendar(Calendar calendar) Updates an existing calendarvoidupdateCalendar(Calendar calendar, String username) Updates an existing calendar
-
Method Details
-
getCalendars
Retrieve list of calendars for a designated user -
countCalendars
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
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
Retrieves a calendar identified by its technical identifier.- Parameters:
calendarId- technical identifier of a calendar- Returns:
- A
Calendarobject
-
getOrCreateCalendarByOwnerId
-
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
-
getCalendarIdsByOwnerId
The technical identifiers of every calendar of the given owner, with no ACL check and no object hydration -- a caller that already knows it may see this owner's calendars uses this to build an exclusion or inclusion list without paying for a per-calendargetCalendarById(long).Subscribed calendars are included, unlike every owner listing of this service (
getCalendarsByOwnerIds(java.util.List<java.lang.Long>, java.lang.String)and the paged reads leave them out): an exclusion list that missed them would still scan every event a subscription imported under the same owner. Do not "align" it with the listings.- Parameters:
ownerId- technical identifier of the calendar owner identity- Returns:
- the calendar ids, possibly empty, never null
-
createCalendar
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
-
createCalendar
Creates a new calendar -
createCalendarInstance
Create newCalendarobject instance -
createCalendarInstance
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.ObjectNotFoundException Deletes an existing user (non-system) calendar. The events of the deleted calendar are not destroyed: they are moved to the owner's default (system) calendar before the calendar row is deleted. System calendars can't be deleted through this method.- 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 foundIllegalStateException- when the calendar is a system calendar, which is undeletable
-
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
-