protected void handshakeMessageReceived ( IoSession session , HandshakeMessage handshakeMessage ) { log . debug ( "Received {}" , handshakeMessage ) ; this . receivedHandshake = handshakeMessage ; Boolean handshakeCheck = this . checkHandshake ( ) ; if ( handshakeCheck == null ) { return ; } if ( Boolean . TRUE . equals ( handshakeCheck ) ) { this . canSendSamples = true ; for ( ConnectionListener listener : this . connectionListeners ) { listener . readyForSamples ( this ) ; } } else if ( Boolean . FALSE . equals ( handshakeCheck ) ) { log . warn ( "Handshakes did not match." ) ; this . _disconnect ( ) ; } }
Verifies the received and notifies listeners if the connection is ready to send samples . If the handshake was invalid disconnects from the aggregator .