com.sap.conn.jco

## Interface JCoRequestUnit

-     public interface JCoRequestUnit

  The interface comprises public methods to work with request unit. Request unit is used as function container in bgRFC calls, where each function represented by JCoRequest. The request unit contains one or more functions and may defines queues to ensure execution order.

  Note: The implementation for this interface provided by the JCo runtime. Other implementations are not supported.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addQueueName(String queueName)` Adds a queue name.
    `boolean` | `addQueueNames(Set<String> queueNames)` Adds the given queue names.
    `void` | `addRequest(JCoRequest request)` Adds a request to the unit.
    `void` | `addRequests(List<JCoRequest> requests)` Adds the request to the unit.
    `void` | `commit(JCoDestination destination)` Commits the unit.
    `JCoUnitIdentifier` | `getIdentifier()` Return the unique identifier for the function unit.
    `Set<String>` | `getQueueNames()` Returns an immutable copy of the list containing the queue names.
    `List<JCoRequest>` | `getRequests()` Returns an immutable list of function.

- - ### Method Detail

    - #### getIdentifier

          JCoUnitIdentifier getIdentifier()

      Return the unique identifier for the function unit.
      Returns:
        the unit identifier

    - #### addQueueName

          boolean addQueueName(String queueName)

      Adds a queue name.
      Parameters:
        `queueName` - name of the queue
      Returns:
        true, if the queue name is added, false if the name is already in the list
      Throws:
        `JCoRuntimeException` - if the unit is being modified after commit
        `JCoRuntimeException` - if the queue name is not allowed. Allowed are queue names [A-Z]([A-Z]|[0-9]|_)* only.

    - #### addQueueNames

          boolean addQueueNames(Set<String> queueNames)

      Adds the given queue names.
      Parameters:
        `queueNames` - set of the queue names to add
      Returns:
        true, if all queue names are added, false if a name is already in the list
      Throws:
        `JCoRuntimeException` - if the unit is being modified after commit
        `JCoRuntimeException` - if a queue name in the list is not allowed. Allowed are queue names [A-Z]([A-Z]|[0-9]|_)* only.

    - #### getQueueNames

          Set<String> getQueueNames()

      Returns an immutable copy of the list containing the queue names.
      Returns:
        the list of the queue names

    - #### addRequest

          void addRequest(JCoRequest request)

      Adds a request to the unit.
      Note: the request shall not be changed before commit.
      Parameters:
        `request` - request to be added to the unit
      Throws:
        `JCoRuntimeException` - if the unit is being modified after commit

    - #### addRequests

          void addRequests(List<JCoRequest> requests)

      Adds the request to the unit.
      Note: the request shall not be changed before commit.
      Parameters:
        `requests` - list of requests to be added to the unit
      Throws:
        `JCoRuntimeException` - if the unit is being modified after commit

    - #### getRequests

          List<JCoRequest> getRequests()

      Returns an immutable list of function.
      Returns:
        the list of the functions

    - #### commit

          void commit(JCoDestination destination)
                      throws JCoException

      Commits the unit. After commit the unit cannot be changed. It is allowed to invoke commit more than once in case of exceptions.
      Parameters:
        `destination` - to which the unit has to be send
      Throws:
        `JCoException` - if transmission or processing on the remote side fails

Copyright © 2020 SAP. All Rights Reserved.