public class DiagnosticsHandler
extends java.lang.Object
implements java.lang.Runnable
限定符和类型 | 类和说明 |
---|---|
static interface |
DiagnosticsHandler.ProbeHandler |
限定符和类型 | 字段和说明 |
---|---|
protected java.util.List<java.net.NetworkInterface> |
bind_interfaces |
protected java.net.MulticastSocket |
diag_sock |
protected java.net.InetAddress |
diagnostics_addr |
protected int |
diagnostics_port |
protected java.util.Set<DiagnosticsHandler.ProbeHandler> |
handlers |
protected Log |
log |
protected java.lang.String |
passcode |
protected SocketFactory |
socket_factory |
protected java.lang.Thread |
thread |
protected ThreadFactory |
thread_factory |
static java.lang.String |
THREAD_NAME |
protected int |
ttl |
构造器和说明 |
---|
DiagnosticsHandler(java.net.InetAddress diagnostics_addr,
int diagnostics_port,
java.util.List<java.net.NetworkInterface> bind_interfaces,
int diagnostics_ttl,
Log log,
SocketFactory socket_factory,
ThreadFactory thread_factory,
java.lang.String passcode) |
DiagnosticsHandler(java.net.InetAddress diagnostics_addr,
int diagnostics_port,
Log log,
SocketFactory socket_factory,
ThreadFactory thread_factory) |
DiagnosticsHandler(java.net.InetAddress diagnostics_addr,
int diagnostics_port,
Log log,
SocketFactory socket_factory,
ThreadFactory thread_factory,
java.lang.String passcode) |
限定符和类型 | 方法和说明 |
---|---|
protected int |
authorizeProbeRequest(java.net.DatagramPacket packet)
Performs authorization on given DatagramPacket.
|
protected void |
bindToInterfaces(java.util.List<java.net.NetworkInterface> interfaces,
java.net.MulticastSocket s) |
java.util.Set<DiagnosticsHandler.ProbeHandler> |
getProbeHandlers() |
java.lang.Thread |
getThread() |
protected void |
handleDiagnosticProbe(java.net.SocketAddress sender,
java.net.DatagramSocket sock,
java.lang.String request) |
protected boolean |
isAuthorizationRequired() |
boolean |
isRunning() |
void |
registerProbeHandler(DiagnosticsHandler.ProbeHandler handler) |
void |
run() |
protected static void |
sendResponse(java.net.DatagramSocket sock,
java.net.SocketAddress sender,
byte[] buf) |
void |
start() |
void |
stop() |
void |
unregisterProbeHandler(DiagnosticsHandler.ProbeHandler handler) |
public static final java.lang.String THREAD_NAME
protected java.lang.Thread thread
protected java.net.MulticastSocket diag_sock
protected java.net.InetAddress diagnostics_addr
protected int diagnostics_port
protected int ttl
protected java.util.List<java.net.NetworkInterface> bind_interfaces
protected final java.util.Set<DiagnosticsHandler.ProbeHandler> handlers
protected final Log log
protected final SocketFactory socket_factory
protected final ThreadFactory thread_factory
protected final java.lang.String passcode
public DiagnosticsHandler(java.net.InetAddress diagnostics_addr, int diagnostics_port, Log log, SocketFactory socket_factory, ThreadFactory thread_factory)
public DiagnosticsHandler(java.net.InetAddress diagnostics_addr, int diagnostics_port, Log log, SocketFactory socket_factory, ThreadFactory thread_factory, java.lang.String passcode)
public DiagnosticsHandler(java.net.InetAddress diagnostics_addr, int diagnostics_port, java.util.List<java.net.NetworkInterface> bind_interfaces, int diagnostics_ttl, Log log, SocketFactory socket_factory, ThreadFactory thread_factory, java.lang.String passcode)
public java.lang.Thread getThread()
public java.util.Set<DiagnosticsHandler.ProbeHandler> getProbeHandlers()
public void registerProbeHandler(DiagnosticsHandler.ProbeHandler handler)
public void unregisterProbeHandler(DiagnosticsHandler.ProbeHandler handler)
public void start() throws java.io.IOException
java.io.IOException
public void stop()
public boolean isRunning()
public void run()
run
在接口中 java.lang.Runnable
protected void handleDiagnosticProbe(java.net.SocketAddress sender, java.net.DatagramSocket sock, java.lang.String request)
protected int authorizeProbeRequest(java.net.DatagramPacket packet) throws java.lang.Exception
packet
- to authorizejava.lang.Exception
- thrown if passcode received from client does not match set passcodeprotected static void sendResponse(java.net.DatagramSocket sock, java.net.SocketAddress sender, byte[] buf) throws java.io.IOException
java.io.IOException
protected void bindToInterfaces(java.util.List<java.net.NetworkInterface> interfaces, java.net.MulticastSocket s)
protected boolean isAuthorizationRequired()