Interface ExchangeSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ExchangeSession extends OsidSession

This session exchanges an existing provision for a request for another provision via the queue. The data for create and update is provided via the RequestForm .

  • Method Details

    • getQueueId

      Id getQueueId()
      Gets the Queue Id associated with this session.
      Returns:
      the Queue Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getQueue

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

      boolean canCreateRequestsInExchange(Id provisionId)
      Tests if this user can create Requests . 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 create operations to an unauthorized user.
      Parameters:
      provisionId - the Id of the provision to exchange
      Returns:
      false if Request creation is not authorized, true otherwise
      Throws:
      NullArgumentException - provisionId is null
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRequestWithRecordTypesInExchange

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

      RequestForm getRequestFormForCreate(Id provisionId, Type[] requestRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the request form for creating new requests for the exchange. A new form should be requested for each create transaction.
      Parameters:
      provisionId - the Id of the provision to exchange
      requestRecordTypes - array of request record types
      Returns:
      the request form
      Throws:
      NotFoundException - provisionId is not found
      NullArgumentException - provisionId or requestRecordTypes 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.
    • createRequestInExchange

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