Interface CommissionAdminSession

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

public interface CommissionAdminSession extends OsidSession

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

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

The delete operations delete Commissions . To unmap a Commission from the current Foundry , the CommissionFoundryAssignmentSession should be used. These delete operations attempt to remove the Commission itself thus removing it from all known Foundry catalogs.

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

  • Method Details

    • getFoundryId

      Id getFoundryId()
      Gets the Foundry Id associated with this session.
      Returns:
      the Foundry Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getFoundry

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

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

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

      CommissionForm getCommissionFormForCreate(Id resourceId, Id workId, Type[] commissionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the commission form for creating new commissions. A new form should be requested for each create transaction.
      Parameters:
      resourceId - the Id for the resource
      workId - the Id for the work
      commissionRecordTypes - array of commission record types
      Returns:
      the commission form
      Throws:
      NotFoundException - resourceId or workId is not found
      NullArgumentException - resourceId, workId , or commissionRecordTypes 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.
    • createCommission

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

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

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

      void updateCommission(CommissionForm commissionForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing commission.
      Parameters:
      commissionForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - commissionForm already used for an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - commissionForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - commissionForm did no originate from getCommissionFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteCommissions

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

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

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

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