Class PeerStats

java.lang.Object
org.stellar.sdk.xdr.PeerStats
All Implemented Interfaces:
XdrElement

public class PeerStats extends Object implements XdrElement
PeerStats's original definition in the XDR file is:
 struct PeerStats
 {
     NodeID id;
     string versionStr<100>;
     uint64 messagesRead;
     uint64 messagesWritten;
     uint64 bytesRead;
     uint64 bytesWritten;
     uint64 secondsConnected;

     uint64 uniqueFloodBytesRecv;
     uint64 duplicateFloodBytesRecv;
     uint64 uniqueFetchBytesRecv;
     uint64 duplicateFetchBytesRecv;

     uint64 uniqueFloodMessageRecv;
     uint64 duplicateFloodMessageRecv;
     uint64 uniqueFetchMessageRecv;
     uint64 duplicateFetchMessageRecv;
 };
 
  • Constructor Details

    • PeerStats

      public PeerStats()
    • PeerStats

      public PeerStats(NodeID id, XdrString versionStr, Uint64 messagesRead, Uint64 messagesWritten, Uint64 bytesRead, Uint64 bytesWritten, Uint64 secondsConnected, Uint64 uniqueFloodBytesRecv, Uint64 duplicateFloodBytesRecv, Uint64 uniqueFetchBytesRecv, Uint64 duplicateFetchBytesRecv, Uint64 uniqueFloodMessageRecv, Uint64 duplicateFloodMessageRecv, Uint64 uniqueFetchMessageRecv, Uint64 duplicateFetchMessageRecv)
      Creates a new PeerStats instance.
      Parameters:
      id - the id field value
      versionStr - the versionStr field value
      messagesRead - the messagesRead field value
      messagesWritten - the messagesWritten field value
      bytesRead - the bytesRead field value
      bytesWritten - the bytesWritten field value
      secondsConnected - the secondsConnected field value
      uniqueFloodBytesRecv - the uniqueFloodBytesRecv field value
      duplicateFloodBytesRecv - the duplicateFloodBytesRecv field value
      uniqueFetchBytesRecv - the uniqueFetchBytesRecv field value
      duplicateFetchBytesRecv - the duplicateFetchBytesRecv field value
      uniqueFloodMessageRecv - the uniqueFloodMessageRecv field value
      duplicateFloodMessageRecv - the duplicateFloodMessageRecv field value
      uniqueFetchMessageRecv - the uniqueFetchMessageRecv field value
      duplicateFetchMessageRecv - the duplicateFetchMessageRecv field value
  • Method Details

    • encode

      public void encode(XdrDataOutputStream stream) throws IOException
      Description copied from interface: XdrElement
      Encodes this value to XDR and writes it to the provided stream.
      Specified by:
      encode in interface XdrElement
      Parameters:
      stream - the destination XDR output stream
      Throws:
      IOException - if an I/O error occurs while writing the value
    • decode

      public static PeerStats decode(XdrDataInputStream stream, int maxDepth) throws IOException
      Throws:
      IOException
    • decode

      public static PeerStats decode(XdrDataInputStream stream) throws IOException
      Throws:
      IOException
    • fromXdrBase64

      public static PeerStats fromXdrBase64(String xdr) throws IOException
      Throws:
      IOException
    • fromXdrByteArray

      public static PeerStats fromXdrByteArray(byte[] xdr) throws IOException
      Throws:
      IOException
    • toJson

      public String toJson()
      Description copied from interface: XdrElement
      Serializes this value to JSON.
      Specified by:
      toJson in interface XdrElement
      Returns:
      the JSON representation of this value
    • fromJson

      public static PeerStats fromJson(String json)
    • builder

      public static PeerStats.PeerStatsBuilder builder()
    • toBuilder

      public PeerStats.PeerStatsBuilder toBuilder()
    • getId

      public NodeID getId()
      Value of the id field.
      Returns:
      the id field value
    • getVersionStr

      public XdrString getVersionStr()
      Value of the versionStr field.
      Returns:
      the versionStr field value
    • getMessagesRead

      public Uint64 getMessagesRead()
      Value of the messagesRead field.
      Returns:
      the messagesRead field value
    • getMessagesWritten

      public Uint64 getMessagesWritten()
      Value of the messagesWritten field.
      Returns:
      the messagesWritten field value
    • getBytesRead

      public Uint64 getBytesRead()
      Value of the bytesRead field.
      Returns:
      the bytesRead field value
    • getBytesWritten

      public Uint64 getBytesWritten()
      Value of the bytesWritten field.
      Returns:
      the bytesWritten field value
    • getSecondsConnected

      public Uint64 getSecondsConnected()
      Value of the secondsConnected field.
      Returns:
      the secondsConnected field value
    • getUniqueFloodBytesRecv

      public Uint64 getUniqueFloodBytesRecv()
      Value of the uniqueFloodBytesRecv field.
      Returns:
      the uniqueFloodBytesRecv field value
    • getDuplicateFloodBytesRecv

      public Uint64 getDuplicateFloodBytesRecv()
      Value of the duplicateFloodBytesRecv field.
      Returns:
      the duplicateFloodBytesRecv field value
    • getUniqueFetchBytesRecv

      public Uint64 getUniqueFetchBytesRecv()
      Value of the uniqueFetchBytesRecv field.
      Returns:
      the uniqueFetchBytesRecv field value
    • getDuplicateFetchBytesRecv

      public Uint64 getDuplicateFetchBytesRecv()
      Value of the duplicateFetchBytesRecv field.
      Returns:
      the duplicateFetchBytesRecv field value
    • getUniqueFloodMessageRecv

      public Uint64 getUniqueFloodMessageRecv()
      Value of the uniqueFloodMessageRecv field.
      Returns:
      the uniqueFloodMessageRecv field value
    • getDuplicateFloodMessageRecv

      public Uint64 getDuplicateFloodMessageRecv()
      Value of the duplicateFloodMessageRecv field.
      Returns:
      the duplicateFloodMessageRecv field value
    • getUniqueFetchMessageRecv

      public Uint64 getUniqueFetchMessageRecv()
      Value of the uniqueFetchMessageRecv field.
      Returns:
      the uniqueFetchMessageRecv field value
    • getDuplicateFetchMessageRecv

      public Uint64 getDuplicateFetchMessageRecv()
      Value of the duplicateFetchMessageRecv field.
      Returns:
      the duplicateFetchMessageRecv field value
    • setId

      public void setId(NodeID id)
      Value of the id field.
      Parameters:
      id - the id field value
    • setVersionStr

      public void setVersionStr(XdrString versionStr)
      Value of the versionStr field.
      Parameters:
      versionStr - the versionStr field value
    • setMessagesRead

      public void setMessagesRead(Uint64 messagesRead)
      Value of the messagesRead field.
      Parameters:
      messagesRead - the messagesRead field value
    • setMessagesWritten

      public void setMessagesWritten(Uint64 messagesWritten)
      Value of the messagesWritten field.
      Parameters:
      messagesWritten - the messagesWritten field value
    • setBytesRead

      public void setBytesRead(Uint64 bytesRead)
      Value of the bytesRead field.
      Parameters:
      bytesRead - the bytesRead field value
    • setBytesWritten

      public void setBytesWritten(Uint64 bytesWritten)
      Value of the bytesWritten field.
      Parameters:
      bytesWritten - the bytesWritten field value
    • setSecondsConnected

      public void setSecondsConnected(Uint64 secondsConnected)
      Value of the secondsConnected field.
      Parameters:
      secondsConnected - the secondsConnected field value
    • setUniqueFloodBytesRecv

      public void setUniqueFloodBytesRecv(Uint64 uniqueFloodBytesRecv)
      Value of the uniqueFloodBytesRecv field.
      Parameters:
      uniqueFloodBytesRecv - the uniqueFloodBytesRecv field value
    • setDuplicateFloodBytesRecv

      public void setDuplicateFloodBytesRecv(Uint64 duplicateFloodBytesRecv)
      Value of the duplicateFloodBytesRecv field.
      Parameters:
      duplicateFloodBytesRecv - the duplicateFloodBytesRecv field value
    • setUniqueFetchBytesRecv

      public void setUniqueFetchBytesRecv(Uint64 uniqueFetchBytesRecv)
      Value of the uniqueFetchBytesRecv field.
      Parameters:
      uniqueFetchBytesRecv - the uniqueFetchBytesRecv field value
    • setDuplicateFetchBytesRecv

      public void setDuplicateFetchBytesRecv(Uint64 duplicateFetchBytesRecv)
      Value of the duplicateFetchBytesRecv field.
      Parameters:
      duplicateFetchBytesRecv - the duplicateFetchBytesRecv field value
    • setUniqueFloodMessageRecv

      public void setUniqueFloodMessageRecv(Uint64 uniqueFloodMessageRecv)
      Value of the uniqueFloodMessageRecv field.
      Parameters:
      uniqueFloodMessageRecv - the uniqueFloodMessageRecv field value
    • setDuplicateFloodMessageRecv

      public void setDuplicateFloodMessageRecv(Uint64 duplicateFloodMessageRecv)
      Value of the duplicateFloodMessageRecv field.
      Parameters:
      duplicateFloodMessageRecv - the duplicateFloodMessageRecv field value
    • setUniqueFetchMessageRecv

      public void setUniqueFetchMessageRecv(Uint64 uniqueFetchMessageRecv)
      Value of the uniqueFetchMessageRecv field.
      Parameters:
      uniqueFetchMessageRecv - the uniqueFetchMessageRecv field value
    • setDuplicateFetchMessageRecv

      public void setDuplicateFetchMessageRecv(Uint64 duplicateFetchMessageRecv)
      Value of the duplicateFetchMessageRecv field.
      Parameters:
      duplicateFetchMessageRecv - the duplicateFetchMessageRecv field value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object