Class IPPollAddress

  • All Implemented Interfaces:
    java.io.Serializable

    public class IPPollAddress
    extends java.lang.Object
    implements java.io.Serializable

    This class is used to represent the polling information needed by the discovery process. Each instance encapsulates an internet address, timeout in milliseconds, and a retry count.

    Author:
    Sowmya , Brian Weaver
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      IPPollAddress​(java.lang.String foreignSource, java.lang.String location, java.net.InetAddress ipAddress, long timeout, int retries)
      Constructs an IPPollAddress object with the specified parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)
      Returns true if the passed object is equal to self.
      java.net.InetAddress getAddress()
      Returns the internet address encapsulated in the object.
      java.lang.String getForeignSource()
      Foreign source where this address should be persisted.
      java.lang.String getLocation()
      Network location of this address.
      int getRetries()
      Returns the current number of retries set for this address.
      long getTimeout()
      Returns the timeout in 1/1000th of a second increments.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • IPPollAddress

        public IPPollAddress​(java.lang.String foreignSource,
                             java.lang.String location,
                             java.net.InetAddress ipAddress,
                             long timeout,
                             int retries)

        Constructs an IPPollAddress object with the specified parameters.

        Parameters:
        ipAddress - The Dotted Decimal IPv4 Address.
        timeout - The timeout between retries in 1/1000th of a second.
        retries - The number of times to attempt to contact the address.
    • Method Detail

      • getForeignSource

        public java.lang.String getForeignSource()
        Foreign source where this address should be persisted.
      • getLocation

        public java.lang.String getLocation()
        Network location of this address.
      • getTimeout

        public long getTimeout()

        Returns the timeout in 1/1000th of a second increments.

        Returns:
        The timeout associated with the host in 1/1000th of a second.
      • getRetries

        public int getRetries()

        Returns the current number of retries set for this address.

        Returns:
        The retry count for the instance.
      • getAddress

        public java.net.InetAddress getAddress()
        Returns the internet address encapsulated in the object.
        Returns:
        The encapsulated internet address.
      • equals

        public boolean equals​(java.lang.Object object)

        Returns true if the passed object is equal to self. The objects must be equal in address, timeout, and the number of retries.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        pollAddr - a IPPollAddress object.
        Returns:
        True if the objects are logically equal. False is returned otherwise.
      • toString

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