Interface ParticipantBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ParticipantAdminSession
This session creates, updates, and deletes Participants 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
Participant , a ParticipantForm is requested using
getParticipantFormsForCreate() specifying the desired canonical offering,
resource, and record Types or none if no record Types are
needed. Each of the returned ParticipantForms 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 ParticipantForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
ParticipantForm corresponds to an attempted transaction.
The ParticipantForms returned from
getParticipantFormsForCreate() may be linked to the originating request
through the peer Ids of the ParticipantForm . In the case
where there may be duplicates, any ParticipantForm of the same
peer Ids may be used for a create operation.
Once a batch of ParticipantForms are submitted for create, a
CreateResponse is returned for each ParticipantForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createParticipants() ,
errors specific to an individual ParticipantForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating ParticipantForm through the
ParticipantForm Id .
For updates, ParticipantForms are requested to the
Participant Id that is to be updated using
getParticipantFormsForUpdate() where the reference Id in the
ParticipantForm may be used to link the request. Similarly, the
ParticipantForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
ParticipantForm can only be used once for a successful update and cannot
be reused.
Once a batch of ParticipantForms are submitted for update, an
UpdateResponse is returned for each ParticipantForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateParticipants() ,
errors specific to an individual ParticipantForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating ParticipantForm through the
ParticipantForm Id .
The delete operations delete Participants in bulk. To unmap a
Participant from the current Catalogue , the
ParticipantCatalogueAssignmentSession should be used. These delete
operations attempt to remove the Participant itself thus removing
it from all known Catalogue catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasParticipants(AliasRequestList aliasRequests) Adds anIdto aParticipantfor the purpose of creating compatibility.createParticipants(ParticipantBatchFormList participantForms) Creates a new set ofParticipants.Deletes allParticipantsin thisCatalogue.deleteParticipants(IdList participantIds) Deletes participants for the givenIds.deleteParticipantsForOffering(Id offeringId) Deletes participants for the given offering.deleteParticipantsForResource(Id resourceId) Deletes participants for the given resource.getParticipantFormsForCreate(ParticipantPeerList peers, Type[] participantRecordTypes) Gets the participant forms for creating a bunch of new participants.getParticipantFormsForUpdate(IdList participantIds) Gets the participant forms for updating an existing set of participants.updateParticipants(ParticipantBatchFormList participantForms) Updates existing participants.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.Methods inherited from interface ParticipantAdminSession
aliasParticipant, canCreateParticipants, canCreateParticipantWithRecordTypes, canDeleteParticipants, canManageParticipantAliases, canUpdateParticipants, createParticipant, deleteParticipant, getCatalogue, getCatalogueId, getParticipantFormForCreate, getParticipantFormForUpdate, updateParticipantModifier and TypeMethodDescriptionvoidaliasParticipant(Id participantId, Id aliasId) Adds anIdto aParticipantfor the purpose of creating compatibility.booleanTests if this user can create participants.booleancanCreateParticipantWithRecordTypes(Type[] participantRecordTypes) Tests if this user can create a singleParticipantusing the desired record types.booleanTests if this user can delete participants.booleanTests if this user can manageIdaliases forParticipants.booleanTests if this user can update participants.createParticipant(ParticipantForm participantForm) Creates a newParticipant.voiddeleteParticipant(Id participantId) Deletes aParticipant.Gets theCatalogueassociated with this session.Gets theCatalogueIdassociated with this session.getParticipantFormForCreate(Id offeringId, Id resourceId, Type[] participantRecordTypes) Gets the participant form for creating new participants.getParticipantFormForUpdate(Id participantId) Gets the participant form for updating an existing participant.voidupdateParticipant(ParticipantForm participantForm) Updates an existing participant.
-
Method Details
-
getParticipantFormsForCreate
ParticipantBatchFormList getParticipantFormsForCreate(ParticipantPeerList peers, Type[] participantRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the participant forms for creating a bunch of new participants. A form is returned for each canonical canonical unit and term pair.- Parameters:
peers- the relationship peersparticipantRecordTypes- array of participant record types to be included in each create operation or an empty list if none- Returns:
- the participant forms
- Throws:
NotFoundException- anofferingIdorresourceIdis not foundNullArgumentException-peersorparticipantRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createParticipants
CreateResponseList createParticipants(ParticipantBatchFormList participantForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofParticipants. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
participantForms- the participant forms- Returns:
- the create responses
- Throws:
NullArgumentException-participantFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getParticipantFormsForUpdate
ParticipantBatchFormList getParticipantFormsForUpdate(IdList participantIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the participant forms for updating an existing set of participants. A new participant form should be requested for each update transaction.- Parameters:
participantIds- theIdsof theParticipant- Returns:
- the participant form
- Throws:
NotFoundException- aparticipantIdis not foundNullArgumentException-participantIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateParticipants
UpdateResponseList updateParticipants(ParticipantBatchFormList participantForms) throws OperationFailedException, PermissionDeniedException Updates existing participants. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
participantForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-participantFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllParticipants
DeleteResponseList deleteAllParticipants() throws OperationFailedException, PermissionDeniedExceptionDeletes allParticipantsin thisCatalogue.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteParticipants
DeleteResponseList deleteParticipants(IdList participantIds) throws OperationFailedException, PermissionDeniedException Deletes participants for the givenIds.- Parameters:
participantIds- theIdsof the participants to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-participantIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteParticipantsForOffering
DeleteResponseList deleteParticipantsForOffering(Id offeringId) throws OperationFailedException, PermissionDeniedException Deletes participants for the given offering.- Parameters:
offeringId- theIdof an offering- Returns:
- the delete responses
- Throws:
NullArgumentException-offeringIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteParticipantsForResource
DeleteResponseList deleteParticipantsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes participants 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.
-
aliasParticipants
AliasResponseList aliasParticipants(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aParticipantfor the purpose of creating compatibility. The primaryIdof theParticipantis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another participant, it is reassigned to the given participantId.- 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.
-