Enum DefaultQueryHandlers

java.lang.Object
java.lang.Enum<DefaultQueryHandlers>
org.hyperledger.fabric.gateway.DefaultQueryHandlers
All Implemented Interfaces:
Serializable, Comparable<DefaultQueryHandlers>, java.lang.constant.Constable, 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").
  • Enum Constant Details

    • 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.
  • Method Details

    • values

      public static DefaultQueryHandlers[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DefaultQueryHandlers valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • create

      public QueryHandler create(Network network)
      Description copied from interface: QueryHandlerFactory
      Factory function to create a query handler instance.
      Specified by:
      create in interface QueryHandlerFactory
      Parameters:
      network - Network on which the query is invoked.
      Returns:
      A query handler.