Package org.hyperledger.fabric.sdk
Class Channel.PeerOptions
- java.lang.Object
-
- org.hyperledger.fabric.sdk.Channel.PeerOptions
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Enclosing class:
- Channel
public static class Channel.PeerOptions extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableOptions for the peer. These options are channel based.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Booleannewestprotected java.util.EnumSet<Peer.PeerRole>peerRolesprotected booleanregisterEventsForFilteredBlocksprotected java.lang.LongstartEventsprotected java.lang.LongstopEvents
-
Constructor Summary
Constructors Modifier Constructor Description protectedPeerOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Channel.PeerOptionsaddPeerRole(Peer.PeerRole peerRole)Add to the roles this peer will have on the chain it will added or joined.Channel.PeerOptionsclone()Clone.static Channel.PeerOptionscreatePeerOptions()Create an instance of PeerOptions.java.lang.BooleangetNewest()Get newest block on startup of peer eventing service.java.util.EnumSet<Peer.PeerRole>getPeerRoles()Return the roles the peer has.java.lang.LonggetStartEvents()The block number to start getting events from on start up of the peer eventing service..java.lang.LonggetStopEvents()The stopping block number when the peer eventing service will stop sending blocks.booleanisRegisterEventsForFilteredBlocks()Is the peer eventing service registered for filtered blocksChannel.PeerOptionsregisterEventsForBlocks()Register the peer eventing services to return full event blocks.Channel.PeerOptionsregisterEventsForFilteredBlocks()Register the peer eventing services to return filtered blocks.Channel.PeerOptionssetPeerRoles(java.util.EnumSet<Peer.PeerRole> peerRoles)Set the roles this peer will have on the chain it will added or joined.Channel.PeerOptionsstartEvents(long start)Set the block number the eventing peer will start relieving events.Channel.PeerOptionsstartEventsNewest()This is the default.Channel.PeerOptionsstopEvents(long stop)The block number to stop sending events.java.lang.StringtoString()
-
-
-
Field Detail
-
peerRoles
protected java.util.EnumSet<Peer.PeerRole> peerRoles
-
newest
protected java.lang.Boolean newest
-
startEvents
protected java.lang.Long startEvents
-
stopEvents
protected java.lang.Long stopEvents
-
registerEventsForFilteredBlocks
protected boolean registerEventsForFilteredBlocks
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isRegisterEventsForFilteredBlocks
public boolean isRegisterEventsForFilteredBlocks()
Is the peer eventing service registered for filtered blocks- Returns:
- true if filtered blocks will be returned by the peer eventing service.
-
registerEventsForFilteredBlocks
public Channel.PeerOptions registerEventsForFilteredBlocks()
Register the peer eventing services to return filtered blocks.- Returns:
- the PeerOptions instance.
-
registerEventsForBlocks
public Channel.PeerOptions registerEventsForBlocks()
Register the peer eventing services to return full event blocks.- Returns:
- the PeerOptions instance.
-
getNewest
public java.lang.Boolean getNewest()
Get newest block on startup of peer eventing service.- Returns:
-
getStartEvents
public java.lang.Long getStartEvents()
The block number to start getting events from on start up of the peer eventing service..- Returns:
- the start number
-
getStopEvents
public java.lang.Long getStopEvents()
The stopping block number when the peer eventing service will stop sending blocks.- Returns:
- the stop block number.
-
createPeerOptions
public static Channel.PeerOptions createPeerOptions()
Create an instance of PeerOptions.- Returns:
- the PeerOptions instance.
-
getPeerRoles
public java.util.EnumSet<Peer.PeerRole> getPeerRoles()
Return the roles the peer has.- Returns:
- the roles
Peer.PeerRole
-
setPeerRoles
public Channel.PeerOptions setPeerRoles(java.util.EnumSet<Peer.PeerRole> peerRoles)
Set the roles this peer will have on the chain it will added or joined.- Parameters:
peerRoles-Peer.PeerRole- Returns:
- This PeerOptions.
-
addPeerRole
public Channel.PeerOptions addPeerRole(Peer.PeerRole peerRole)
Add to the roles this peer will have on the chain it will added or joined.- Parameters:
peerRole- seePeer.PeerRole- Returns:
- This PeerOptions.
-
startEvents
public Channel.PeerOptions startEvents(long start)
Set the block number the eventing peer will start relieving events.- Parameters:
start- The staring block number.- Returns:
- This PeerOptions.
-
startEventsNewest
public Channel.PeerOptions startEventsNewest()
This is the default. It will start retrieving events with the newest. Note this is not the next block that is added to the chain but the current block on the chain.- Returns:
- This PeerOptions.
-
stopEvents
public Channel.PeerOptions stopEvents(long stop)
The block number to stop sending events.- Parameters:
stop- the number to stop sending events.- Returns:
- This PeerOptions.
-
clone
public Channel.PeerOptions clone()
Clone.- Overrides:
clonein classjava.lang.Object- Returns:
- return a duplicate of this instance.
-
-