public final class NetTimeProbe extends Object
The probe shells out to whatever the operating system already exposes – it never requires administrator, root or sudo, never changes any system setting, and silently contributes nothing from a source it cannot read. Whatever candidates it gathers are then both syntactically validated and verified live: a candidate is kept only if an actual SNTP query to it succeeds, so the returned list contains working servers, not merely plausible names. The class deliberately exposes no operating-system specifics in its API.
All work here performs blocking process execution and network I/O, so it must be called from a background thread, never inline on a request or start-up path.
(C) Copyright 2026 Mindus SARL. All rights reserved.
| Modifier and Type | Method and Description |
|---|---|
static String[] | discover(int queryTimeoutMs, BooleanSupplier cancelled)Discovers and live-verifies the host's network time source(s). |
public static String[] discover(int queryTimeoutMs, BooleanSupplier cancelled)
Gathers candidates from the operating system, then keeps only those that are syntactically valid and answer an SNTP query within the given timeout. The result is de-duplicated in discovery order and may be empty.
queryTimeoutMs - The per-query SNTP timeout, in milliseconds (must be > 0).cancelled - An optional cooperative-cancel check, polled before gathering and between candidates; when it returns true the probe stops early and returns whatever it has verified so far. May be null (never cancels).Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© 2026 Mindus SARL. All rights reserved.