Class Channel.NOfEvents

java.lang.Object
org.hyperledger.fabric.sdk.Channel.NOfEvents
Enclosing class:
Channel

public static class Channel.NOfEvents extends Object
NofEvents may be used with @see Channel.TransactionOptions.nOfEvents(NOfEvents) to control how reporting Peer service events and Eventhubs will complete the future acknowledging the transaction has been seen by those Peers.

You can use the method @see nofNoEvents to create an NOEvents that will result in the future being completed immediately when the Orderer has accepted the transaction. Note in this case the transaction event will be set to null.

NofEvents can add Peer Eventing services and Eventhubs that should complete the future. By default all will need to see the transactions to complete the future. The method @see setN(int) can set how many in the group need to see the transaction completion. Essentially setting it to 1 is any.

NofEvents may also contain other NofEvent grouping. They can be nested.

  • Field Details

    • nofNoEvents

      public static Channel.NOfEvents nofNoEvents
      Special NofEvents indicating that no transaction events are needed to complete the Future. This will result in the Future being completed as soon has the Orderer has seen the transaction.
  • Method Details

    • setN

      public Channel.NOfEvents setN(int n)
    • addPeers

      public Channel.NOfEvents addPeers(Peer... peers)
      Peers that need to see the transaction event to complete.
      Parameters:
      peers - The peers that need to see the transaction event to complete.
      Returns:
      This NofEvents.
    • addPeers

      public Channel.NOfEvents addPeers(Collection<Peer> peers)
      Peers that need to see the transaction event to complete.
      Parameters:
      peers - The peers that need to see the transaction event to complete.
      Returns:
      This NofEvents.
    • addNOfs

      public Channel.NOfEvents addNOfs(Channel.NOfEvents... nOfEvents)
      NOfEvents that need to see the transaction event to complete.
      Parameters:
      nOfEvents - The nested event group that need to set the transacton event to complete.
      Returns:
      This NofEvents.
    • addNOfs

      NOfEvents that need to see the transaction event to complete.
      Parameters:
      nofs - The nested event group that need to set the transacton event to complete.
      Returns:
      This NofEvents.
    • createNofEvents

      public static Channel.NOfEvents createNofEvents()
    • createNoEvents

      public static Channel.NOfEvents createNoEvents()