Update POMAnalyzer with new interrface
package eu.fasten.analyzer.pomanalyzer;
+import eu.fasten.core.plugins.DBConnector;
import eu.fasten.core.plugins.KafkaPlugin;
+import org.jooq.DSLContext;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.File;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@@ -17,11 +20,12 @@ public class POMAnalyzerPlugin extends Plugin {
}
@Extension
- public static class POMAnalyzer implements KafkaPlugin<String, String> {
+ public static class POMAnalyzer implements KafkaPlugin, DBConnector {
private String consumerTopic = "fasten.maven.pkg";
private final Logger logger = LoggerFactory.getLogger(POMAnalyzer.class.getName());
private Throwable pluginError = null;
+ private static DSLContext dslContext;
@Override
public Optional<List<String>> consumeTopic() {
@@ -44,6 +48,11 @@ public class POMAnalyzerPlugin extends Plugin {
return Optional.empty();
}
+ @Override
+ public String getOutputPath() {
+ return File.separator + ""; // TODO: Change to actual output path
+ }
+
@Override
public String name() {
return "POM Analyzer plugin";
@@ -81,5 +90,10 @@ public class POMAnalyzerPlugin extends Plugin {
public void freeResource() {
}
+
+ @Override
+ public void setDBConnection(DSLContext dslContext) {
+ POMAnalyzer.dslContext = dslContext;
+ }
}
}
