Interface ParameterAdminSession

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

public interface ParameterAdminSession extends OsidSession

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

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

The delete operations delete Parameters . To unmap a Parameter from the current Press , the ParameterPressAssignmentSession should be used. These delete operations attempt to remove the Parameter itself thus removing it from all known Press catalogs.

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

  • Method Details

    • getPressId

      Id getPressId()
      Gets the Press Id associated with this session.
      Returns:
      the Press Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getPress

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

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

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

      ParameterForm getParameterFormForCreate(Id textId, Type[] parameterRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the parameter form for creating new parameters. A new form should be requested for each create transidiom.
      Parameters:
      textId - a text Id
      parameterRecordTypes - array of parameter record types
      Returns:
      the parameter form
      Throws:
      NotFoundException - textId is not found
      NullArgumentException - textId or parameterRecordTypes 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.
    • createParameter

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

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

      ParameterForm getParameterFormForUpdate(Id parameterId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the parameter form for updating an existing parameter. A new parameter form should be requested for each update transidiom.
      Parameters:
      parameterId - the Id of the Parameter
      Returns:
      the parameter form
      Throws:
      NotFoundException - parameterId is not found
      NullArgumentException - parameterId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateParameter

      void updateParameter(ParameterForm parameterForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing parameter.
      Parameters:
      parameterForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - parameterForm already used in an update transidiom
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - parameterForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - parameterForm did not originate from getParameterFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteParameters

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

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

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

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