Class DiscoveredService

java.lang.Object
org.apache.commons.jcs3.utils.discovery.DiscoveredService
All Implemented Interfaces:
Serializable

public class DiscoveredService extends Object implements Serializable
This contains info about a discovered service. These objects are stored in a set in the UDPDiscoveryService.
See Also:
  • Constructor Details

  • Method Details

    • setCacheNames

      public void setCacheNames(ArrayList<String> cacheNames)
      Parameters:
      cacheNames - the cacheNames to set
    • getCacheNames

      Returns:
      the cacheNames
    • setServiceAddress

      public void setServiceAddress(String serviceAddress)
      Parameters:
      serviceAddress - The serviceAddress to set.
    • getServiceAddress

      Returns:
      Returns the serviceAddress.
    • setServicePort

      public void setServicePort(int servicePort)
      Parameters:
      servicePort - The servicePort to set.
    • getServicePort

      public int getServicePort()
      Returns:
      Returns the servicePort.
    • setLastHearFromTime

      public void setLastHearFromTime(long lastHearFromTime)
      Parameters:
      lastHearFromTime - The lastHearFromTime to set.
    • getLastHearFromTime

      public long getLastHearFromTime()
      Returns:
      Returns the lastHearFromTime.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      hash code based on address/port
    • equals

      public boolean equals(Object otherArg)
      NOTE - this object is often put into sets, so equals needs to be overridden.

      We can't use cache names as part of the equals unless we manually only use the address and port in a contains check. So that we can use normal set functionality, I've kept the cache names out.

      Overrides:
      equals in class Object
      Parameters:
      otherArg - other
      Returns:
      equality based on the address/port
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      string for debugging purposes.