Interface AvailabilityBatchAdminSession
- All Superinterfaces:
AutoCloseable, AvailabilityAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Availabilities in
bulk. 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
getAvailabilityFormsForCreate() specifying the desired job,
resource, and record Types or none if no record Types are
needed. Each of the returned AvailabilityForms 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 an
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.
The AvailabilityForms returned from
getAvailabilityFormsForCreate() may be linked to the originating request
through the peer Ids of the AvailabilityForm . In the case
where there may be duplicates, any AvailabilityForm of the same
peer Ids may be used for a create operation.
Once a batch of AvailabilityForms are submitted for create, a
CreateResponse is returned for each AvailabilityForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createAvailabilities() ,
errors specific to an individual AvailabilityForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating AvailabilityForm through the
AvailabilityForm Id .
For updates, AvailabilityForms are requested to the
Availability Id that is to be updated using
getAvailabilityFormsForUpdate() where the reference Id in the
AvailabilityForm may be used to link the request. 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.
Once a batch of AvailabilityForms are submitted for update, an
UpdateResponse is returned for each AvailabilityForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateAvailabilities() ,
errors specific to an individual AvailabilityForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating AvailabilityForm through the
AvailabilityForm Id .
The delete operations delete Availabilities in bulk. 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. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAvailabilities(AliasRequestList aliasRequests) Adds anIdto anAvailabilityfor the purpose of creating compatibility.createAvailabilities(AvailabilityBatchFormList availabilityForms) Creates a new set ofAvailabilities.Deletes allAvailabilitiesin thisFoundry.deleteAvailabilities(IdList availabilityIds) Deletes availabilities for the givenIds.deleteAvailabilitiesForJob(Id jobId) Deletes all availabilities for the given job.deleteAvailabilitiesForResource(Id resourceId) Deletes all availabilities for the given resource.Deletes availabilities expired before the given date.getAvailabilityFormsForCreate(AvailabilityPeerList peers, Type[] availabilityRecordTypes) Gets the availability forms for creating a bunch of new availabilities.getAvailabilityFormsForUpdate(IdList availabilityIds) Gets the availability forms for updating an existing set of availabilities.updateAvailabilities(AvailabilityBatchFormList availabilityForms) Updates existing availabilities.Methods inherited from interface AvailabilityAdminSession
aliasAvailability, canCreateAvailabilities, canCreateAvailabilityWithRecordTypes, canDeleteAvailabilities, canManageAvailabilityAliases, canUpdateAvailabilities, createAvailability, deleteAvailability, getAvailabilityFormForCreate, getAvailabilityFormForUpdate, getFoundry, getFoundryId, updateAvailabilityModifier and TypeMethodDescriptionvoidaliasAvailability(Id availabilityId, Id aliasId) Adds anIdto anAvailabilityfor the purpose of creating compatibility.booleanTests if this user can createAvailabilities.booleancanCreateAvailabilityWithRecordTypes(Type[] availabilityRecordTypes) Tests if this user can create a singleAvailabilityusing the desired record types.booleanTests if this user can deleteAvailabilities.booleanTests if this user can manageIdaliases forAvailabilities.booleanTests if this user can updateAvailabilities.createAvailability(AvailabilityForm availabilityForm) Creates a newAvailability.voiddeleteAvailability(Id availabilityId) Deletes anAvailability.getAvailabilityFormForCreate(Id resourceId, Id jobId, Type[] availabilityRecordTypes) Gets the availability form for creating new availabilities.getAvailabilityFormForUpdate(Id availabilityId) Gets the availability form for updating an existing availability.Gets theFoundryassociated with this session.Gets theFoundryIdassociated with this session.voidupdateAvailability(AvailabilityForm availabilityForm) Updates an existing availability.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
-
getAvailabilityFormsForCreate
AvailabilityBatchFormList getAvailabilityFormsForCreate(AvailabilityPeerList peers, Type[] availabilityRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the availability forms for creating a bunch of new availabilities. AnAvailabilityFormis returned for each job and resource pair.- Parameters:
peers- the relationship peersavailabilityRecordTypes- array of availability record types to be included in each create operation or an empty list if none- Returns:
- the availability forms
- Throws:
NotFoundException- aneffortIdorresourceIdis not foundNullArgumentException-peersoravailabilityRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAvailabilities
CreateResponseList createAvailabilities(AvailabilityBatchFormList availabilityForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAvailabilities. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
availabilityForms- the availability forms- Returns:
- the create responses
- Throws:
NullArgumentException-availabilityFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAvailabilityFormsForUpdate
AvailabilityBatchFormList getAvailabilityFormsForUpdate(IdList availabilityIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the availability forms for updating an existing set of availabilities. A new availability form should be requested for each update transaction.- Parameters:
availabilityIds- theIdsof theAvailability- Returns:
- the availability form
- Throws:
NotFoundException- anavailabilityIdis not foundNullArgumentException-availabilityIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAvailabilities
UpdateResponseList updateAvailabilities(AvailabilityBatchFormList availabilityForms) throws OperationFailedException, PermissionDeniedException Updates existing availabilities. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
availabilityForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-availabilityFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAvailabilities
DeleteResponseList deleteAllAvailabilities() throws OperationFailedException, PermissionDeniedExceptionDeletes allAvailabilitiesin thisFoundry.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAvailabilities
DeleteResponseList deleteAvailabilities(IdList availabilityIds) throws OperationFailedException, PermissionDeniedException Deletes availabilities for the givenIds.- Parameters:
availabilityIds- theIdsof the availabilities to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-availabilityIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAvailabilitiesForResource
DeleteResponseList deleteAvailabilitiesForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes all availabilities for the given resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAvailabilitiesForJob
DeleteResponseList deleteAvailabilitiesForJob(Id jobId) throws OperationFailedException, PermissionDeniedException Deletes all availabilities for the given job.- Parameters:
jobId- anIdof a job- Returns:
- the delete responses
- Throws:
NullArgumentException-jobIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveAvailabilitiesByDate
DeleteResponseList deleteIneffectiveAvailabilitiesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes availabilities expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAvailabilities
AliasResponseList aliasAvailabilities(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anAvailabilityfor the purpose of creating compatibility. The primaryIdof theAvailabilityis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another availability, it is reassigned to the given availabilityId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-