Interface CredentialBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CredentialAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Credentials 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
Credential , a CredentialForm is requested using
getCredentialFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
CredentialForms 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 CredentialForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CredentialForm corresponds
to an attempted transaction.
The CredentialForm returned from
getCredentialFormsForCreate() may be linked to the originating request
through the peer Ids of the CredentialForm . In the case
where there may be duplicates, any CredentialtForm of the same
peer Ids may be used for a create operation.
Once a batch of CredentialForms are submitted for create, a
CreateResponse is returned for each CredentialForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createCredentials() ,
errors specific to an individual CredentialForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating CredentialForm through the
CredentialForm Id .
For updates, CredentialForms are requested to the
Credential Id that is to be updated using
getCredentialFormsForUpdate() where the reference Id in the
CredentialForm may be used to link the request. Similarly, the
CredentialForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
CredentialForm can only be used once for a successful update and cannot
be reused.
Once a batch of CredentialForms are submitted for update, an
UpdateResponse is returned for each CredentialForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateCredentialForms()
, errors specific to an individual CredentialForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating CredentialForm through the
CredentialForm Id .
The delete operations delete Credentials in bulk. To unmap s
Credential from the current CourseCatalog , the
CredentialCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the Credential itself thus removing
it from all known CourseCatalog catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCredentials(AliasRequestList aliasRequests) Adds anIdto aCredentialfor the purpose of creating compatibility.createCredentials(CredentialBatchFormList credentialForms) Creates a new set ofCredentials.Deletes allCredentialsin thisCourseCatalog.deleteCredentials(IdList credentialIds) Deletes credentials for the givenIds.getCredentialFormsForCreate(long number, Type[] credentialRecordTypes) Gets the credential forms for creating a bunch of new credentials.getCredentialFormsForUpdate(IdList credentialIds) Gets the credential forms for updating an existing set of credentials.updateCredentials(CredentialBatchFormList credentialForms) Updates existing credentials.Methods inherited from interface CredentialAdminSession
aliasCredential, canCreateCredentials, canCreateCredentialWithRecordTypes, canDeleteCredentials, canManageCredentialAliases, canUpdateCredentials, createCredential, deleteCredential, getCourseCatalog, getCourseCatalogId, getCredentialFormForCreate, getCredentialFormForUpdate, updateCredentialModifier and TypeMethodDescriptionvoidaliasCredential(Id credentialId, Id aliasId) Adds anIdto acredentialfor the purpose of creating compatibility.booleanTests if this user can createCredentials.booleancanCreateCredentialWithRecordTypes(Type[] credentialRecordTypes) Tests if this user can create a singleCredentialusing the desired record types.booleanTests if this user can deleteCredentials.booleanTests if this user can manageIdaliases forCredentials.booleanTests if this user can updateCredentials.createCredential(CredentialForm credentialForm) Creates a newCredential.voiddeleteCredential(Id credentialId) Deletes aCredential.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getCredentialFormForCreate(Type[] credentialRecordTypes) Gets the credential form for creating new credentials.getCredentialFormForUpdate(Id credentialId) Gets the credential form for updating an existing credential.voidupdateCredential(CredentialForm credentialForm) Updates an existing credential.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
-
getCredentialFormsForCreate
CredentialBatchFormList getCredentialFormsForCreate(long number, Type[] credentialRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the credential forms for creating a bunch of new credentials.- Parameters:
number- the number of forms to retrievecredentialRecordTypes- array of credential record types to be included in each create operation or an empty list if none- Returns:
- the credential forms
- Throws:
NullArgumentException-credentialRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCredentials
CreateResponseList createCredentials(CredentialBatchFormList credentialForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCredentials. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
credentialForms- the credential forms- Returns:
- the create responses
- Throws:
NullArgumentException-credentialFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCredentialFormsForUpdate
CredentialBatchFormList getCredentialFormsForUpdate(IdList credentialIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the credential forms for updating an existing set of credentials. A new credential form should be requested for each update transaction.- Parameters:
credentialIds- theIdsof theCredential- Returns:
- the credential form
- Throws:
NotFoundException- acredentialIdis not foundNullArgumentException-credentialIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCredentials
UpdateResponseList updateCredentials(CredentialBatchFormList credentialForms) throws OperationFailedException, PermissionDeniedException Updates existing credentials. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
credentialForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-credentialFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCredentials
DeleteResponseList deleteAllCredentials() throws OperationFailedException, PermissionDeniedExceptionDeletes allCredentialsin thisCourseCatalog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCredentials
DeleteResponseList deleteCredentials(IdList credentialIds) throws OperationFailedException, PermissionDeniedException Deletes credentials for the givenIds.- Parameters:
credentialIds- theIdsof the credentials to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-credentialIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasCredentials
AliasResponseList aliasCredentials(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCredentialfor the purpose of creating compatibility. The primaryIdof theCredentialis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another credential, it is reassigned to the given credentialId.- 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.
-