org.hyperledger.fabric.gateway

## 枚举 DefaultQueryHandlers

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

- 所有已实现的接口:
    Serializable, Comparable<DefaultQueryHandlers>, QueryHandlerFactory

      public enum DefaultQueryHandlers
      extends Enum<DefaultQueryHandlers>
      implements QueryHandlerFactory

  Default query handler implementations. Instances can be referenced directly or looked up by name, for example `DefaultQueryHandlers.valueOf("MSPID_SCOPE_ROUND_ROBIN")`.

- - ### 枚举常量概要

    枚举常量
    枚举常量和说明
    `MSPID_SCOPE_ROUND_ROBIN` For each subsequent query, the next peer in the list is used.
    `MSPID_SCOPE_SINGLE` The last peer that provided a successful response is used.
    `PREFER_MSPID_SCOPE_ROUND_ROBIN` For each subsequent query, the next peer in the list is used.
    `PREFER_MSPID_SCOPE_SINGLE` The last peer that provided a successful response is used.

  - ### 方法概要

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

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

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

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

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

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

    - #### MSPID_SCOPE_SINGLE

          public static final DefaultQueryHandlers MSPID_SCOPE_SINGLE

      The last peer that provided a successful response is used. If a peer fails then all other peers will be tried in turn until one provides a successful response. If no peers respond then an exception is thrown.

    - #### MSPID_SCOPE_ROUND_ROBIN

          public static final DefaultQueryHandlers MSPID_SCOPE_ROUND_ROBIN

      For each subsequent query, the next peer in the list is used. If a peer fails then all other peers will be tried in turn until one provides a successful response. If no peers respond then an exception is thrown.

    - #### PREFER_MSPID_SCOPE_SINGLE

          public static final DefaultQueryHandlers PREFER_MSPID_SCOPE_SINGLE

      The last peer that provided a successful response is used. If a peer fails then all other peers will be tried in turn until one provides a successful response. If no peers respond then an exception is thrown. If the user's organization has no peers, then all peers in the network will be used.

    - #### PREFER_MSPID_SCOPE_ROUND_ROBIN

          public static final DefaultQueryHandlers PREFER_MSPID_SCOPE_ROUND_ROBIN

      For each subsequent query, the next peer in the list is used. If a peer fails then all other peers will be tried in turn until one provides a successful response. If no peers respond then an exception is thrown. If the user's organization has no peers, then all peers in the network will be used.

  - ### 方法详细资料

    - #### values

          public static DefaultQueryHandlers[] values()

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

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

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

    - #### valueOf

          public static DefaultQueryHandlers valueOf(String name)

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

    - #### create

          public QueryHandler create(Network network)

      从接口复制的说明: `QueryHandlerFactory`
      Factory function to create a query handler instance.
      指定者:
        `create` 在接口中 `QueryHandlerFactory`
      参数:
        `network` - Network on which the query is invoked.
      返回:
        A query handler.

Copyright © 2023. All rights reserved.