Interface ControllerAdminSession

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

public interface ControllerAdminSession extends OsidSession

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

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

The delete operations delete Controllers . To unmap a Controller from the current System , the ControllerSystemAssignmentSession should be used. These delete operations attempt to remove the Controller itself thus removing it from all known System catalogs.

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

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

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

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

      ControllerForm getControllerFormForCreate(Type[] controllerRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the controller form for creating new controllers. A new form should be requested for each create transaction.
      Parameters:
      controllerRecordTypes - array of controller record types
      Returns:
      the controller form
      Throws:
      NullArgumentException - controllerRecordTypes 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.
    • createController

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

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

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

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

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

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

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

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