Package org.hyperledger.fabric.gateway
Enum DefaultQueryHandlers
- java.lang.Object
-
- java.lang.Enum<DefaultQueryHandlers>
-
- org.hyperledger.fabric.gateway.DefaultQueryHandlers
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DefaultQueryHandlers>
,QueryHandlerFactory
public enum DefaultQueryHandlers extends java.lang.Enum<DefaultQueryHandlers> implements QueryHandlerFactory
Default query handler implementations. Instances can be referenced directly or looked up by name, for exampleDefaultQueryHandlers.valueOf("MSPID_SCOPE_ROUND_ROBIN")
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryHandler
create(Network network)
Factory function to create a query handler instance.static DefaultQueryHandlers
valueOf(java.lang.String name)
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.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static DefaultQueryHandlers[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DefaultQueryHandlers c : DefaultQueryHandlers.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultQueryHandlers valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.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 interfaceQueryHandlerFactory
- Parameters:
network
- Network on which the query is invoked.- Returns:
- A query handler.
-
-