Interface CredentialEntryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CredentialEntryAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes CredentialEntries 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
CredentialEntry , a CredentialEntryForm is requested using
getCredentialEntryFormsForCreate() specifying the desired credential,
student, and record Types or none if no record Types are
needed. Each of the returned CredentialEntryForms 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
CredentialEntryForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each CredentialEntryForm corresponds to an attempted
transaction.
The CredentialEntryForms returned from
getCredentialEntryFormsForCreate() may be linked to the originating
request through the peer Ids of the CredentialEntryForm .
In the case where there may be duplicates, any CredentialEntryForm
of the same peer Ids may be used for a create operation.
Once a batch of CredentialEntryForms are submitted for create,
a CreateResponse is returned for each CredentialEntryForm
, although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from
createCredentialEntries() , errors specific to an individual
CredentialEntryForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
CredentialEntryForm through the CredentialEntryForm
Id .
For updates, CredentialEntryForms are requested to the
CredentialEntry Id that is to be updated using
getCredentialEntryFormsForUpdate() where the reference Id in the
CredentialEntryForm may be used to link the request. Similarly,
the CredentialEntryForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
CredentialEntryForm can only be used once for a successful update
and cannot be reused.
Once a batch of CredentialEntryForms are submitted for update,
an UpdateResponse is returned for each CredentialEntryForm
, although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from
updateCredentialEntries() , errors specific to an individual
CredentialEntryForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
CredentialEntryForm through the CredentialEntryForm
Id .
The delete operations delete CredentialEntries in bulk. To
unmap a CredentialEntry from the current CourseCatalog ,
the CredentialEntryCourseCatalogAssignmentSession should be used.
These delete operations attempt to remove the CredentialEntry
itself thus removing it from all known CourseCatalog catalogs.
Bulk delete operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCredentialEntries(AliasRequestList aliasRequests) Adds anIdto aCredentialEntryfor the purpose of creating compatibility.createCredentialEntries(CredentialEntryBatchFormList credentialEntryForms) Creates a new set ofCredentialEntries.Deletes allCredentialEntriesin thisCourseCatalog.deleteCredentialEntries(IdList credentialEntryIds) Deletes credential entries for the givenIds.deleteCredentialEntriesForCredential(Id credentialId) Deletes credential entries for the given credential.deleteCredentialEntriesForStudent(Id resourceId) Deletes credential entries for the given student.Deletes credential entries expired before the given date.getCredentialEntryFormsForCreate(CredentialEntryPeerList peers, Type[] credentialEntryRecordTypes) Gets the credential entry forms for creating a bunch of new credential entries.getCredentialEntryFormsForUpdate(IdList credentialEntryIds) Gets the credential entryforms for updating an existing set of credential entries.updateCredentialEntries(CredentialEntryBatchFormList credentialEntryForms) Updates existing credential entries.Methods inherited from interface CredentialEntryAdminSession
aliasCredentialEntry, canCreateCredentialEntries, canCreateCredentialEntryWithRecordTypes, canDeleteCredentialEntries, canManageCredentialEntryAliases, canUpdateCredentialEntries, createCredentialEntry, deleteCredentialEntry, getCourseCatalog, getCourseCatalogId, getCredentialEntryFormForCreate, getCredentialEntryFormForUpdate, updateCredentialEntryModifier and TypeMethodDescriptionvoidaliasCredentialEntry(Id credentialEntryId, Id aliasId) Adds anIdto aCredentialEntryfor the purpose of creating compatibility.booleanTests if this user can createCredentialEntries.booleancanCreateCredentialEntryWithRecordTypes(Type[] credentialEntryRecordTypes) Tests if this user can create a singlePorgramusing the desired record types.booleanTests if this user can deleteCredentialEntries.booleanTests if this user can manageIdaliases forCredentialEntries.booleanTests if this user can updateCredentialEntries.createCredentialEntry(CredentialEntryForm credentialEntryForm) Creates a newCredentialEntry.voiddeleteCredentialEntry(Id credentialEntryId) Deletes aCredentialEntry.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getCredentialEntryFormForCreate(Id credentialId, Id resourceId, Type[] credentialEntryRecordTypes) Gets the credential entry form for creating new credential entries.getCredentialEntryFormForUpdate(Id credentialEntryId) Gets the credential entry form for updating an existing credential entry.voidupdateCredentialEntry(CredentialEntryForm credentialEntryForm) Updates an existing credential entry.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
-
getCredentialEntryFormsForCreate
CredentialEntryBatchFormList getCredentialEntryFormsForCreate(CredentialEntryPeerList peers, Type[] credentialEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the credential entry forms for creating a bunch of new credential entries. A form is returned for each credential and student pair.- Parameters:
peers- a list of credential entry peerscredentialEntryRecordTypes- array of credential entryrecord types to be included in each create operation or an empty list if none- Returns:
- the credential entry forms
- Throws:
NotFoundException-credentialIdorresourceIdis not foundNullArgumentException-peersor credentialEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCredentialEntries
CreateResponseList createCredentialEntries(CredentialEntryBatchFormList credentialEntryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCredentialEntries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
credentialEntryForms- the credential entry forms- Returns:
- the create responses
- Throws:
NullArgumentException-credentialEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCredentialEntryFormsForUpdate
CredentialEntryBatchFormList getCredentialEntryFormsForUpdate(IdList credentialEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the credential entryforms for updating an existing set of credential entries. A new credential entryform should be requested for each update transaction.- Parameters:
credentialEntryIds- theIdsof theCredentialEntry- Returns:
- the credential entry form
- Throws:
NotFoundException- acredentialEntryIdis not foundNullArgumentException-credentialEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCredentialEntries
UpdateResponseList updateCredentialEntries(CredentialEntryBatchFormList credentialEntryForms) throws OperationFailedException, PermissionDeniedException Updates existing credential entries. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
credentialEntryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-credentialEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCredentialEntries
DeleteResponseList deleteAllCredentialEntries() throws OperationFailedException, PermissionDeniedExceptionDeletes allCredentialEntriesin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCredentialEntries
DeleteResponseList deleteCredentialEntries(IdList credentialEntryIds) throws OperationFailedException, PermissionDeniedException Deletes credential entries for the givenIds.- Parameters:
credentialEntryIds- theIdsof the credential entries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-credentialEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCredentialEntriesForCredential
DeleteResponseList deleteCredentialEntriesForCredential(Id credentialId) throws OperationFailedException, PermissionDeniedException Deletes credential entries for the given credential.- Parameters:
credentialId- theIdof a credential- Returns:
- the delete responses
- Throws:
NullArgumentException-credentialIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCredentialEntriesForStudent
DeleteResponseList deleteCredentialEntriesForStudent(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes credential entries for the given student.- Parameters:
resourceId- theIdof a student- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveCredentialEntriesByDate
DeleteResponseList deleteIneffectiveCredentialEntriesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes credential entries 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.
-
aliasCredentialEntries
AliasResponseList aliasCredentialEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCredentialEntryfor the purpose of creating compatibility. The primaryIdof theCredentialEntryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another credential entry, it is reassigned to the given credential entryId.- 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.
-