Interface QualifierAdminSession

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

public interface QualifierAdminSession extends OsidSession

This session creates, updates, and deletes Qualifiers . 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 Qualifier , a QualifierForm is requested using getQualifierFormForCreate() specifying the desired relationship peers and record Types or none if no record Types are needed. The returned QualifierForm 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 QualifierForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each QualifierForm corresponds to an attempted transaction.

For updates, QualifierForms are requested to the Qualifier Id that is to be updated using getQualifierFormForUpdate() . Similarly, the QualifierForm has metadata about the data that can be updated and it can perform validation before submitting the update. The QualifierForm can only be used once for a successful update and cannot be reused.

The delete operations delete Qualifiers . To unmap a Qualifier from the current Vault , the QualifierVaultAssignmentSession should be used. These delete operations attempt to remove the Qualifier itself thus removing it from all known Vault catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getVaultId

      Id getVaultId()
      Gets the Vault Id associated with this session.
      Returns:
      the Vault Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getVault

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

      boolean canCreateQualifiers()
      Tests if this user can create Qualifiers . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Qualifier 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 Qualifier creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateQualifierWithRecordTypes

      boolean canCreateQualifierWithRecordTypes(Type[] qualifierRecordTypes)
      Tests if this user can create a single Qualifier using the desired record types. While AuthorizationManager.getQualifierRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Qualifier . Providing an empty array tests if a Qualifier can be created with no records.
      Parameters:
      qualifierRecordTypes - array of qualifier record types
      Returns:
      true if Qualifier creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - qualifierRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getQualifierFormForCreate

      QualifierForm getQualifierFormForCreate(Type[] qualifierRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the qualifier form for creating new qualifiers. A new form should be requested for each create transaction.
      Parameters:
      qualifierRecordTypes - array of qualifier record types
      Returns:
      the qualifier form
      Throws:
      NullArgumentException - qualifierRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form with requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createQualifier

      Creates a new Qualifier .
      Parameters:
      qualifierForm - the form for this Qualifier
      Returns:
      the new Qualifier
      Throws:
      IllegalStateException - qualifierForm already used for a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - qualifierForms is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - qualifierForm did not originate from getQualifierFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateQualifiers

      boolean canUpdateQualifiers()
      Tests if this user can update Qualifiers . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Qualifier 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 Qualifier modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getQualifierFormForUpdate

      QualifierForm getQualifierFormForUpdate(Id qualifierId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the qualifier form for updating an existing qualifier. A new qualifier form should be requested for each update transaction.
      Parameters:
      qualifierId - the Id of the Qualifier
      Returns:
      the qualifier form
      Throws:
      NotFoundException - qualifierId is not found
      NullArgumentException - qualifierId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateQualifier

      void updateQualifier(QualifierForm qualifierForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing qualifier.
      Parameters:
      qualifierForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - qualifierForm already used for an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - qualifierForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - qualifierForm did not originate from getQualifierFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteQualifiers

      boolean canDeleteQualifiers()
      Tests if this user can delete Qualifiers . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Qualifier 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 Qualifier deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteQualifier

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

      boolean canManageQualifierAliases()
      Tests if this user can manage Id aliases for Qualifiers . 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 Qualifier aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasQualifier

      Adds an Id to a Qualifier for the purpose of creating compatibility. The primary Id of the Qualifier is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another qualifier, it is reassigned to the given qualifier Id .
      Parameters:
      qualifierId - the Id of a Qualifier
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - qualifierId not found
      NullArgumentException - qualifierId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.