Class HostEntry
- java.lang.Object
-
- dk.netarkivet.common.distribute.monitorregistry.HostEntry
-
- All Implemented Interfaces:
Serializable
public class HostEntry extends Object implements Serializable
Helper class to encapsulate information about one remote JmxConnection.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Return whether two hosts are equal.int
getJmxPort()
Get the JMX port for connections.String
getName()
Get the host name.int
getRmiPort()
Get the RMI port for connections.Date
getTime()
Get the time this host was last seen alive.int
hashCode()
Return hash code.void
setTime(Date time)
Update the time for when the host was last seen alive.String
toString()
Get a human readable representation of this host and ports.
-
-
-
Constructor Detail
-
HostEntry
public HostEntry(String name, int jmxPort, int rmiPort)
Constructor for the HostEntry helper class.- Parameters:
name
- The name of the remote hostjmxPort
- The JMX port allocated on the remote hostrmiPort
- The RMI port allocated on the remote host
-
-
Method Detail
-
getJmxPort
public int getJmxPort()
Get the JMX port for connections.- Returns:
- The jmx port.
-
getName
public String getName()
Get the host name.- Returns:
- The name.
-
getRmiPort
public int getRmiPort()
Get the RMI port for connections.- Returns:
- The rmi port.
-
getTime
public Date getTime()
Get the time this host was last seen alive.- Returns:
- The time this host was last seen alive.
-
equals
public boolean equals(Object obj)
Return whether two hosts are equal.Two hosts are considered equal, if they have the same name and JMX/RMI ports. However, the time last seen alive is not, and should not be, considered.
- Overrides:
equals
in classObject
- Parameters:
obj
- The host to compare with.- Returns:
- Whether the two objects represent the same host.
- See Also:
Object.equals(Object)
-
hashCode
public int hashCode()
Return hash code. Coded to be consistent with equals.- Overrides:
hashCode
in classObject
- Returns:
- Hash code for this object.
- See Also:
Object.hashCode()
-
toString
public String toString()
Get a human readable representation of this host and ports.
-
setTime
public void setTime(Date time)
Update the time for when the host was last seen alive.- Parameters:
time
- The time last seen alive.- Throws:
ArgumentNotValid
- on null parameter.
-
-