Class WebtopNaming.SiteMonitor

    • Field Detail

      • keepMonitoring

        public static boolean keepMonitoring
        A boolean flag indicating whether site monitoring is enabled.
    • Constructor Detail

      • SiteMonitor

        public SiteMonitor​(String[] urlList)
        Constructs a WebtopNaming$SiteMonitor object with the provided site urls.
        Parameters:
        urlList - a String containing the urls of the sites
    • Method Detail

      • addElement

        public boolean addElement​(Object obj)
        Description copied from interface: TaskRunnable
        Adds an element to this TaskRunnable.
        Parameters:
        obj - Element to be added to this TaskRunnable
        Returns:
        a boolean to indicate whether the add success
      • removeElement

        public boolean removeElement​(Object obj)
        Description copied from interface: TaskRunnable
        Removes an element from this TaskRunnable.
        Parameters:
        obj - Element to be removed from this TaskRunnable
        Returns:
        A boolean to indicate whether the remove success
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: TaskRunnable
        Indicates whether this TaskRunnable is empty.
        Returns:
        A boolean to indicate whether this TaskRunnable is empty
      • getRunPeriod

        public long getRunPeriod()
        Description copied from interface: TaskRunnable
        Returns the run period of this TaskRunnable.
        Returns:
        A long value to indicate the run period
      • run

        public void run()
      • checkSiteStatus

        public static boolean checkSiteStatus​(URL siteurl)
        Checks if the site is up.
        Parameters:
        siteurl - a site url
        Returns:
        true if the site is up
      • isAvailable

        public static boolean isAvailable​(URL url)
                                   throws Exception
        Checks if the site of the url is up.
        Parameters:
        url - a site url
        Returns:
        true if the site is up
        Throws:
        Exception - if failing to get the naming service url.
      • isCurrentSite

        public static boolean isCurrentSite​(URL url)
                                     throws Exception
        Checks if the url is one of configured sites.
        Parameters:
        url - a site url
        Returns:
        true if the url is one of configured sites.
        Throws:
        Exception - if failing to get the naming service url.