Interface CredentialEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CredentialEntryBatchAdminSession
This session creates, updates, and deletes CredentialEntries .
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
getCredentialEntryFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
CredentialEntryForm 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 the 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.
For updates, CredentialEntryForms are requested to the
CredentialEntry Id that is to be updated using
getCredentialEntryFormForUpdate() . 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.
The delete operations delete CredentialEntries . 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.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateCredentialEntries
boolean canCreateCredentialEntries()Tests if this user can createCredentialEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCredentialEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifCredentialEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCredentialEntryWithRecordTypes
Tests if this user can create a singlePorgramusing the desired record types. WhileCourseChronicleManager.getCredentialEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCredentialEntry. Providing an empty array tests if aCredentialEntrycan be created with no records.- Parameters:
credentialEntryRecordTypes- array of credential entry record types- Returns:
trueifCredentialEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-credentialEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCredentialEntryFormForCreate
CredentialEntryForm getCredentialEntryFormForCreate(Id credentialId, Id resourceId, Type[] credentialEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the credential entry form for creating new credential entries. A new form should be requested for each create transaction.- Parameters:
credentialId- a credentialIdresourceId- a studentIdcredentialEntryRecordTypes- array of credential entry record types- Returns:
- the credential entry form
- Throws:
NotFoundException-credentialIdorresourceIdis not foundNullArgumentException-credentialId, resourceId, orcredentialEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCredentialEntry
CredentialEntry createCredentialEntry(CredentialEntryForm credentialEntryForm) throws OperationFailedException, PermissionDeniedException Creates a newCredentialEntry.- Parameters:
credentialEntryForm- the form for thisCredentialEntry- Returns:
- the new
CredentialEntry - Throws:
IllegalStateException-credentialEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-credentialEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-credentialEntryFormdid not originate fromgetCredentialEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCredentialEntries
boolean canUpdateCredentialEntries()Tests if this user can updateCredentialEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCredentialEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifCredentialEntrymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCredentialEntryFormForUpdate
CredentialEntryForm getCredentialEntryFormForUpdate(Id credentialEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the credential entry form for updating an existing credential entry. A new credential entry form should be requested for each update transaction.- Parameters:
credentialEntryId- theIdof theCredentialEntry- Returns:
- the credential entry form
- Throws:
NotFoundException-credentialEntryIdis not foundNullArgumentException-credentialEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCredentialEntry
void updateCredentialEntry(CredentialEntryForm credentialEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing credential entry.- Parameters:
credentialEntryForm- the form containing the elements to be updated- Throws:
IllegalStateException-credentialEntryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-credentialEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-credentialEntryFormdid not originate fromgetCredentialEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCredentialEntries
boolean canDeleteCredentialEntries()Tests if this user can deleteCredentialEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCredentialEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifCredentialEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCredentialEntry
void deleteCredentialEntry(Id credentialEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCredentialEntry.- Parameters:
credentialEntryId- theIdof theCredentialEntryto remove- Throws:
NotFoundException-credentialEntryIdnot foundNullArgumentException-credentialEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCredentialEntryAliases
boolean canManageCredentialEntryAliases()Tests if this user can manageIdaliases forCredentialEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifCredentialEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCredentialEntry
void aliasCredentialEntry(Id credentialEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCredentialEntryfor the purpose of creating compatibility. The primaryIdof theCredentialEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another credential entry, it is reassigned to the given credential entryId.- Parameters:
credentialEntryId- theIdof aCredentialEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-credentialEntryIdnot foundNullArgumentException-credentialEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-