Package domain

Class Monitor


  • public class Monitor
    extends java.lang.Object
    Author:
    Vincent Lammens (vincent@vincentlammens.be)
    • Constructor Summary

      Constructors 
      Constructor Description
      Monitor​(java.lang.String name, java.lang.String ip)
      Constructs a monitor
      Monitor​(java.lang.String name, java.lang.String ip, boolean isOnline)
      Constructs a monitor, with a initial status
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getIsOnline()
      Getter of the isOnline status
      java.lang.String getName()
      Getter for the name
      boolean pingMonitor()
      Method to ping the monitor
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 monitor
        ip - 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 monitor
        ip - A string with the ip (ipv4, ipv6 or FQDN) of the monitor
        isOnline - 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 class java.lang.Object