@@ -0,0 +1,2097 @@
+package REST.moduleResultEndpoint;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.json.JSONObject;%0A%0Aimport com.mashape.unirest.http.HttpResponse;%0Aimport com.mashape.unirest.http.JsonNode;%0A%0Aimport strategy.RESTStrategy;%0A%0Apublic class HotspotMetricResults extends RESTStrategy %7B%0A%09private String repositoryId;%0A%09private int root_module_result_id;%0A%0A%09@Override%0A%09public void beforeExperiment() throws Exception %7B%0A%09%09HashMap%3CString, HashMap%3CString, String%3E%3E parameters = new HashMap%3CString, HashMap%3CString, String%3E%3E();%0A%09%09HashMap%3CString, String%3E repository = new HashMap%3CString, String%3E();%0A%09%09parameters.put(%22repository%22, repository);%0A%09%09repository.put(%22address%22, %22svn://svn.code.sf.net/p/qt-calculator/code/trunk%22);%0A%09%09repository.put(%22name%22, %22name%22);%0A%09%09repository.put(%22scm_type%22, %22SVN%22);%0A%09%09repository.put(%22kalibro_configuration_id%22, %221%22);%0A%09%09JSONObject jsonBody = new JSONObject(parameters);%0A%09%09HttpResponse%3CJsonNode%3E response = post(buildUrl(REPOSITORY_PATH), jsonBody);%0A%09%09repositoryId = ((JSONObject) (response.getBody().getObject().get(%22repository%22))).get(%22id%22).toString();%0A%0A%09%09get(buildUrl(REPOSITORY_PATH + %22/%22 + repositoryId + %22/process%22));%0A%0A%09%09boolean hasReadyProcessing;%0A%09%09do %7B%0A%09%09%09Thread.sleep(1000);%0A%09%09%09hasReadyProcessing = get(buildUrl(REPOSITORY_PATH + %22/%22 + repositoryId + %22/has_ready_processing%22))%0A%09%09%09%09%09.getBody().getObject().getBoolean(%22has_ready_processing%22);%0A%09%09%7D while(!hasReadyProcessing);%0A%09%09%0A%09%09HttpResponse%3CJsonNode%3E last_processing = get(buildUrl(REPOSITORY_PATH + %22/%22 + repositoryId + %22/last_ready_processing%22));%0A%09%09root_module_result_id = last_processing.getBody().getObject().getJSONObject(%22last_ready_processing%22).getInt(%22root_module_result_id%22);%0A%09%7D%0A%0A%09@Override%0A%09public String request(String string) throws Exception %7B%0A%09%09get(buildUrl(MODULE_RESULT_PATH + %22/%22 + root_module_result_id + %22/hotspot_metric_results%22));%0A%09%09return repositoryId;%0A%09%7D%0A%0A%09@Override%0A%09public void afterExperiment() throws Exception %7B%0A%09%09delete(buildUrl(REPOSITORY_PATH + %22/%22 + repositoryId));%0A%09%7D%0A%0A%09@Override%0A%09public void configure(Map%3CObject, Object%3E options) %7B%0A%09%09configure(options, %22kalibro_processor%22);%0A%09%7D%0A%7D%0A

Add ModuleResult#hotspot_metric_results experiment