Class Pong


  • public class Pong
    extends java.lang.Object
    An answer from Ping.
    Author:
    Steinar Knutsen
    • Constructor Summary

      Constructors 
      Constructor Description
      Pong()  
      Pong​(long activeDocuments)  
      Pong​(com.yahoo.fs4.PongPacket pongPacket)  
      Pong​(ErrorMessage error)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.Long> activeDocuments()
      Returns the number of active documents in the backend responding in this Pong, if available
      java.util.Optional<java.lang.Integer> activeNodes()
      Returns the number of nodes which responded to this Pong, if available
      void addError​(ErrorMessage error)  
      boolean badResponse()
      Returns whether there is an error or not
      ElapsedTime getElapsedTime()  
      ErrorMessage getError​(int i)  
      java.util.List<ErrorMessage> getErrors()  
      int getErrorSize()  
      java.lang.String getPingInfo()
      Returns information about the ping use, or "" (never null) if none
      void setPingInfo​(java.lang.String pingInfo)
      Sets information about the ping used to produce this.
      java.lang.String toString()
      Returns a string which included the ping info (if any) and any errors added to this
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Pong

        public Pong()
      • Pong

        public Pong​(com.yahoo.fs4.PongPacket pongPacket)
      • Pong

        public Pong​(long activeDocuments)
    • Method Detail

      • getErrorSize

        public int getErrorSize()
      • activeDocuments

        public java.util.Optional<java.lang.Long> activeDocuments()
        Returns the number of active documents in the backend responding in this Pong, if available
      • activeNodes

        public java.util.Optional<java.lang.Integer> activeNodes()
        Returns the number of nodes which responded to this Pong, if available
      • getErrors

        public java.util.List<ErrorMessage> getErrors()
      • badResponse

        public boolean badResponse()
        Returns whether there is an error or not
      • setPingInfo

        public void setPingInfo​(java.lang.String pingInfo)
        Sets information about the ping used to produce this. This is included when returning the tostring of this.
      • getPingInfo

        public java.lang.String getPingInfo()
        Returns information about the ping use, or "" (never null) if none
      • toString

        public java.lang.String toString()
        Returns a string which included the ping info (if any) and any errors added to this
        Overrides:
        toString in class java.lang.Object