Interface PoolAdminSession

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

public interface PoolAdminSession extends OsidSession

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

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

The delete operations delete Pools . To unmap a Pool from the current Distributor , the PoolDistributorAssignmentSession should be used. These delete operations attempt to remove the Pool 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.
    • canCreatePools

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

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

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

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

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

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

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

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

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

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

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