Interface DemographicEnablerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DemographicEnablerAdminSession extends OsidSession

This session creates and removes demographic enablers. The data for create and update is provided via the DemographicEnablerForm.

  • 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.
    • canCreateDemographicEnabler

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

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

      DemographicEnablerForm getDemographicEnablerFormForCreate(Type[] demographicEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the demographic enabler form for creating new demographic enablers. A new form should be requested for each create transaction.
      Parameters:
      demographicEnablerRecordTypes - array of demographic enabler record types
      Returns:
      the demographic enabler form
      Throws:
      NullArgumentException - demographicEnablerRecordTypes 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.
    • createDemographicEnabler

      Creates a new DemographicEnabler.
      Parameters:
      demographicEnablerForm - the form for this DemographicEnabler
      Returns:
      the new DemographicEnabler
      Throws:
      AlreadyExistsException - attempt at duplicating a property the underlying system is enforcing to be unique
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - demographicEnablerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - demographicEnablerForm is not of this service
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateDemographicEnablers

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

      boolean canUpdateDemographicEnabler(Id demographicEnablerId)
      Tests if this user can update a demographic enabler. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a DemographicEnabler 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.
      Parameters:
      demographicEnablerId - the Id of the DemographicEnabler
      Returns:
      false if demographic enabler modification is not authorized, true otherwise
      Throws:
      NullArgumentException - demographicEnablerId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code demographicEnablerId} is not found, then it is acceptable to return false to indicate the lack of an update available.
    • getDemographicEnablerFormForUpdate

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

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

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

      boolean canDeleteDemographicEnabler(Id demographicEnablerId)
      Tests if this user can delete a specified DemographicEnabler. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the DemographicEnabler will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer a delete operation to an unauthorized user.
      Parameters:
      demographicEnablerId - the Id of the DemographicEnabler
      Returns:
      false if deletion of this DemographicEnabler is not authorized, true otherwise
      Throws:
      NullArgumentException - demographicEnablerId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code demographicEnablerId} is not found, then it is acceptable to return false to indicate the lack of a delete available.
    • deleteDemographicEnabler

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

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

      void aliasDemographicEnabler(Id demographicEnablerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a DemographicEnabler for the purpose of creating compatibility. The primary Id of the DemographicEnabler 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 enabler. it is reassigned to the given demographic enabler Id.
      Parameters:
      demographicEnablerId - the Id of a DemographicEnabler
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - demographicEnablerId not found
      NullArgumentException - demographicEnablerId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.