Interface CredentialEntryAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
CredentialEntryBatchAdminSession

public interface CredentialEntryAdminSession extends OsidSession

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 Details

    • getCourseCatalogId

      Id getCourseCatalogId()
      Gets the CourseCatalog Id associated with this session.
      Returns:
      the CourseCatalog Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCourseCatalog

      Gets the CourseCatalog associated with this session.
      Returns:
      the course catalog
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateCredentialEntries

      boolean canCreateCredentialEntries()
      Tests if this user can create CredentialEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a CredentialEntry will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if CredentialEntry creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateCredentialEntryWithRecordTypes

      boolean canCreateCredentialEntryWithRecordTypes(Type[] credentialEntryRecordTypes)
      Tests if this user can create a single Porgram using the desired record types. While CourseChronicleManager.getCredentialEntryRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific CredentialEntry . Providing an empty array tests if a CredentialEntry can be created with no records.
      Parameters:
      credentialEntryRecordTypes - array of credential entry record types
      Returns:
      true if CredentialEntry creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - credentialEntryRecordTypes is null
      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 credential Id
      resourceId - a student Id
      credentialEntryRecordTypes - array of credential entry record types
      Returns:
      the credential entry form
      Throws:
      NotFoundException - credentialId or resourceId is not found
      NullArgumentException - credentialId, resourceId , or credentialEntryRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - 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 new CredentialEntry .
      Parameters:
      credentialEntryForm - the form for this CredentialEntry
      Returns:
      the new CredentialEntry
      Throws:
      IllegalStateException - credentialEntryForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - credentialEntryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - credentialEntryForm did not originate from getCredentialEntryFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateCredentialEntries

      boolean canUpdateCredentialEntries()
      Tests if this user can update CredentialEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a CredentialEntry will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if CredentialEntry modification is not authorized, true otherwise
      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 - the Id of the CredentialEntry
      Returns:
      the credential entry form
      Throws:
      NotFoundException - credentialEntryId is not found
      NullArgumentException - credentialEntryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - credentialEntryForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - credentialEntryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - credentialEntryForm did not originate from getCredentialEntryFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteCredentialEntries

      boolean canDeleteCredentialEntries()
      Tests if this user can delete CredentialEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a CredentialEntry will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if CredentialEntry deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteCredentialEntry

      void deleteCredentialEntry(Id credentialEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a CredentialEntry .
      Parameters:
      credentialEntryId - the Id of the CredentialEntry to remove
      Throws:
      NotFoundException - credentialEntryId not found
      NullArgumentException - credentialEntryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageCredentialEntryAliases

      boolean canManageCredentialEntryAliases()
      Tests if this user can manage Id aliases for CredentialEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if CredentialEntry aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasCredentialEntry

      void aliasCredentialEntry(Id credentialEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a CredentialEntry for the purpose of creating compatibility. The primary Id of the CredentialEntry is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another credential entry, it is reassigned to the given credential entry Id .
      Parameters:
      credentialEntryId - the Id of a CredentialEntry
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - credentialEntryId not found
      NullArgumentException - credentialEntryId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.