public interface AvailabilityAdminSession extends OsidSession
This session creates, updates, and deletes Availabilities.
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
Availability, an AvailabilityForm is
requested using getAvailabilityFormForCreate() specifying
the desired relationship peers and record Types or none if
no record Types are needed. The returned
AvailabilityForm 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 AvailabilityForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each AvailabilityForm
corresponds to an attempted transaction.
For updates, AvailabilityForms are requested to the
Availability Id that is to be updated using
getAvailabilityFormForUpdate(). Similarly, the
AvailabilityForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
AvailabilityForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Availabilities. To unmap
an Availability from the current Foundry,
the AvailabilityFoundryAssignmentSession should be used.
These delete operations attempt to remove the Availability
itself thus removing it from all known Foundry 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 |
aliasAvailability(Id availabilityId,
Id aliasId)
Adds an
Id to an Availability for the
purpose of creating compatibility. |
boolean |
canCreateAvailabilities()
Tests if this user can create
Availabilities. |
boolean |
canCreateAvailabilityWithRecordTypes(Type[] availabilityRecordTypes)
Tests if this user can create a single
Availability
using the desired record types. |
boolean |
canDeleteAvailabilities()
Tests if this user can delete
Availabilities. |
boolean |
canManageAvailabilityAliases()
Tests if this user can manage
Id aliases for
Availabilities. |
boolean |
canUpdateAvailabilities()
Tests if this user can update
Availabilities. |
Availability |
createAvailability(AvailabilityForm availabilityForm)
Creates a new
Availability. |
void |
deleteAvailability(Id availabilityId)
Deletes an
Availability. |
AvailabilityForm |
getAvailabilityFormForCreate(Id resourceId,
Id jobId,
Type[] availabilityRecordTypes)
Gets the availability form for creating new availabilities.
|
AvailabilityForm |
getAvailabilityFormForUpdate(Id availabilityId)
Gets the availability form for updating an existing availability.
|
Foundry |
getFoundry()
Gets the
Foundry associated with this session. |
Id |
getFoundryId()
Gets the
Foundry Id associated with this
session. |
void |
updateAvailability(AvailabilityForm availabilityForm)
Updates an existing availability.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getFoundryId()
Foundry Id associated with this
session. Foundry Id associated with this sessionmandatory - This method must be implemented. Foundry getFoundry() throws OperationFailedException, PermissionDeniedException
Foundry associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateAvailabilities()
Availabilities. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known creating an Availability
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 Availability creation
is not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateAvailabilityWithRecordTypes(Type[] availabilityRecordTypes)
Availability
using the desired record types. While
ResourcingManager.getAvailabilityRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Availability.
Providing an empty array tests if an Availability can
be created with no records.availabilityRecordTypes - array of availability record types true if Availability creation
using the specified record Types is supported,
false otherwiseNullArgumentException - availabilityRecordTypes
is null mandatory - This method must be implemented. AvailabilityForm getAvailabilityFormForCreate(Id resourceId, Id jobId, Type[] availabilityRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceId - the Id for the resourcejobId - the Id for the jobavailabilityRecordTypes - array of availability record typesNotFoundException - resourceId or
jobId is not foundNullArgumentException - resourceId, jobId,
or availabilityRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Availability createAvailability(AvailabilityForm availabilityForm) throws OperationFailedException, PermissionDeniedException
Availability. availabilityForm - the form for this Availability Availability IllegalStateException - availabilityForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - availabilityForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - availabilityForm
did not originate from getAvailabilityFormForCreate()
mandatory - This method must be implemented. boolean canUpdateAvailabilities()
Availabilities. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known updating an Availability
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 Availability
modification is not authorized, true otherwisemandatory - This method must be implemented. AvailabilityForm getAvailabilityFormForUpdate(Id availabilityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
availabilityId - the Id of the
Availability NotFoundException - availabilityId is
not foundNullArgumentException - availabilityId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateAvailability(AvailabilityForm availabilityForm) throws OperationFailedException, PermissionDeniedException
availabilityForm - the form containing the elements to be
updatedIllegalStateException - availabilityForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - availabilityForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - availabilityForm
did not originate from getAvailabilityFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteAvailabilities()
Availabilities. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Availability
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 Availability deletion
is not authorized, true otherwisemandatory - This method must be implemented. void deleteAvailability(Id availabilityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Availability. availabilityId - the Id of the
Availability to removeNotFoundException - availabilityId not
foundNullArgumentException - availabilityId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageAvailabilityAliases()
Id aliases for
Availabilities. 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 Availability aliasing
is not authorized, true otherwisemandatory - This method must be implemented. void aliasAvailability(Id availabilityId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Availability for the
purpose of creating compatibility. The primary Id of
the Availability is determined by the provider. The new
Id performs as an alias to the primary Id
. If the alias is a pointer to another availability, it is
reassigned to the given availability Id. availabilityId - the Id of an Availability
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - availabilityId not
foundNullArgumentException - availabilityId
or aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.