Interface OfferingBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OfferingAdminSession, OsidSession, OsidSession
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 .
-
Method Summary
Modifier and TypeMethodDescriptionaliasOfferings(AliasRequestList aliasRequests) Adds anIdto anOfferingfor the purpose of creating compatibility.createOfferings(OfferingBatchFormList offeringForms) Creates a new set ofOfferings.Deletes allOfferingsin thisCatalogue.deleteOfferings(IdList offeringIds) Deletes offerings for the givenIds.deleteOfferingsForCanonicalUnit(Id canonicalUnitId) Deletes all offerings mapped to the given canonical unit.deleteOfferingsForTimePeriod(Id timePeriodId) Deletes all offerings mapped to the given time period.getOfferingFormsForCreate(OfferingPeerList peers, Type[] offeringRecordTypes) Gets the offeringforms for creating a bunch of new offerings.getOfferingFormsForUpdate(IdList offeringIds) Gets the offering forms for updating an existing set of offerings.updateOfferings(OfferingBatchFormList offeringForms) Updates existing offerings.Methods inherited from interface OfferingAdminSession
aliasOffering, canCreateOfferings, canCreateOfferingWithRecordTypes, canDeleteOfferings, canManageOfferingAliases, canUpdateOfferings, createOffering, deleteOffering, getCatalogue, getCatalogueId, getOfferingFormForCreate, getOfferingFormForUpdate, updateOfferingModifier and TypeMethodDescriptionvoidaliasOffering(Id offeringId, Id aliasId) Adds anIdto anOfferingfor the purpose of creating compatibility.booleanTests if this user can create offerings.booleancanCreateOfferingWithRecordTypes(Type[] offeringRecordTypes) Tests if this user can create a singleOfferingusing the desired record types.booleanTests if this user can delete offerings.booleanTests if this user can manageIdaliases forOfferings.booleanTests if this user can update offerings.createOffering(OfferingForm offeringForm) Creates a newOffering.voiddeleteOffering(Id offeringId) Deletes anOffering.Gets theCatalogueassociated with this session.Gets theCatalogueIdassociated with this session.getOfferingFormForCreate(Id canonicalUnitId, Id timePeriodId, Type[] offeringRecordTypes) Gets the offering form for creating new offerings.getOfferingFormForUpdate(Id offeringId) Gets the offering form for updating an existing offering.voidupdateOffering(OfferingForm offeringForm) Updates an existing offering.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
-
getOfferingFormsForCreate
OfferingBatchFormList getOfferingFormsForCreate(OfferingPeerList peers, Type[] offeringRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the offeringforms for creating a bunch of new offerings. A new result form is returned for each supplied canonical unit and time period.- Parameters:
peers- a list of canonical unit peersofferingRecordTypes- array of offering record types to be included in each create operation or an empty list if none- Returns:
- the offeringforms
- Throws:
NotFoundException- acanonicalUnitIdortimePeriodIdis not foundNullArgumentException-peersorofferingRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createOfferings
CreateResponseList createOfferings(OfferingBatchFormList offeringForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofOfferings. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
offeringForms- the offering forms- Returns:
- the create responses
- Throws:
NullArgumentException-offeringFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOfferingFormsForUpdate
OfferingBatchFormList getOfferingFormsForUpdate(IdList offeringIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the offering forms for updating an existing set of offerings. A new offeringform should be requested for each update transaction.- Parameters:
offeringIds- theIdsof theOffering- Returns:
- the offering form
- Throws:
NotFoundException- anofferingIdis not foundNullArgumentException-offeringIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateOfferings
UpdateResponseList updateOfferings(OfferingBatchFormList offeringForms) throws OperationFailedException, PermissionDeniedException Updates existing offerings. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
offeringForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-offeringFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllOfferings
Deletes allOfferingsin thisCatalogue.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteOfferings
DeleteResponseList deleteOfferings(IdList offeringIds) throws OperationFailedException, PermissionDeniedException Deletes offerings for the givenIds.- Parameters:
offeringIds- theIdsof the offerings to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-offeringIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteOfferingsForCanonicalUnit
DeleteResponseList deleteOfferingsForCanonicalUnit(Id canonicalUnitId) throws OperationFailedException, PermissionDeniedException Deletes all offerings mapped to the given canonical unit.- Parameters:
canonicalUnitId- anIdof a canonical unit- Returns:
- the delete responses
- Throws:
NullArgumentException-canonicalUnitIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteOfferingsForTimePeriod
DeleteResponseList deleteOfferingsForTimePeriod(Id timePeriodId) throws OperationFailedException, PermissionDeniedException Deletes all offerings mapped to the given time period.- Parameters:
timePeriodId- anIdof a time period- Returns:
- the delete responses
- Throws:
NullArgumentException-timePeriodIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasOfferings
AliasResponseList aliasOfferings(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anOfferingfor the purpose of creating compatibility. The primaryIdof theOfferingis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another offering, it is reassigned to the given offeringId.- 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.
-