org.hyperledger.fabric.gateway

## 枚举 DefaultCommitHandlers

- java.lang.Object
- - java.lang.Enum<DefaultCommitHandlers>
  - - org.hyperledger.fabric.gateway.DefaultCommitHandlers

- 所有已实现的接口:
    Serializable, Comparable<DefaultCommitHandlers>, CommitHandlerFactory

      public enum DefaultCommitHandlers
      extends Enum<DefaultCommitHandlers>
      implements CommitHandlerFactory

  Default commit handler implementations. Instances can be referenced directly or looked up by name, for example `DefaultCommitHandlers.valueOf("NONE")`.

- - ### 枚举常量概要

    枚举常量
    枚举常量和说明
    `MSPID_SCOPE_ALLFORTX` Wait to receive commit events from all currently responding peers in the user's organization after submitting a transaction.
    `MSPID_SCOPE_ANYFORTX` Wait to receive a commit event from any currently responding peer in the user's organization after submitting a transaction.
    `NETWORK_SCOPE_ALLFORTX` Wait to receive commit events from all currently responding peers in the network after submitting a transaction.
    `NETWORK_SCOPE_ANYFORTX` Wait to receive a commit event from any currently responding peer in the network after submitting a transaction.
    `NONE` Do not wait for any commit events to be received from peers after submitting a transaction.
    `PREFER_MSPID_SCOPE_ALLFORTX` Wait to receive commit events from all currently responding peers in the user's organization after submitting a transaction.
    `PREFER_MSPID_SCOPE_ANYFORTX` Wait to receive a commit event from any currently responding peer in the user's organization after submitting a transaction.

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `CommitHandler` | `create(String transactionId, Network network)` Factory function to create a commit handler instance.
    `static DefaultCommitHandlers` | `valueOf(String name)` 返回带有指定名称的该类型的枚举常量。
    `static DefaultCommitHandlers[]` | `values()` 按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。

    - ### 从类继承的方法 java.lang.Enum

      `compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### 从类继承的方法 java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### 枚举常量详细资料

    - #### NONE

          public static final DefaultCommitHandlers NONE

      Do not wait for any commit events to be received from peers after submitting a transaction.

    - #### MSPID_SCOPE_ALLFORTX

          public static final DefaultCommitHandlers MSPID_SCOPE_ALLFORTX

      Wait to receive commit events from all currently responding peers in the user's organization after submitting a transaction.

    - #### NETWORK_SCOPE_ALLFORTX

          public static final DefaultCommitHandlers NETWORK_SCOPE_ALLFORTX

      Wait to receive commit events from all currently responding peers in the network after submitting a transaction.

    - #### PREFER_MSPID_SCOPE_ALLFORTX

          public static final DefaultCommitHandlers PREFER_MSPID_SCOPE_ALLFORTX

      Wait to receive commit events from all currently responding peers in the user's organization after submitting a transaction. If the user's organization has no peers, then wait to receive commit events from all currently responding peers in the network instead.

    - #### MSPID_SCOPE_ANYFORTX

          public static final DefaultCommitHandlers MSPID_SCOPE_ANYFORTX

      Wait to receive a commit event from any currently responding peer in the user's organization after submitting a transaction.

    - #### NETWORK_SCOPE_ANYFORTX

          public static final DefaultCommitHandlers NETWORK_SCOPE_ANYFORTX

      Wait to receive a commit event from any currently responding peer in the network after submitting a transaction.

    - #### PREFER_MSPID_SCOPE_ANYFORTX

          public static final DefaultCommitHandlers PREFER_MSPID_SCOPE_ANYFORTX

      Wait to receive a commit event from any currently responding peer in the user's organization after submitting a transaction. If the user's organization has no peers, then wait to receive a commit event from any currently responding peer in the network.

  - ### 方法详细资料

    - #### values

          public static DefaultCommitHandlers[] values()

      按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:

          for (DefaultCommitHandlers c : DefaultCommitHandlers.values())
              System.out.println(c);

      返回:
        按照声明该枚举类型的常量的顺序返回的包含这些常量的数组

    - #### valueOf

          public static DefaultCommitHandlers valueOf(String name)

      返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
      参数:
        `name` - 要返回的枚举常量的名称。
      返回:
        返回带有指定名称的枚举常量
      抛出:
        `IllegalArgumentException` - 如果该枚举类型没有带有指定名称的常量
        `NullPointerException` - 如果参数为空值

    - #### create

          public CommitHandler create(String transactionId,
                                      Network network)

      从接口复制的说明: `CommitHandlerFactory`
      Factory function to create a commit handler instance.
      指定者:
        `create` 在接口中 `CommitHandlerFactory`
      参数:
        `transactionId` - Transaction for which the instance is to handle commit events.
        `network` - Network on which the transaction is invoked.
      返回:
        A commit handler.

Copyright © 2023. All rights reserved.