public interface ScheduleAdminSession extends OsidSession
This session creates, updates, and deletes Schedules.
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
Schedule,
a ScheduleForm
is requested using
getScheduleFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed. The
returned ScheduleForm
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 ScheduleForm
is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each ScheduleForm
corresponds to an attempted transaction.
For updates, ScheduleForms
are requested to the
Schedule
Id
that is to be updated using
getScheduleFormForUpdate().
Similarly, the ScheduleForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ScheduleForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Schedules.
To unmap a
Schedule
from the current Calendar,
the
ScheduleSCalendarAssignmentSession
should be used. These
delete operations attempt to remove the Schedule
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 |
aliasSchedule(Id scheduleId,
Id aliasId)
Adds an
Id to a Schedule for the purpose
of creating compatibility. |
boolean |
canCreateSchedules()
Tests if this user can create
Schedules. |
boolean |
canCreateScheduleWithRecordTypes(Type[] scheduleRecordTypes)
Tests if this user can create a single
Schedule using
the desired record types. |
boolean |
canDeleteSchedules()
Tests if this user can delete
Schedules. |
boolean |
canManageScheduleAliases()
Tests if this user can manage
Id aliases for
Schedules. |
boolean |
canUpdateSchedules()
Tests if this user can update
Schedules. |
Schedule |
createSchedule(ScheduleForm scheduleForm)
Creates a new
Schedule. |
void |
deleteSchedule(Id scheduleId)
Deletes the
Schedule identified by the given Id. |
Calendar |
getCalendar()
Gets the
Calendar associated with this session. |
Id |
getCalendarId()
Gets the
Calendar Id associated with
this session. |
ScheduleForm |
getScheduleFormForCreate(Type[] scheduleRecordTypes)
Gets the schedule form for creating new schedules.
|
ScheduleForm |
getScheduleFormForUpdate(Id scheduleId)
Gets the schedule form for updating an existing schedules.
|
void |
updateSchedule(ScheduleForm scheduleForm)
Updates an existing schedule.
|
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 canCreateSchedules()
Schedules.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Schedule
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 Schedule
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateScheduleWithRecordTypes(Type[] scheduleRecordTypes)
Schedule
using
the desired record types. While
CalendaringManager.getScheduleRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Schedule.
Providing an empty array tests if a Schedule
can be
created with no records.scheduleRecordTypes
- array of schedule record types true
if Schedule
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- scheduleRecordTypes
is null
mandatory
- This method must be implemented. ScheduleForm getScheduleFormForCreate(Type[] scheduleRecordTypes) throws OperationFailedException, PermissionDeniedException
scheduleRecordTypes
- array of schedule record typesNullArgumentException
- scheduleRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Schedule createSchedule(ScheduleForm scheduleForm) throws OperationFailedException, PermissionDeniedException
Schedule.
scheduleForm
- the form for this Schedule
Schedule
IllegalStateException
- scheduleForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- scheduleForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- scheduleForm
did
not originate from getScheduleFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateSchedules()
Schedules.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Schedule
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 modification is not
authorized, true
otherwisemandatory
- This method must be implemented. ScheduleForm getScheduleFormForUpdate(Id scheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
scheduleId
- the Id
of the Schedule
NotFoundException
- scheduleId
is not
foundNullArgumentException
- scheduleId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateSchedule(ScheduleForm scheduleForm) throws OperationFailedException, PermissionDeniedException
scheduleForm
- the form containing the elements to be updatedIllegalStateException
- scheduleForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- scheduleForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- scheduleForm
did
not originate from getScheduleFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteSchedules()
Schedules.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Schedule
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 Schedule
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteSchedule(Id scheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Schedule
identified by the given Id.
scheduleId
- the Id
of the Schedule
to deleteNotFoundException
- a Schedule
was not
found identified by the given Id
NullArgumentException
- scheduleId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageScheduleAliases()
Id
aliases for
Schedules.
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 Schedule
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasSchedule(Id scheduleId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Schedule
for the purpose
of creating compatibility. The primary Id
of the
Schedule
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, it is reassigned to the given
schedule Id.
scheduleId
- the Id
of a Schedule
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- scheduleId
not foundNullArgumentException
- scheduleId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.