Interface ScheduleSlotAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ScheduleSlotBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasScheduleSlot(Id scheduleSlotId, Id aliasId) Adds anIdto aScheduleSlotfor the purpose of creating compatibility.booleanTests if this user can createScheduleSlots.booleancanCreateScheduleSlotWithRecordTypes(Type[] scheduleSlotRecordTypes) Tests if this user can create a singleScheduleSlotusing the desired record types.booleanTests if this user can deleteScheduleSlots.booleanTests if this user can manageIdaliases forScheduleSlots.booleanTests if this user can updateScheduleSlots.createScheduleSlot(ScheduleSlotForm scheduleSlotForm) Creates a newScheduleSlot.voiddeleteScheduleSlot(Id scheduleSlotId) Deletes theScheduleSlotidentified by the givenId.Gets theCalendarassociated with this session.Gets theCalendarIdassociated with this session.getScheduleSlotFormForCreate(Type[] scheduleSlotRecordTypes) Gets the schedule slot form for creating new schedule slots.getScheduleSlotFormForUpdate(Id scheduleSlotId) Gets the schedule slot form for updating an existing schedule slot.voidupdateScheduleSlot(ScheduleSlotForm scheduleSlotForm) Updates an existing schedule slot.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.
-
canCreateScheduleSlots
boolean canCreateScheduleSlots()Tests if this user can createScheduleSlots. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aScheduleSlotwill 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:
falseifScheduleSlotcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateScheduleSlotWithRecordTypes
Tests if this user can create a singleScheduleSlotusing the desired record types. WhileCalendaringManager.getScheduleSlotRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificScheduleSlot. Providing an empty array tests if aScheduleSlotcan be created with no records.- Parameters:
scheduleSlotRecordTypes- array of schedule slot record types- Returns:
trueifScheduleSlotcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-scheduleSlotRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getScheduleSlotFormForCreate
ScheduleSlotForm getScheduleSlotFormForCreate(Type[] scheduleSlotRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the schedule slot form for creating new schedule slots. A new form should be requested for each create transaction.- Parameters:
scheduleSlotRecordTypes- array of schedule slot record types- Returns:
- the schedule slot form
- Throws:
NullArgumentException-scheduleSlotRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createScheduleSlot
ScheduleSlot createScheduleSlot(ScheduleSlotForm scheduleSlotForm) throws OperationFailedException, PermissionDeniedException Creates a newScheduleSlot.- Parameters:
scheduleSlotForm- the form for thisScheduleSlot- Returns:
- the new
ScheduleSlot - Throws:
IllegalStateException-scheduleSlotFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-scheduleSlotFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-scheduleSlotFormdid not originate fromgetScheduleSlotFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateScheduleSlots
boolean canUpdateScheduleSlots()Tests if this user can updateScheduleSlots. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aScheduleSlotwill 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 schedule slot modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getScheduleSlotFormForUpdate
ScheduleSlotForm getScheduleSlotFormForUpdate(Id scheduleSlotId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the schedule slot form for updating an existing schedule slot. A new schedule slot form should be requested for each update transaction.- Parameters:
scheduleSlotId- theIdof theScheduleSlot- Returns:
- the schedule slot form
- Throws:
NotFoundException-scheduleSlotIdis not foundNullArgumentException-scheduleSlotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateScheduleSlot
void updateScheduleSlot(ScheduleSlotForm scheduleSlotForm) throws OperationFailedException, PermissionDeniedException Updates an existing schedule slot.- Parameters:
scheduleSlotForm- the form containing the elements to be updated- Throws:
IllegalStateException-scheduleSlotFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-scheduleSlotFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-scheduleSlotFormdid not originate fromgetScheduleSlotFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteScheduleSlots
boolean canDeleteScheduleSlots()Tests if this user can deleteScheduleSlots. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aScheduleSlotwill 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:
falseifScheduleSlotdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteScheduleSlot
void deleteScheduleSlot(Id scheduleSlotId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theScheduleSlotidentified by the givenId.- Parameters:
scheduleSlotId- theIdof theScheduleSlotto delete- Throws:
NotFoundException- aScheduleSlotwas not found identified by the givenIdNullArgumentException-scheduleSlotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageScheduleSlotAliases
boolean canManageScheduleSlotAliases()Tests if this user can manageIdaliases forScheduleSlots. 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:
falseifScheduleSlotaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasScheduleSlot
void aliasScheduleSlot(Id scheduleSlotId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aScheduleSlotfor the purpose of creating compatibility. The primaryIdof theScheduleSlotis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another schedule slot, it is reassigned to the given schedule slotId.- Parameters:
scheduleSlotId- theIdof aScheduleSlotaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-scheduleSlotIdnot foundNullArgumentException-scheduleSlotIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-