Class 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 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
    • Constructor Detail

      • PeerOptions

        protected PeerOptions​()
    • Method Detail

      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.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 - see Peer.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 class java.lang.Object
        Returns:
        return a duplicate of this instance.