public class HostChecker extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HostChecker.PingResult
Ping result data structure containing the outcome of a host reachability test.
|
| Constructor and Description |
|---|
HostChecker()
Construct a HostChecker that uses the default naming service
This works with the blockfile format (hostsdb.blockfile)
|
HostChecker(NamingService namingService)
Construct a HostChecker for given naming service
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getAllCategories()
Get all host categories
|
Map<String,HostChecker.PingResult> |
getAllPingResults()
Get all ping results
|
String |
getCategory(String hostname)
Get category for a hostname
|
String |
getCategoryDescription(String category)
Get description for a category
|
HostChecker.PingResult |
getPingResult(String hostname)
Get ping result for a hostname
|
boolean |
getUseLeaseSetCheck()
Get whether to use LeaseSet checking
|
boolean |
isDefensiveMode()
Get defensive mode status
|
boolean |
isRunning()
Check if ping tester is running
|
static void |
main(String[] args)
Test method
|
void |
setUseLeaseSetCheck(boolean useLeaseSetCheck)
Set whether to use LeaseSet checking
|
void |
start()
Start periodic ping testing
|
void |
stop()
Stop periodic ping testing
|
HostChecker.PingResult |
testDestination(String hostname)
Test a single destination immediately
If LeaseSet lookup succeeds, we don't overwrite the result with failed ping/eephead
|
public HostChecker()
public HostChecker(NamingService namingService)
namingService - naming service to test entries frompublic Map<String,HostChecker.PingResult> getAllPingResults()
public String getCategoryDescription(String category)
category - the category namepublic HostChecker.PingResult getPingResult(String hostname)
hostname - hostnamepublic boolean getUseLeaseSetCheck()
public boolean isDefensiveMode()
public boolean isRunning()
public void setUseLeaseSetCheck(boolean useLeaseSetCheck)
useLeaseSetCheck - true to use LeaseSet lookup firstpublic void start()
public void stop()
public HostChecker.PingResult testDestination(String hostname)
hostname - hostname to test