public class DiagnosticsHandler
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
static interface |
DiagnosticsHandler.ProbeHandler |
Modifier and Type | Field and Description |
---|---|
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 TP |
transport |
protected int |
ttl |
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
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) |
protected java.lang.String |
defaultHeaders() |
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 boolean |
sameCluster(java.lang.String req) |
protected void |
sendResponse(java.net.DatagramSocket sock,
java.net.SocketAddress sender,
byte[] buf) |
void |
start() |
void |
stop() |
TP |
transport() |
DiagnosticsHandler |
transport(TP tp) |
void |
unregisterProbeHandler(DiagnosticsHandler.ProbeHandler handler) |
public static final java.lang.String THREAD_NAME
protected TP transport
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 TP transport()
public DiagnosticsHandler transport(TP tp)
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
in interface java.lang.Runnable
protected void handleDiagnosticProbe(java.net.SocketAddress sender, java.net.DatagramSocket sock, java.lang.String request)
protected java.lang.String defaultHeaders()
protected boolean sameCluster(java.lang.String req)
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 void sendResponse(java.net.DatagramSocket sock, java.net.SocketAddress sender, byte[] buf)
protected void bindToInterfaces(java.util.List<java.net.NetworkInterface> interfaces, java.net.MulticastSocket s)
protected boolean isAuthorizationRequired()
Copyright © 1998-2020 Red Hat. All Rights Reserved.