void pluginCompleted ( Plugin plugin ) { PluginStats pluginStats = mapPluginStats . get ( plugin . getId ( ) ) ; if ( pluginStats == null ) { // Plugin was not processed return ; } StringBuilder sb = new StringBuilder ( ) ; if ( isStop ( ) ) { sb . append ( "stopped host/plugin " ) ; // ZAP: added skipping notifications } else if ( pluginStats . isSkipped ( ) ) { sb . append ( "skipped plugin " ) ; String reason = pluginStats . getSkippedReason ( ) ; if ( reason != null ) { sb . append ( ' ' ) . append ( reason ) . append ( "] " ) ; } } else { sb . append ( "completed host/plugin " ) ; } sb . append ( hostAndPort ) . append ( " | " ) . append ( plugin . getCodeName ( ) ) ; long startTimeMillis = pluginStats . getStartTime ( ) ; long diffTimeMillis = System . currentTimeMillis ( ) - startTimeMillis ; String diffTimeString = decimalFormat . format ( diffTimeMillis / 1000.0 ) ; sb . append ( " in " ) . append ( diffTimeString ) . append ( ' ' ) ; sb . append ( " with " ) . append ( pluginStats . getMessageCount ( ) ) . append ( " message(s) sent" ) ; sb . append ( " and " ) . append ( pluginStats . getAlertCount ( ) ) . append ( " alert(s) raised." ) ; // Probably too verbose evaluate 4 the future log . info ( sb . toString ( ) ) ; pluginFactory . setRunningPluginCompleted ( plugin ) ; notifyHostProgress ( null ) ; // ZAP: update progress as finished pluginStats . setProgress ( nodeInScopeCount ) ; }
Complete the current plugin and update statistics