public interface OffsetEventAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasOffsetEvent(Id offsetEventId,
Id aliasId)
Adds an
Id to an OffsetEvent for the
purpose of creating compatibility. |
boolean |
canCreateOffsetEvents()
Tests if this user can create
OffsetEvents. |
boolean |
canCreateOffsetEventWithRecordTypes(Type[] offsetEventRecordTypes)
Tests if this user can create a single
OffsetEvent
using the desired record types. |
boolean |
canDeleteOffsetEvents()
Tests if this user can delete
OffsetEvents. |
boolean |
canManageOffsetEventAliases()
Tests if this user can manage
Id aliases for
OffsetEvents. |
boolean |
canUpdateOffsetEvents()
Tests if this user can update
OffsetEvents. |
OffsetEvent |
createOffsetEvent(OffsetEventForm offsetEventForm)
Creates a new
OffsetEvent. |
void |
deleteOffsetEvent(Id offsetEventId)
Deletes the
OffsetEvent identified by the given
Id. |
Calendar |
getCalendar()
Gets the
Calendar associated with this session. |
Id |
getCalendarId()
Gets the
Calendar Id associated with
this session. |
OffsetEventForm |
getOffsetEventFormForCreate(Type[] offsetEventRecordTypes)
Gets the offset event form for creating new offset events.
|
OffsetEventForm |
getOffsetEventFormForUpdate(Id offsetEventId)
Gets the offset event form for updating an existing offset event.
|
void |
updateOffsetEvent(OffsetEventForm offsetEventForm)
Updates an existing offset event.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCalendarId()
Calendar
Id
associated with
this session. Calendar Id
associated with this sessionmandatory
- This method must be implemented. Calendar getCalendar() throws OperationFailedException, PermissionDeniedException
Calendar
associated with this session. Calendar
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateOffsetEvents()
OffsetEvents.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an OffsetEvent
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if OffsetEvent
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateOffsetEventWithRecordTypes(Type[] offsetEventRecordTypes)
OffsetEvent
using the desired record types. While
CalendaringManager.getOffsetEventRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific OffsetEvent.
Providing an empty array tests if an OffsetEvent
can be
created with no records.offsetEventRecordTypes
- array of offset event record types true
if OffsetEvent
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- offsetEventRecordTypes
is null
mandatory
- This method must be implemented. OffsetEventForm getOffsetEventFormForCreate(Type[] offsetEventRecordTypes) throws OperationFailedException, PermissionDeniedException
offsetEventRecordTypes
- array of offset event record typesNullArgumentException
- offsetEventRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
recod typesmandatory
- This method must be implemented. OffsetEvent createOffsetEvent(OffsetEventForm offsetEventForm) throws OperationFailedException, PermissionDeniedException
OffsetEvent.
offsetEventForm
- the form for this OffsetEvent
OffsetEvent
IllegalStateException
- offsetEventForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- offsetEventForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- offsetEventForm
did not originate from getOffsetEventFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateOffsetEvents()
OffsetEvents.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an OffsetEvent
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false
if offset event modification is not
authorized, true
otherwisemandatory
- This method must be implemented. OffsetEventForm getOffsetEventFormForUpdate(Id offsetEventId) throws NotFoundException, OperationFailedException, PermissionDeniedException
offsetEventId
- the Id
of the OffsetEvent
NotFoundException
- offsetEventId
is not
foundNullArgumentException
- offsetEventId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateOffsetEvent(OffsetEventForm offsetEventForm) throws OperationFailedException, PermissionDeniedException
offsetEventForm
- the form containing the elements to be updatedIllegalStateException
- offsetEventForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- offsetEventForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- offsetEventForm
did not originate from getOffsetEventFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteOffsetEvents()
OffsetEvents.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an OffsetEvent
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false
if OffsetEvent
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteOffsetEvent(Id offsetEventId) throws NotFoundException, OperationFailedException, PermissionDeniedException
OffsetEvent
identified by the given
Id.
offsetEventId
- the Id
of the OffsetEvent
to deleteNotFoundException
- an OffsetEvent
was
not found identified by the given Id
NullArgumentException
- offsetEventId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageOffsetEventAliases()
Id
aliases for
OffsetEvents.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if OffsetEvent
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasOffsetEvent(Id offsetEventId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an OffsetEvent
for the
purpose of creating compatibility. The primary Id
of
the OffsetEvent
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another offset event, it is
reassigned to the given offset event Id.
offsetEventId
- the Id
of an OffsetEvent
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- offsetEventId
not
foundNullArgumentException
- offsetEventId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.