Class IpResponseTable

java.lang.Object
org.eblocker.server.common.network.IpResponseTable

public class IpResponseTable extends Object
This table stores the last time a hardware address has responded to a specific IP address (via ARP response or Neighbor Advertisement). Listeners can be notified if the latest timestamp for a specific hardware address has been updated. They are not notified more frequently than once per minute.
  • Constructor Details

    • IpResponseTable

      public IpResponseTable()
  • Method Details

    • get

      public Long get(String hardwareAddress, IpAddress ipAddress)
    • isEmpty

      public boolean isEmpty()
    • put

      public void put(String hardwareAddress, IpAddress sourceAddress, long millis)
    • activeSince

      public boolean activeSince(String hardwareAddress, long millis)
    • latestTimestamp

      public Long latestTimestamp(String hardwareAddress)
    • allActiveSince

      public Set<String> allActiveSince(long millis)
      Collects all hardware addresses that have active IP addresses since a given timestamp
      Parameters:
      millis - timestamp
      Returns:
      set of active hardware addresses
    • activeAddressesSince

      public Set<IpAddress> activeAddressesSince(String hardwareAddress, long millis)
      Returns all IP addresses of a given hardware address that have been active since a given timestamp.
      Parameters:
      hardwareAddress -
      millis - timestamp
      Returns:
      set of active IP addresses or null if the hardware address does not exist.
    • removeAll

      public void removeAll(String hardwareAddress, Collection<IpAddress> ipAddresses)
    • contains

      public boolean contains(String hardwareAddress, IpAddress ipAddress)
    • remove

      public void remove(String hardwareAddress)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addLatestTimestampUpdateListener

      public void addLatestTimestampUpdateListener(IpResponseTable.LatestTimestampUpdateListener listener)