Interface DeviceEnablerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface DeviceEnablerAdminSession extends OsidSession

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

  • Method Details

    • getSystemId

      Id getSystemId()
      Gets the System Id associated with this session.
      Returns:
      the System Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getSystem

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

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

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

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

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

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

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

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

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

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

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

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