public interface OfferingBatchAdminSession extends OfferingAdminSession
This session creates, updates, and deletes Offerings 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
Offering, an OfferingForm is requested using
getOfferingFormsForCreate() specifying the desired
canonical unit, time period, and record Types or none if no
record Types are needed. Each of the returned
OfferingForms 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 OfferingForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each OfferingForm
corresponds to an attempted transaction.
The OfferingForms returned from
getOfferingFormsForCreate() may be linked to the originating
request through the peer Ids of the OfferingForm.
In the case where there may be duplicates, any OfferingForm
of the same peer Ids may be used for a create
operation.
Once a batch of OfferingForms are submitted for create,
a CreateResponse is returned for each OfferingForm,
although the ordering is not defined. Only errors that pertain to
the entire create operation are returned from createOfferings(),
errors specific to an individual OfferingForm are
indicated in the corresponding CreateResponse.
CreateResponses may be linked to the originating
OfferingForm through the OfferingForm Id
.
For updates, OfferingForms are requested to the
Offering Id that is to be updated using
getOfferingFormsForUpdate() where the reference Id
in the OfferingForm may be used to link the request.
Similarly, the OfferingForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The OfferingForm can only be used once for a
successful update and cannot be reused.
Once a batch of OfferingForms are submitted for update,
an UpdateResponse is returned for each OfferingForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateOfferings(),
errors specific to an individual OfferingForm are
indicated in the corresponding UpdateResponse.
UpdateResponses may be linked to the originating
OfferingForm through the OfferingForm Id.
The delete operations delete Offerings in bulk. To
unmap an Offering from the current Catalogue,
the OfferingCatalogueAssignmentSession should be
used. These delete operations attempt to remove the Offering
itself thus removing it from all known Catalogue
catalogs. Bulk delete operations return the results in
DeleteResponses.
| Modifier and Type | Method and Description |
|---|---|
AliasResponseList |
aliasOfferings(AliasRequestList aliasRequests)
Adds an
Id to an Offering for the
purpose of creating compatibility. |
CreateResponseList |
createOfferings(OfferingBatchFormList offeringForms)
Creates a new set of
Offerings. |
DeleteResponseList |
deleteAllOfferings()
Deletes all
Offerings in this Catalogue
. |
DeleteResponseList |
deleteOfferings(IdList offeringIds)
Deletes offerings for the given
Ids. |
DeleteResponseList |
deleteOfferingsForCanonicalUnit(Id canonicalUnitId)
Deletes all offerings mapped to the given canonical unit.
|
DeleteResponseList |
deleteOfferingsForTimePeriod(Id timePeriodId)
Deletes all offerings mapped to the given time period.
|
OfferingBatchFormList |
getOfferingFormsForCreate(OfferingPeerList peers,
Type[] offeringRecordTypes)
Gets the offeringforms for creating a bunch of new offerings.
|
OfferingBatchFormList |
getOfferingFormsForUpdate(IdList offeringIds)
Gets the offering forms for updating an existing set of offerings.
|
UpdateResponseList |
updateOfferings(OfferingBatchFormList offeringForms)
Updates existing offerings.
|
aliasOffering, canCreateOfferings, canCreateOfferingWithRecordTypes, canDeleteOfferings, canManageOfferingAliases, canUpdateOfferings, createOffering, deleteOffering, getCatalogue, getCatalogueId, getOfferingFormForCreate, getOfferingFormForUpdate, updateOfferinggetAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseOfferingBatchFormList getOfferingFormsForCreate(OfferingPeerList peers, Type[] offeringRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
peers - a list of canonical unit peersofferingRecordTypes - array of offering record types to be
included in each create operation or an empty list if noneNotFoundException - a canonicalUnitId or
timePeriodId is not foundNullArgumentException - peers or
offeringRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to request forms with
given record typesmandatory - This method must be implemented. CreateResponseList createOfferings(OfferingBatchFormList offeringForms) throws OperationFailedException, PermissionDeniedException
Offerings. This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse .offeringForms - the offering formsNullArgumentException - offeringForms is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. OfferingBatchFormList getOfferingFormsForUpdate(IdList offeringIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
offeringIds - the Ids of the Offering
NotFoundException - an offeringId is not
foundNullArgumentException - offeringIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. UpdateResponseList updateOfferings(OfferingBatchFormList offeringForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse .offeringForms - the form containing the elements to be updatedNullArgumentException - offeringForms is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteAllOfferings() throws OperationFailedException, PermissionDeniedException
Offerings in this Catalogue
.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteOfferings(IdList offeringIds) throws OperationFailedException, PermissionDeniedException
Ids. offeringIds - the Ids of the offerings to deleteNullArgumentException - offeringIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteOfferingsForCanonicalUnit(Id canonicalUnitId) throws OperationFailedException, PermissionDeniedException
canonicalUnitId - an Id of a canonical unitNullArgumentException - canonicalUnitId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteOfferingsForTimePeriod(Id timePeriodId) throws OperationFailedException, PermissionDeniedException
timePeriodId - an Id of a time periodNullArgumentException - timePeriodId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AliasResponseList aliasOfferings(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id to an Offering for the
purpose of creating compatibility. The primary Id of
the Offering is determined by the provider. The new
Id is an alias to the primary Id. If the
alias is a pointer to another offering, it is reassigned to the given
offering Id. aliasRequests - the alias requestsNullArgumentException - aliasRequests is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.