Package org.hyperledger.fabric.gateway
Enum DefaultQueryHandlers
- All Implemented Interfaces:
Serializable
,Comparable<DefaultQueryHandlers>
,java.lang.constant.Constable
,QueryHandlerFactory
Default query handler implementations. Instances can be referenced directly or looked up by name, for example
DefaultQueryHandlers.valueOf("MSPID_SCOPE_ROUND_ROBIN")
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionFor each subsequent query, the next peer in the list is used.The last peer that provided a successful response is used.For each subsequent query, the next peer in the list is used.The last peer that provided a successful response is used. -
Method Summary
Modifier and TypeMethodDescriptionFactory function to create a query handler instance.static DefaultQueryHandlers
Returns the enum constant of this type with the specified name.static DefaultQueryHandlers[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
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
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
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
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
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
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 nameNullPointerException
- if the argument is null
-
create
Description copied from interface:QueryHandlerFactory
Factory function to create a query handler instance.- Specified by:
create
in interfaceQueryHandlerFactory
- Parameters:
network
- Network on which the query is invoked.- Returns:
- A query handler.
-