Interface CommissionBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CommissionAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Commissions 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 a
Commission , a CommissionForm is requested using
getCommissionFormsForCreate() specifying the desired work, resource, and
record Types or none if no record Types are needed. Each
of the returned CommissionForms 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 a CommissionForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
CommissionForm corresponds to an attempted transaction.
The CommissionForms returned from
getCommissionFormsForCreate() may be linked to the originating request
through the peer Ids of the CommissionForm . In the case
where there may be duplicates, any CommissionForm of the same peer
Ids may be used for a create operation.
Once a batch of CommissionForms are submitted for create, a
CreateResponse is returned for each CommissionForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createCommissions() ,
errors specific to an individual CommissionForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating CommissionForm through the
CommissionForm Id .
For updates, CommissionForms are requested to the
Commission Id that is to be updated using
getCommissionFormsForUpdate() where the reference Id in the
CommissionForm may be used to link the request. Similarly, the
CommissionForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
CommissionForm can only be used once for a successful update and cannot
be reused.
Once a batch of CommissionForms are submitted for update, an
UpdateResponse is returned for each CommissionForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateCommissions() ,
errors specific to an individual CommissionForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating CommissionForm through the
CommissionForm Id .
The delete operations delete Commissions in bulk. To unmap a
Commission from the current Foundry , the
CommissionFoundryAssignmentSession should be used. These delete
operations attempt to remove the Commission itself thus removing
it from all known Foundry catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCommissions(AliasRequestList aliasRequests) Adds anIdto aCommissionfor the purpose of creating compatibility.createCommissions(CommissionBatchFormList commissionForms) Creates a new set ofCommissions.Deletes allCommissionsin thisFoundry.deleteCommissions(IdList commissionIds) Deletes commissions for the givenIds.deleteCommissionsForResource(Id resourceId) Deletes commissions for the given resource.deleteCommissionsForWork(Id workId) Deletes commissions for the given work.Deletes commissions expired before the given date.getCommissionFormsForCreate(CommissionPeerList peers, Type[] commissionRecordTypes) Gets the commission forms for creating a bunch of new commissions.getCommissionFormsForUpdate(IdList commissionIds) Gets the commission forms for updating an existing set of commissions.updateCommissions(CommissionBatchFormList commissionForms) Updates existing commissions.Methods inherited from interface CommissionAdminSession
aliasCommission, canCreateCommissions, canCreateCommissionWithRecordTypes, canDeleteCommissions, canManageCommissionAliases, canUpdateCommissions, createCommission, deleteCommission, getCommissionFormForCreate, getCommissionFormForUpdate, getFoundry, getFoundryId, updateCommissionModifier and TypeMethodDescriptionvoidaliasCommission(Id commissionId, Id aliasId) Adds anIdto aCommissionfor the purpose of creating compatibility.booleanTests if this user can createCommissions.booleancanCreateCommissionWithRecordTypes(Type[] commissionRecordTypes) Tests if this user can create a singleCommissionusing the desired record types.booleanTests if this user can deleteCommissions.booleanTests if this user can manageIdaliases forCommissions.booleanTests if this user can updateCommissions.createCommission(CommissionForm commissionForm) Creates a newCommission.voiddeleteCommission(Id commissionId) Deletes aCommission.getCommissionFormForCreate(Id resourceId, Id workId, Type[] commissionRecordTypes) Gets the commission form for creating new commissions.getCommissionFormForUpdate(Id commissionId) Gets the commission form for updating an existing commission.Gets theFoundryassociated with this session.Gets theFoundryIdassociated with this session.voidupdateCommission(CommissionForm commissionForm) Updates an existing commission.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
-
getCommissionFormsForCreate
CommissionBatchFormList getCommissionFormsForCreate(CommissionPeerList peers, Type[] commissionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the commission forms for creating a bunch of new commissions. A form is returned for each work and resource pair.- Parameters:
peers- the relationship peerscommissionRecordTypes- array of commission record types to be included in each create operation or an empty list if none- Returns:
- the commission forms
- Throws:
NotFoundException- aworkIdorresourceIdis not foundNullArgumentException-peersorcommissionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCommissions
CreateResponseList createCommissions(CommissionBatchFormList commissionForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCommissions. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
commissionForms- the commission forms- Returns:
- the create responses
- Throws:
NullArgumentException-commissionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCommissionFormsForUpdate
CommissionBatchFormList getCommissionFormsForUpdate(IdList commissionIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the commission forms for updating an existing set of commissions. A new commission form should be requested for each update transaction.- Parameters:
commissionIds- theIdsof theCommission- Returns:
- the commission form
- Throws:
NotFoundException- acommissionIdis not foundNullArgumentException-commissionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCommissions
UpdateResponseList updateCommissions(CommissionBatchFormList commissionForms) throws OperationFailedException, PermissionDeniedException Updates existing commissions. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
commissionForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-commissionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCommissions
DeleteResponseList deleteAllCommissions() throws OperationFailedException, PermissionDeniedExceptionDeletes allCommissionsin thisFoundry.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCommissions
DeleteResponseList deleteCommissions(IdList commissionIds) throws OperationFailedException, PermissionDeniedException Deletes commissions for the givenIds.- Parameters:
commissionIds- theIdsof the commissions to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-commissionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCommissionsForResource
DeleteResponseList deleteCommissionsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes commissions for the given resource.- Parameters:
resourceId- theIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCommissionsForWork
DeleteResponseList deleteCommissionsForWork(Id workId) throws OperationFailedException, PermissionDeniedException Deletes commissions for the given work.- Parameters:
workId- theIdof a work- Returns:
- the delete responses
- Throws:
NullArgumentException-workIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveCommissionsByDate
DeleteResponseList deleteIneffectiveCommissionsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes commissions 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.
-
aliasCommissions
AliasResponseList aliasCommissions(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCommissionfor the purpose of creating compatibility. The primaryIdof theCommissionis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another commission, it is reassigned to the given commissionId.- 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.
-