Interface QueueAdminSession

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

public interface QueueAdminSession extends OsidSession

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

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

The delete operations delete Queues . To unmap a Queue from the current Distributor , the QueueDistributorAssignmentSession should be used. These delete operations attempt to remove the Queue itself thus removing it from all known Distributor catalogs.

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

  • Method Details

    • getDistributorId

      Id getDistributorId()
      Gets the Distributor Id associated with this session.
      Returns:
      the Distributor Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getDistributor

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

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

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

      QueueForm getQueueFormForCreate(Id brokerId, Type[] queueRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the queue form for creating new queues. A new form should be requested for each create transaction.
      Parameters:
      brokerId - a broker Id
      queueRecordTypes - array of queue record types
      Returns:
      the queue form
      Throws:
      NotFoundException - brokerId is not found
      NullArgumentException - brokerId or queueRecordTypes 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.
    • createQueue

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

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

      Gets the queue form for updating an existing queue. A new queue form should be requested for each update transaction.
      Parameters:
      queueId - the Id of the Queue
      Returns:
      the queue form
      Throws:
      NotFoundException - queueId is not found
      NullArgumentException - queueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateQueue

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

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

      Deletes a Queue .
      Parameters:
      queueId - the Id of the Queue to remove
      Throws:
      NotFoundException - queueId not found
      NullArgumentException - queueId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageQueueAliases

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

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