Package domain
Class Monitor
- java.lang.Object
-
- domain.Monitor
-
public class Monitor extends java.lang.Object
- Author:
- Vincent Lammens (vincent@vincentlammens.be)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getIsOnline()
Getter of the isOnline statusjava.lang.String
getName()
Getter for the nameboolean
pingMonitor()
Method to ping the monitorjava.lang.String
toString()
-
-
-
Constructor Detail
-
Monitor
public Monitor(java.lang.String name, java.lang.String ip) throws java.net.UnknownHostException
Constructs a monitor- Parameters:
name
- The name of the monitorip
- A string with the ip (ipv4,ipv6 or FQDN) of the monitor- Throws:
java.net.UnknownHostException
-
Monitor
public Monitor(java.lang.String name, java.lang.String ip, boolean isOnline) throws java.net.UnknownHostException
Constructs a monitor, with a initial status- Parameters:
name
- The name of the monitorip
- A string with the ip (ipv4, ipv6 or FQDN) of the monitorisOnline
- the status of the monitor on creation- Throws:
java.net.UnknownHostException
-
-
Method Detail
-
getName
public java.lang.String getName()
Getter for the name- Returns:
- Name of the monitor
-
getIsOnline
public boolean getIsOnline()
Getter of the isOnline status- Returns:
- Status of the monitor
-
pingMonitor
public boolean pingMonitor() throws java.io.IOException
Method to ping the monitor- Returns:
- the result of the ping.
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-