Interface RequestTransactionAdminSession

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

public interface RequestTransactionAdminSession extends OsidSession

This session creates, updates, and deletes RequestTransactions . 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. Once a Request is created, it has not been submitted. submitRequestTransaction submits a RequesTransactiont for processing. Constraints on update and delete may vary between creation and submission.

Create and update operations differ in their usage. To create a RequestTransaction , a RequestTransactionForm is requested using getRequestTransactionFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned RequestTransactionForm 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 RequestTransactionForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each RequestTransactionForm corresponds to an attempted transaction.

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

The delete operations delete RequestTransactions . To unmap a RequestTransaction from the current Distributor , the RequestTransactionDistributorAssignmentSession should be used. These delete operations attempt to remove the ReqeustTransaction 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.
    • canCreateRequestTransactions

      boolean canCreateRequestTransactions()
      Tests if this user can create RequestTransactions . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Request will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer transaction operations to an unauthorized user.
      Returns:
      false if RequestTransaction creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRequestTransactionsWithRecordTypes

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

      RequestTransactionForm getRequestTransactionFormForCreate(Id brokerId, Id resourceId, Type[] requestTransactionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the request transaction form for creating new request transactionss. A new form should be requested for each create transaction.
      Parameters:
      brokerId - a broker Id
      resourceId - a resource Id
      requestTransactionRecordTypes - array of request transaction record types
      Returns:
      the request transaction form
      Throws:
      NotFoundException - brokerId or resourceId is not found
      NullArgumentException - brokerId, resourceId , or requestTransactionRecordTypes 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.
    • createRequestTransaction

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

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

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

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

      void submitRequestTransaction(Id requestTransactionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Submits a RequestTransaction and the related requests.
      Parameters:
      requestTransactionId - the Id of the request transaction to submit
      Throws:
      NotFoundException - requestTransactionId is not found
      NullArgumentException - requestTransactionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCancelRequestTransactions

      boolean canCancelRequestTransactions()
      Tests if this user can cancel RequestTransactions . A return of true does not guarantee successful authorization. A return of false indicates that it is known canceling a RequestTransaction will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer cancel operations to an unauthorized user.
      Returns:
      false if RequestTransaction cancelation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • cancelRequestTransaction

      void cancelRequestTransaction(Id requestTransactionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Cancels a RequestTransaction and the related requests.
      Parameters:
      requestTransactionId - the Id of the request transaction to cancel
      Throws:
      NotFoundException - requestTransactionId is not found
      NullArgumentException - requestTransactionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteRequestTransactions

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

      void deleteRequestTransaction(Id requestTransactionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a RequestTransaction and the related requests.
      Parameters:
      requestTransactionId - the Id of the request transaction to delete
      Throws:
      NotFoundException - requestTransactionId is not found
      NullArgumentException - requestTransactionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageRequestTransactionAliases

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

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