Interface ConfigurationAdminSession

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

public interface ConfigurationAdminSession extends OsidSession

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

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

The delete operations delete Configurations .

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

  • Method Details

    • canCreateConfigurations

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

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

      ConfigurationForm getConfigurationFormForCreate(Type[] configurationRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the configuration form for creating new configurations. A new form should be requested for each create transaction.
      Parameters:
      configurationRecordTypes - array of configuration record types
      Returns:
      the configuration form
      Throws:
      NullArgumentException - configurationRecordTypes 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.
    • createConfiguration

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

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

      ConfigurationForm getConfigurationFormForUpdate(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the configuration form for updating existing configurations. A new configuration form should be requested for each update transaction.
      Parameters:
      configurationId - Id of a Configuration
      Returns:
      the configuration form
      Throws:
      NotFoundException - configurationId is not found
      NullArgumentException - configurationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateConfiguration

      void updateConfiguration(ConfigurationForm configurationForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing Configuration .
      Parameters:
      configurationForm - the configuration form
      Throws:
      IllegalStateException - configurationForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - configurationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - configurationForm did not originate from getConfigurationFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteConfigurations

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

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

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

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