public interface ScheduleSlotAdminSession extends OsidSession
This session creates, updates, and deletes Schedule Slots.
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
ScheduleSlot,
a ScheduleSlotForm
is requested using
getScheduleSlotFormForCreate()
specifying the desired
record Types
or none if no record Types
are
needed. The returned ScheduleSlotForm
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 ScheduleSlotForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
ScheduleSlotForm
corresponds to an attempted transaction.
For updates, ScheduleSlotForms
are requested to the
ScheduleSlot
Id
that is to be updated using
getScheduleSlotFormForUpdate().
Similarly, the
ScheduleSlotForm
has metadata about the data that can be updated
and it can perform validation before submitting the update. The
ScheduleSlotForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete Schedule Slots.
To unmap a
ScheduleSlot
from the current Calendar,
the
ScheduleSlotCalendarAssignmentSession
should be used. These
delete operations attempt to remove the ScheduleSlot
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 |
aliasScheduleSlot(Id scheduleSlotId,
Id aliasId)
Adds an
Id to a ScheduleSlot for the
purpose of creating compatibility. |
boolean |
canCreateScheduleSlots()
Tests if this user can create
ScheduleSlots. |
boolean |
canCreateScheduleSlotWithRecordTypes(Type[] scheduleSlotRecordTypes)
Tests if this user can create a single
ScheduleSlot
using the desired record types. |
boolean |
canDeleteScheduleSlots()
Tests if this user can delete
ScheduleSlots. |
boolean |
canManageScheduleSlotAliases()
Tests if this user can manage
Id aliases for
ScheduleSlots. |
boolean |
canUpdateScheduleSlots()
Tests if this user can update
ScheduleSlots. |
ScheduleSlot |
createScheduleSlot(ScheduleSlotForm scheduleSlotForm)
Creates a new
ScheduleSlot. |
void |
deleteScheduleSlot(Id scheduleSlotId)
Deletes the
ScheduleSlot identified by the given
Id. |
Calendar |
getCalendar()
Gets the
Calendar associated with this session. |
Id |
getCalendarId()
Gets the
Calendar Id associated with
this session. |
ScheduleSlotForm |
getScheduleSlotFormForCreate(Type[] scheduleSlotRecordTypes)
Gets the schedule slot form for creating new schedule slots.
|
ScheduleSlotForm |
getScheduleSlotFormForUpdate(Id scheduleSlotId)
Gets the schedule slot form for updating an existing schedule slot.
|
void |
updateScheduleSlot(ScheduleSlotForm scheduleSlotForm)
Updates an existing schedule slot.
|
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 canCreateScheduleSlots()
ScheduleSlots.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known creating a ScheduleSlot
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 ScheduleSlot
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateScheduleSlotWithRecordTypes(Type[] scheduleSlotRecordTypes)
ScheduleSlot
using the desired record types. While
CalendaringManager.getScheduleSlotRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific ScheduleSlot.
Providing an empty array tests if a ScheduleSlot
can be
created with no records.scheduleSlotRecordTypes
- array of schedule slot record types true
if ScheduleSlot
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- scheduleSlotRecordTypes
is null
mandatory
- This method must be implemented. ScheduleSlotForm getScheduleSlotFormForCreate(Type[] scheduleSlotRecordTypes) throws OperationFailedException, PermissionDeniedException
scheduleSlotRecordTypes
- array of schedule slot record typesNullArgumentException
- scheduleSlotRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. ScheduleSlot createScheduleSlot(ScheduleSlotForm scheduleSlotForm) throws OperationFailedException, PermissionDeniedException
ScheduleSlot.
scheduleSlotForm
- the form for this ScheduleSlot
ScheduleSlot
IllegalStateException
- scheduleSlotForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- scheduleSlotForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- scheduleSlotForm
did not originate from getScheduleSlotFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateScheduleSlots()
ScheduleSlots.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known updating a ScheduleSlot
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 schedule slot modification is not
authorized, true
otherwisemandatory
- This method must be implemented. ScheduleSlotForm getScheduleSlotFormForUpdate(Id scheduleSlotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
scheduleSlotId
- the Id
of the
ScheduleSlot
NotFoundException
- scheduleSlotId
is
not foundNullArgumentException
- scheduleSlotId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateScheduleSlot(ScheduleSlotForm scheduleSlotForm) throws OperationFailedException, PermissionDeniedException
scheduleSlotForm
- the form containing the elements to be
updatedIllegalStateException
- scheduleSlotForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- scheduleSlotForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- scheduleSlotForm
did not originate from getScheduleSlotFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteScheduleSlots()
ScheduleSlots.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting a ScheduleSlot
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 ScheduleSlot
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteScheduleSlot(Id scheduleSlotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ScheduleSlot
identified by the given
Id.
scheduleSlotId
- the Id
of the
ScheduleSlot
to deleteNotFoundException
- a ScheduleSlot
was
not found identified by the given Id
NullArgumentException
- scheduleSlotId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageScheduleSlotAliases()
Id
aliases for
ScheduleSlots.
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 ScheduleSlot
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasScheduleSlot(Id scheduleSlotId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a ScheduleSlot
for the
purpose of creating compatibility. The primary Id
of
the ScheduleSlot
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another schedule slot, it is
reassigned to the given schedule slot Id.
scheduleSlotId
- the Id
of a ScheduleSlot
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- scheduleSlotId
not
foundNullArgumentException
- scheduleSlotId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.