Interface DictionaryAdminSession

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

public interface DictionaryAdminSession extends OsidSession

This session creates, updates, and deletes Dictionaries . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Dictionary , a DictionaryForm is requested using getDictionaryFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned DictionaryForm 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 DictionaryForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each DictionaryForm corresponds to an attempted transaction.

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

The delete operations delete Dictionaries .

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

  • Method Details

    • canCreateDictionaries

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

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

      DictionaryForm getDictionaryFormForCreate(Type[] dictionaryRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the dictionary form for creating new dictionaries. A new form should be requested for each create transaction.
      Parameters:
      dictionaryRecordTypes - array of dictionary record types
      Returns:
      the dictionary form
      Throws:
      NullArgumentException - dictionaryRecordTypes 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.
    • createDictionary

      Creates a new Dictionary .
      Parameters:
      dictionaryForm - the form for the new Dictionary
      Returns:
      the new Dictionary
      Throws:
      IllegalStateException - dictionaryForm already used in a create transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - dictionaryForms is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - dictionaryForm did not originate from getDictionaryFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateDictionaries

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

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

      void updateDictionary(DictionaryForm dictionaryForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing dictionary.
      Parameters:
      dictionaryForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - dictionaryForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - dictionaryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - a dictionaryForm did not originate from getDictionaryFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteDictionaries

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

      void deleteDictionary(Id dictionaryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Dictionary .
      Parameters:
      dictionaryId - the Id of the Dictionary to delete
      Throws:
      NotFoundException - dictionaryId not found
      NullArgumentException - dictionaryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageDictionaryAliases

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

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