Package com.iplanet.services.naming
Class WebtopNaming.SiteMonitor
- java.lang.Object
-
- com.sun.identity.common.GeneralTaskRunnable
-
- com.iplanet.services.naming.WebtopNaming.SiteMonitor
-
- All Implemented Interfaces:
TaskRunnable,Runnable
- Enclosing class:
- WebtopNaming
public static class WebtopNaming.SiteMonitor extends GeneralTaskRunnable
TheSiteMonitorclass is used to monitor the health status of all the sites.
-
-
Field Summary
Fields Modifier and Type Field Description static booleankeepMonitoringA boolean flag indicating whether site monitoring is enabled.-
Fields inherited from class com.sun.identity.common.GeneralTaskRunnable
headTask, nextTask, previousTask
-
-
Constructor Summary
Constructors Constructor Description SiteMonitor(String[] urlList)Constructs a WebtopNaming$SiteMonitor object with the provided site urls.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddElement(Object obj)Adds an element to this TaskRunnable.static booleancheckSiteStatus(URL siteurl)Checks if the site is up.longgetRunPeriod()Returns the run period of this TaskRunnable.static booleanisAvailable(URL url)Checks if the site of the url is up.static booleanisCurrentSite(URL url)Checks if the url is one of configured sites.booleanisEmpty()Indicates whether this TaskRunnable is empty.booleanremoveElement(Object obj)Removes an element from this TaskRunnable.voidrun()-
Methods inherited from class com.sun.identity.common.GeneralTaskRunnable
cancel, getHeadTask, isScheduled, next, previous, scheduledExecutionTime, setHeadTask, setNext, setPrevious
-
-
-
-
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:TaskRunnableAdds 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:TaskRunnableRemoves 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:TaskRunnableIndicates whether this TaskRunnable is empty.- Returns:
- A boolean to indicate whether this TaskRunnable is empty
-
getRunPeriod
public long getRunPeriod()
Description copied from interface:TaskRunnableReturns 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:
trueif 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:
trueif the site is up- Throws:
Exception- if failing to get the naming service url.
-
-