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.Serializable
Options for the peer. These options are channel based.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Boolean
newest
protected java.util.EnumSet<Peer.PeerRole>
peerRoles
protected boolean
registerEventsForFilteredBlocks
protected java.lang.Long
startEvents
protected java.lang.Long
stopEvents
-
Constructor Summary
Constructors Modifier Constructor Description protected
PeerOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Channel.PeerOptions
addPeerRole(Peer.PeerRole peerRole)
Add to the roles this peer will have on the chain it will added or joined.Channel.PeerOptions
clone()
Clone.static Channel.PeerOptions
createPeerOptions()
Create an instance of PeerOptions.java.lang.Boolean
getNewest()
Get newest block on startup of peer eventing service.java.util.EnumSet<Peer.PeerRole>
getPeerRoles()
Return the roles the peer has.java.lang.Long
getStartEvents()
The block number to start getting events from on start up of the peer eventing service..java.lang.Long
getStopEvents()
The stopping block number when the peer eventing service will stop sending blocks.boolean
isRegisterEventsForFilteredBlocks()
Is the peer eventing service registered for filtered blocksChannel.PeerOptions
registerEventsForBlocks()
Register the peer eventing services to return full event blocks.Channel.PeerOptions
registerEventsForFilteredBlocks()
Register the peer eventing services to return filtered blocks.Channel.PeerOptions
setPeerRoles(java.util.EnumSet<Peer.PeerRole> peerRoles)
Set the roles this peer will have on the chain it will added or joined.Channel.PeerOptions
startEvents(long start)
Set the block number the eventing peer will start relieving events.Channel.PeerOptions
startEventsNewest()
This is the default.Channel.PeerOptions
stopEvents(long stop)
The block number to stop sending events.java.lang.String
toString()
-
-
-
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:
toString
in 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:
clone
in classjava.lang.Object
- Returns:
- return a duplicate of this instance.
-
-