Interface OffsetEventAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
OffsetEventBatchAdminSession
This session creates, updates, and deletes Offset Events . 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 an
OffsetEvent , an OffsetEventForm is requested using
getOffsetEventFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
OffsetEventForm 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 OffsetEventForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each OffsetEventForm corresponds
to an attempted transaction.
For updates, OffsetEventForms are requested to the
OffsetEvent Id that is to be updated using
getOffsetEventFormForUpdate() . Similarly, the OffsetventForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The OffsetEventForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Offset Events . To unmap an
OffsetEvent from the current Calendar , the
OffstEventCalendarAssignmentSession should be used. These delete
operations attempt to remove the OffsetEvent itself thus removing
it from all known Calendar catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasOffsetEvent(Id offsetEventId, Id aliasId) Adds anIdto anOffsetEventfor the purpose of creating compatibility.booleanTests if this user can createOffsetEvents.booleancanCreateOffsetEventWithRecordTypes(Type[] offsetEventRecordTypes) Tests if this user can create a singleOffsetEventusing the desired record types.booleanTests if this user can deleteOffsetEvents.booleanTests if this user can manageIdaliases forOffsetEvents.booleanTests if this user can updateOffsetEvents.createOffsetEvent(OffsetEventForm offsetEventForm) Creates a newOffsetEvent.voiddeleteOffsetEvent(Id offsetEventId) Deletes theOffsetEventidentified by the givenId.Gets theCalendarassociated with this session.Gets theCalendarIdassociated with this session.getOffsetEventFormForCreate(Type[] offsetEventRecordTypes) Gets the offset event form for creating new offset events.getOffsetEventFormForUpdate(Id offsetEventId) Gets the offset event form for updating an existing offset event.voidupdateOffsetEvent(OffsetEventForm offsetEventForm) Updates an existing offset event.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
-
getCalendarId
Id getCalendarId()Gets theCalendarIdassociated with this session.- Returns:
- the
Calendar Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCalendar
Gets theCalendarassociated with this session.- Returns:
- the
Calendarassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateOffsetEvents
boolean canCreateOffsetEvents()Tests if this user can createOffsetEvents. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anOffsetEventwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifOffsetEventcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateOffsetEventWithRecordTypes
Tests if this user can create a singleOffsetEventusing the desired record types. WhileCalendaringManager.getOffsetEventRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificOffsetEvent. Providing an empty array tests if anOffsetEventcan be created with no records.- Parameters:
offsetEventRecordTypes- array of offset event record types- Returns:
trueifOffsetEventcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-offsetEventRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getOffsetEventFormForCreate
OffsetEventForm getOffsetEventFormForCreate(Type[] offsetEventRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the offset event form for creating new offset events. A new form should be requested for each create transaction.- Parameters:
offsetEventRecordTypes- array of offset event record types- Returns:
- the offset event form
- Throws:
NullArgumentException-offsetEventRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested recod types- Compliance:
mandatory- This method must be implemented.
-
createOffsetEvent
OffsetEvent createOffsetEvent(OffsetEventForm offsetEventForm) throws OperationFailedException, PermissionDeniedException Creates a newOffsetEvent.- Parameters:
offsetEventForm- the form for thisOffsetEvent- Returns:
- the new
OffsetEvent - Throws:
IllegalStateException-offsetEventFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-offsetEventFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-offsetEventFormdid not originate fromgetOffsetEventFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateOffsetEvents
boolean canUpdateOffsetEvents()Tests if this user can updateOffsetEvents. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anOffsetEventwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseif offset event modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getOffsetEventFormForUpdate
OffsetEventForm getOffsetEventFormForUpdate(Id offsetEventId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the offset event form for updating an existing offset event. A new offset event form should be requested for each update transaction.- Parameters:
offsetEventId- theIdof theOffsetEvent- Returns:
- the offset event form
- Throws:
NotFoundException-offsetEventIdis not foundNullArgumentException-offsetEventIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateOffsetEvent
void updateOffsetEvent(OffsetEventForm offsetEventForm) throws OperationFailedException, PermissionDeniedException Updates an existing offset event.- Parameters:
offsetEventForm- the form containing the elements to be updated- Throws:
IllegalStateException-offsetEventFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-offsetEventFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-offsetEventFormdid not originate fromgetOffsetEventFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteOffsetEvents
boolean canDeleteOffsetEvents()Tests if this user can deleteOffsetEvents. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anOffsetEventwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifOffsetEventdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteOffsetEvent
void deleteOffsetEvent(Id offsetEventId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theOffsetEventidentified by the givenId.- Parameters:
offsetEventId- theIdof theOffsetEventto delete- Throws:
NotFoundException- anOffsetEventwas not found identified by the givenIdNullArgumentException-offsetEventIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageOffsetEventAliases
boolean canManageOffsetEventAliases()Tests if this user can manageIdaliases forOffsetEvents. 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:
falseifOffsetEventaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasOffsetEvent
void aliasOffsetEvent(Id offsetEventId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anOffsetEventfor the purpose of creating compatibility. The primaryIdof theOffsetEventis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another offset event, it is reassigned to the given offset eventId.- Parameters:
offsetEventId- theIdof anOffsetEventaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-offsetEventIdnot foundNullArgumentException-offsetEventIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-