package org.owasp.appsensor.analysis;

import javax.inject.Inject;
import javax.inject.Named;

import org.owasp.appsensor.AppSensorClient;
import org.owasp.appsensor.Response;
import org.owasp.appsensor.logging.Loggable;
import org.owasp.appsensor.response.ResponseHandler;
import org.owasp.appsensor.storage.ResponseStore;
import org.slf4j.Logger;

/**
 * This is a reference {@link Response} analysis engine, 
 * and is an implementation of the Observer pattern. 
 * 
 * It is notified with implementations of the {@link Response} class.
 * 
 * The implementation is trivial and simply delegates the work to the configured 
 * {@link ResponseHandler} for processing.
 * 
 * @author John Melton (jtmelton@gmail.com) http://www.jtmelton.com/
 */
@Named
@Loggable
public class ReferenceResponseAnalysisEngine extends ResponseAnalysisEngine {

	private Logger logger;
	
	@Inject
	private AppSensorClient appSensorClient;
	
	/**
	 * This method simply catches responses and calls the 
	 * configured {@link ResponseHandler} to process them. 
	 * 
	 * @param response {@link Response} that has been added to the {@link ResponseStore}.
	 */
	@Override
	public void analyze(Response response) {
		if (response != null) {
			logger.info("Response executed for user <" + response.getUser().getUsername() + "> - executing response action " + response.getAction());
			
			appSensorClient.getResponseHandler().handle(response);
		}
	}
	
}

@@ -56,87 +56,15 @@
 ect.
-Inject;%0Aimport javax.inject.Named;%0A%0Aimport org.owasp.appsensor.AppSensorClient;
+Named;%0A
 %0Aimp
@@ -146,61 +146,8 @@
 le;%0A
-import org.owasp.appsensor.response.ResponseHandler;%0A
 impo
@@ -460,88 +460,33 @@
 ply 
-delegates the work to the configured %0A * %7B@link ResponseHandler%7D for processing.
+logs the %7B@link Response%7D
 %0A * 
@@ -686,177 +686,50 @@
 %0A%09%0A%09
-@Inject%0A%09private AppSensorClient appSensorClient;%0A%09%0A%09/**%0A%09 * This method simply catches responses and calls the %0A%09 * configured %7B@link ResponseHandler%7D to process them. 
+/**%0A%09 * This method simply logs responses.
 %0A%09 *
@@ -917,16 +917,22 @@
 r.info(%22
+NO-OP 
 Response
@@ -936,17 +936,8 @@
 nse 
-executed 
 for 
@@ -985,16 +985,26 @@
 ) + %22%3E -
+ should be
  executi
@@ -1053,70 +1053,8 @@
 ));%0A
-%09%09%09%0A%09%09%09appSensorClient.getResponseHandler().handle(response);%0A
 %09%09%7D%0A

Remove execution of response from analysis engine. This should be done client-side, not server side.