Class Peer

java.lang.Object
org.hyperledger.fabric.sdk.Peer
All Implemented Interfaces:
Serializable

public class Peer extends Object implements Serializable
The Peer class represents a peer to which SDK sends deploy, or query proposals requests.
See Also:
  • Field Details

  • Method Details

    • getName

      public String getName()
      Peer's name
      Returns:
      return the peer's name.
    • getProperties

      public Properties getProperties()
    • getUrl

      public String getUrl()
      Get the URL of the peer.
      Returns:
      {string} Get the URL associated with the peer.
    • equals

      public boolean equals(Object otherPeer)
      for use in list of peers comparisons , e.g. list.contains() calls
      Overrides:
      equals in class Object
      Parameters:
      otherPeer - the peer instance to compare against
      Returns:
      true if both peer instances have the same name and url
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getPeerEventingServiceDisconnected

      public Peer.PeerEventingServiceDisconnected getPeerEventingServiceDisconnected()
      Get current disconnect handler service
      Returns:
      The current disconnect handler service.
    • setPeerEventingServiceDisconnected

      public Peer.PeerEventingServiceDisconnected setPeerEventingServiceDisconnected(Peer.PeerEventingServiceDisconnected newPeerEventingServiceDisconnectedHandler)
      Set class to handle peer eventing service disconnects
      Parameters:
      newPeerEventingServiceDisconnectedHandler - New handler to replace. If set to null no retry will take place.
      Returns:
      the old handler.
    • getProtocol

      public String getProtocol()
    • toString

      public String toString()
      Overrides:
      toString in class Object