org.hyperledger.fabric.client.EventsRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fabric-gateway Show documentation
Show all versions of fabric-gateway Show documentation
Hyperledger Fabric Gateway client API for Java
The newest version!
/*
* Copyright 2022 IBM All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.fabric.client;
import io.grpc.CallOptions;
import java.util.function.UnaryOperator;
/**
* A Fabric Gateway call to obtain events.
* @param The type of events obtained by this request.
*/
public interface EventsRequest extends Signable {
/**
* Get events. The Java gRPC implementation may not begin reading events until the first use of the returned
* iterator.
* Note that the returned iterator may throw {@link GatewayRuntimeException} during iteration if a gRPC
* connection error occurs.
* @return Ordered sequence of events.
*/
default CloseableIterator getEvents() {
return getEvents(GatewayUtils.asCallOptions());
}
/**
* Get events. The Java gRPC implementation may not begin reading events until the first use of the returned
* iterator.
* Note that the returned iterator may throw {@link GatewayRuntimeException} during iteration if a gRPC
* connection error occurs.
* @param options Function that transforms call options.
* @return Ordered sequence of events.
*/
CloseableIterator getEvents(UnaryOperator options);
/**
* Get events. The Java gRPC implementation may not begin reading events until the first use of the returned
* iterator.
* Note that the returned iterator may throw {@link GatewayRuntimeException} during iteration if a gRPC
* connection error occurs.
* @param options Call options.
* @return Ordered sequence of events.
* @deprecated Replaced by {@link #getEvents(UnaryOperator)}.
*/
@Deprecated
default CloseableIterator getEvents(final CallOption... options) {
return getEvents(GatewayUtils.asCallOptions(options));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy