Class HostEntry
- java.lang.Object
-
- dk.netarkivet.common.distribute.monitorregistry.HostEntry
-
- All Implemented Interfaces:
java.io.Serializable
public class HostEntry extends java.lang.Object implements java.io.Serializable
Helper class to encapsulate information about one remote JmxConnection.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HostEntry(java.lang.String name, int jmxPort, int rmiPort)
Constructor for the HostEntry helper class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Return whether two hosts are equal.int
getJmxPort()
Get the JMX port for connections.java.lang.String
getName()
Get the host name.int
getRmiPort()
Get the RMI port for connections.java.util.Date
getTime()
Get the time this host was last seen alive.int
hashCode()
Return hash code.void
setTime(java.util.Date time)
Update the time for when the host was last seen alive.java.lang.String
toString()
Get a human readable representation of this host and ports.
-
-
-
Constructor Detail
-
HostEntry
public HostEntry(java.lang.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 java.lang.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 java.util.Date getTime()
Get the time this host was last seen alive.- Returns:
- The time this host was last seen alive.
-
equals
public boolean equals(java.lang.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 classjava.lang.Object
- 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 classjava.lang.Object
- Returns:
- Hash code for this object.
- See Also:
Object.hashCode()
-
toString
public java.lang.String toString()
Get a human readable representation of this host and ports.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A human readable string.
-
setTime
public void setTime(java.util.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.
-
-