Interface RequestAdminSession

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

public interface RequestAdminSession extends OsidSession

This session creates, updates, and deletes Requests . 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. submitRequest submits a Request for processing. Constraints on update and delete may vary between creation and submission.

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

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

The delete operations delete Requests . To unmap a Request from the current Distributor , the RequestDistributorAssignmentSession should be used. These delete operations attempt to remove the Request 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.
    • canCreateRequests

      boolean canCreateRequests()
      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.
      Returns:
      false if Request creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRequestWithRecordTypes

      boolean canCreateRequestWithRecordTypes(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:
      requestRecordTypes - array of request record types
      Returns:
      true if Request creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - requestRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getRequestFormForCreate

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

      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.
    • canUpdateRequests

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

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

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

      Submits a Request .
      Parameters:
      requestId - the Id of the Request to submit
      Throws:
      NotFoundException - requestId not found
      NullArgumentException - requestId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCancelRequests

      boolean canCancelRequests()
      Tests if this user can cancel Requests . A return of true does not guarantee successful authorization. A return of false indicates that it is known canceling a Request 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 Request cancelation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • cancelRequest

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

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

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

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

      Adds an Id to a Request for the purpose of creating compatibility. The primary Id of the Request 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:
      requestId - the Id of a Request
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - requestId not found
      NullArgumentException - requestId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.