java.lang.Object
net.i2p.addressbook.HostCheckerBridge
Bridge class to provide static access to HostChecker functionality for JSP pages This avoids reflection issues and provides a clean interface.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static HostCheckerThe shared checker, created on first use.private static final ObjectGuards creating and replacing the checker.Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionstatic Map<String, HostChecker.PingResult> Get all current ping results.static StringgetCategoryDescription(String category) Get description for a category.static HostCheckerGet singleton HostChecker instance This should be set by Daemon.java to avoid duplicate instances.static booleanWhether a host check cycle is currently in progress.Ping a single host and return as result as a Map.static voidRun a host check cycle immediately, unless one is already running.static voidsetInstance(HostChecker checker) Set HostChecker instance (should be called by Daemon.java).static voidStart periodic ping checking.static voidStop periodic ping checking.
Field Details
hostChecker
The shared checker, created on first use.lock
Guards creating and replacing the checker.
Constructor Details
HostCheckerBridge
public HostCheckerBridge()Constructor. The checker is held in a static field set by Daemon, so an instance carries no state of its own.
Method Details
getInstance
Get singleton HostChecker instance This should be set by Daemon.java to avoid duplicate instances.- Returns:
- the shared HostChecker, or null before Daemon sets it
setInstance
Set HostChecker instance (should be called by Daemon.java).- Parameters:
checker- the shared HostChecker that addressbook calls will ping through
ping
getAllPingResults
Get all current ping results.- Returns:
- Map of all ping results
startPeriodicChecking
public static void startPeriodicChecking()Start periodic ping checking.stopPeriodicChecking
public static void stopPeriodicChecking()Stop periodic ping checking.runCheckNow
public static void runCheckNow()Run a host check cycle immediately, unless one is already running.isScanRunning
public static boolean isScanRunning()Whether a host check cycle is currently in progress.- Returns:
- true if a cycle is running
getCategoryDescription