Class TcpTimeoutsImpl

  • All Implemented Interfaces:
    TcpTimeouts

    public class TcpTimeoutsImpl
    extends java.lang.Object
    implements TcpTimeouts
    • Field Detail

      • initial_time_to_wait

        private final int initial_time_to_wait
      • max_time_to_wait

        private final int max_time_to_wait
      • backoff_factor

        private int backoff_factor
      • max_single_wait_time

        private final int max_single_wait_time
    • Constructor Detail

      • TcpTimeoutsImpl

        public TcpTimeoutsImpl​(java.lang.String args)
      • TcpTimeoutsImpl

        public TcpTimeoutsImpl​(int initial_time,
                               int max_time,
                               int backoff_percent)
      • TcpTimeoutsImpl

        public TcpTimeoutsImpl​(int initial_time,
                               int max_time,
                               int backoff_percent,
                               int max_single_wait_time)
    • Method Detail

      • setBackoffFactor

        private void setBackoffFactor​(int backoff_percent)
      • parseArg

        private int parseArg​(java.lang.String name,
                             java.lang.String value)
      • get_initial_time_to_wait

        public int get_initial_time_to_wait()
        Description copied from interface: TcpTimeouts
        Return the initial time to wait on the first getTime or sleepTime call on a new Waiter instance.
        Specified by:
        get_initial_time_to_wait in interface TcpTimeouts
        Returns:
        time in milliseconds
      • get_max_time_to_wait

        public int get_max_time_to_wait()
        Description copied from interface: TcpTimeouts
        Get the maximum total time a Waiter can exist before isExpired returns true. -1 if not used for this TcpTimeouts instances.
        Specified by:
        get_max_time_to_wait in interface TcpTimeouts
        Returns:
        time in milliseconds
      • get_backoff_factor

        public int get_backoff_factor()
        Description copied from interface: TcpTimeouts
        Return the backoff factor, which is the percentage multiplier used to compute the next timeout in the Waiter.advance method.
        Specified by:
        get_backoff_factor in interface TcpTimeouts
        Returns:
        percentage multiplier
      • get_max_single_wait_time

        public int get_max_single_wait_time()
        Description copied from interface: TcpTimeouts
        Get the maximum time a single sleepTime or getTime can taoke or return in an instance of Waiter. -1 if not used.
        Specified by:
        get_max_single_wait_time in interface TcpTimeouts
        Returns:
        time in milliseconds
      • waiter

        public TcpTimeouts.Waiter waiter()
        Description copied from interface: TcpTimeouts
        Return a Waiter that can be used for computing a series of timeouts.
        Specified by:
        waiter in interface TcpTimeouts
        Returns:
        Waiter for timeouts
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object