public void run ( ) { ResponseWrapper response = null ; LOGGER . info ( "Received probe id: " + probe . getProbeId ( ) ) ; // Only handle probes that we haven't handled before // The Probe Generator needs to send a stream of identical UDP packets // to compensate for UDP reliability issues. Therefore, the Responder // will likely get more than 1 identical probe. We should ignore // duplicates. if ( ! isProbeHandled ( probe . getProbeId ( ) ) ) { if ( this . noBrowser && probe . isNaked ( ) ) { LOGGER . warn ( "Responder set to noBrowser mode. Discarding naked probe with id [" + probe . getProbeId ( ) + "]" ) ; } else { for ( ProbeHandlerPlugin handler : handlers ) { response = handler . handleProbeEvent ( probe ) ; if ( ! response . isEmpty ( ) ) { LOGGER . debug ( "Response to probe [" + probe . getProbeId ( ) + "] includes " + response . numberOfServices ( ) ) ; Iterator < RespondToURL > respondToURLs = probe . getRespondToURLs ( ) . iterator ( ) ; if ( probe . getRespondToURLs ( ) . isEmpty ( ) ) LOGGER . warn ( "Processed probe [" + probe . getProbeId ( ) + "] with no respondTo address. That's odd." ) ; if ( respondToURLs . hasNext ( ) ) { RespondToURL respondToURL = respondToURLs . next ( ) ; // we are ignoring the label for now boolean success = sendResponse ( respondToURL . url , probe . getRespondToPayloadType ( ) , response ) ; if ( ! success ) { LOGGER . warn ( "Issue sending probe [" + probe . getProbeId ( ) + "] response to [" + respondToURL . url + "]" ) ; } } } else { LOGGER . error ( "Response to probe [" + probe . getProbeId ( ) + "] is empty. Not sending empty response." ) ; } } } markProbeAsHandled ( probe . getProbeId ( ) ) ; responder . probeProcessed ( ) ; } else { LOGGER . info ( "Discarding duplicate/handled probe with id: " + probe . getProbeId ( ) ) ; } }
Handle the probe .