Interface BrokerAdminSession

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

public interface BrokerAdminSession extends OsidSession

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

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

The delete operations delete Brokers . To unmap a Broker from the current Distributor , the BrokerDistributorAssignmentSession should be used. These delete operations attempt to remove the Broker 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.
    • canCreateBrokers

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

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

      BrokerForm getBrokerFormForCreate(Type[] brokerRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the broker form for creating new brokers. A new form should be requested for each create transaction.
      Parameters:
      brokerRecordTypes - array of broker record types
      Returns:
      the broker form
      Throws:
      NullArgumentException - brokerRecordTypes 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.
    • createBroker

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

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

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

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

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

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

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

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

      boolean canAssignQueues()
      Tests if this user can assign queues to brokers. A return of true does not guarantee successful authorization. A return of false indicates that it is known assigning a queue will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer queue operations to an unauthorized user.
      Returns:
      false if queue assignment is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • addQueue

      Adds a queue to a broker.
      Parameters:
      brokerId - the brokerId Id
      queueId - the queue Id
      Throws:
      AlreadyExistsException - queue already part of work
      NotFoundException - queueId or brokerId is not found
      NullArgumentException - queueId or brokerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • removeQueue

      void removeQueue(Id brokerId, Id queueId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a queue from a broker.
      Parameters:
      brokerId - the broker Id
      queueId - the queue Id
      Throws:
      NotFoundException - queue is not part of broker
      NullArgumentException - brokerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.