Interface DemographicAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DemographicAdminSession extends OsidSession

This session creates and removes demographics. The data for create and update is provided via the DemographicForm .

  • Method Details

    • getBinId

      Id getBinId()
      Gets the Bin Id associated with this session.
      Returns:
      the Bin Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBin

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

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

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

      DemographicForm getDemographicFormForCreate(Type[] demographicRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the demographic form for creating new demographics. A new form should be requested for each create transaction.
      Parameters:
      demographicRecordTypes - array of demographic record types
      Returns:
      the demographic form
      Throws:
      NullArgumentException - demographicRecordTypes 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.
    • createDemographic

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

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

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

      void updateDemographic(DemographicForm demographicForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing demographic.
      Parameters:
      demographicForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - demographicForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - demographicId or demographicForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - demographicForm did not originate from getDemographicFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteDemographics

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

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

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

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