Interface CalendarAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CalendarBatchAdminSession
This session creates, updates, and deletes Calendars . The data
for create and update is provided by the consumer via the form object.
OsidForms are requested for each create or update and may not be
reused.
Create and update operations differ in their usage. To create a
Calendar , a CalendarForm is requested using
getCalendarFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
CalendarForm will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once the CalendarForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each CalendarForm corresponds to an attempted
transaction.
For updates, CalendarForms are requested to the
Calendar Id that is to be updated using
getCalendarFormForUpdate() . Similarly, the CalendarForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The Calendar can only be used once
for a successful update and cannot be reused.
The delete operations delete Calendars .This session also
includes an Id aliasing mechanism to assign an external Id
to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasCalendar(Id calendarId, Id aliasId) Adds anIdto aCalendarfor the purpose of creating compatibility.booleanTests if this user can createCalendars.booleancanCreateCalendarWithRecordTypes(Type[] calendarRecordTypes) Tests if this user can create a singleCalendarusing the desired record types.booleanTests if this user can delete calendars.booleanTests if this user can manageIdaliases forCalendars.booleanTests if this user can updateCalendars.createCalendar(CalendarForm calendarForm) Creates a newCalendar.voiddeleteCalendar(Id calendarId) Deletes aCalendar.getCalendarFormForCreate(Type[] calendarRecordTypes) Gets the calendar form for creating new calendars.getCalendarFormForUpdate(Id calendarId) Gets the calendar form for updating an existing calendar.voidupdateCalendar(CalendarForm calendarForm) Updates an existing calendar.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canCreateCalendars
boolean canCreateCalendars()Tests if this user can createCalendars. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCalendarwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifCalendarcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCalendarWithRecordTypes
Tests if this user can create a singleCalendarusing the desired record types. WhileCalendaringManager.getCalendarRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCalendar. Providing an empty array tests if aCalendarcan be created with no records.- Parameters:
calendarRecordTypes- array of calendar record types- Returns:
trueifCalendarcreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-calendarRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCalendarFormForCreate
CalendarForm getCalendarFormForCreate(Type[] calendarRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the calendar form for creating new calendars. A new form should be requested for each create transaction.- Parameters:
calendarRecordTypes- array of calendar record types- Returns:
- the calendar form
- Throws:
NullArgumentException-calendarRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCalendar
Calendar createCalendar(CalendarForm calendarForm) throws OperationFailedException, PermissionDeniedException Creates a newCalendar.- Parameters:
calendarForm- the form for thisCalendar- Returns:
- the new
Calendar - Throws:
IllegalStateException-calendarFormalready used for a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-calendarFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-calendarFormdid not originate fromgetCalendarFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCalendars
boolean canUpdateCalendars()Tests if this user can updateCalendars. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCalendarwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifCalendarmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCalendarFormForUpdate
CalendarForm getCalendarFormForUpdate(Id calendarId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the calendar form for updating an existing calendar. A new calendar form should be requested for each update transaction.- Parameters:
calendarId- theIdof theCalendar- Returns:
- the calendar form
- Throws:
NotFoundException-calendarIdis not foundNullArgumentException-calendarIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCalendar
void updateCalendar(CalendarForm calendarForm) throws OperationFailedException, PermissionDeniedException Updates an existing calendar.- Parameters:
calendarForm- the form containing the elements to be updated- Throws:
IllegalStateException-calendarFormalready used for an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-calendarFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-calendarFormdid not originate fromgetCalendarFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCalendars
boolean canDeleteCalendars()Tests if this user can delete calendars. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCalendarwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifCalendardeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCalendar
void deleteCalendar(Id calendarId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCalendar.- Parameters:
calendarId- theIdof theCalendarto remove- Throws:
NotFoundException-calendarIdnot foundNullArgumentException-calendarIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCalendarAliases
boolean canManageCalendarAliases()Tests if this user can manageIdaliases forCalendars. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifCalendaraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCalendar
void aliasCalendar(Id calendarId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCalendarfor the purpose of creating compatibility. The primaryIdof theCalendaris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another calendar, it is reassigned to the given calendarId.- Parameters:
calendarId- theIdof aCalendaraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-calendarIdnot foundNullArgumentException-calendarIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-