Interface ValueAdminSession

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

public interface ValueAdminSession extends OsidSession

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

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

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

  • Method Details

    • getConfigurationId

      Id getConfigurationId()
      Gets the Configuration Id associated with this session.
      Returns:
      the Configuration Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getConfiguration

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

      boolean supportValueConditions()
      Tests if applying conditions to values is supported.
      Returns:
      true if Value conditions are supported, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateValues

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

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

      ValueForm getValueFormForCreate(Id parameterId, Type[] valueRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the form for creating new values. A new form should be requested for each create transaction.
      Parameters:
      parameterId - the parameter
      valueRecordTypes - array of value record types
      Returns:
      the value form
      Throws:
      NotFoundException - parameterId is not found
      NullArgumentException - parameterId or valueRecordTypes 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.
    • createValue

      Creates a value.
      Parameters:
      valueForm - the form
      Returns:
      the value
      Throws:
      IllegalStateException - valueForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - valueForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - valueForm did not originate from getValueFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateValues

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

      Gets the value form for updating an existing value. A new value form should be requested for each update transaction.
      Parameters:
      valueId - the Id of the Value
      Returns:
      the value form
      Throws:
      NotFoundException - the value is not found
      NullArgumentException - parameterId or valueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateValue

      void updateValue(ValueForm valueForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing value.
      Parameters:
      valueForm - the form containing the elemnts to be updated
      Throws:
      IllegalStateException - valueForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - parameterId, valueId or valueForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - valueForm did not originate from getValueFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteValues

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

      Deletes the specified value.
      Parameters:
      valueId - the Id of the Value to delete
      Throws:
      NotFoundException - valueId is not found
      NullArgumentException - valueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageValueAliases

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

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