Switching to new smart-executor-api

feature/19116
Luca Frosini 4 years ago
parent cb7e899211
commit 232398202c

@ -0,0 +1,4 @@
groupId=${groupId}
artifactId=${artifactId}
version=${version}
description=${description}

@ -14,7 +14,7 @@ import org.slf4j.LoggerFactory;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public class ISExporterPlugin extends Plugin<ISExporterPluginDeclaration> {
public class ISExporterPlugin extends Plugin {
/**
* Logger
@ -24,9 +24,9 @@ public class ISExporterPlugin extends Plugin<ISExporterPluginDeclaration> {
public static final String FILTERED_REPORT = "FILTERED_REPORT";
public static final String STATISTICS = "STATISTICS";
public ISExporterPlugin(ISExporterPluginDeclaration pluginDeclaration) {
super(pluginDeclaration);
logger.debug("contructor");
public ISExporterPlugin() {
super();
logger.debug("{} contructor", this.getClass().getSimpleName());
}
/**{@inheritDoc}*/
@ -36,7 +36,7 @@ public class ISExporterPlugin extends Plugin<ISExporterPluginDeclaration> {
AuthorizationEntry authorizationEntry = Constants.authorizationService().get(token);
String scope = authorizationEntry.getContext();
logger.info("Launching {} execution on scope {}",
ISExporterPluginDeclaration.NAME, scope);
this.getName(), scope);
boolean filteredReport = false;
@ -61,7 +61,7 @@ public class ISExporterPlugin extends Plugin<ISExporterPluginDeclaration> {
ServiceEndpointExporter serviceEndpointExporter = new ServiceEndpointExporter(filteredReport, statistics);
serviceEndpointExporter.export();
logger.info("{} execution finished", ISExporterPluginDeclaration.NAME);
logger.info("{} execution finished", this.getName());
}
/**{@inheritDoc}*/

@ -1,69 +0,0 @@
/**
*
*/
package org.gcube.informationsystem.exporter;
import java.util.HashMap;
import java.util.Map;
import org.gcube.vremanagement.executor.plugin.Plugin;
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public class ISExporterPluginDeclaration implements PluginDeclaration {
/**
* Logger
*/
private static Logger logger = LoggerFactory.getLogger(ISExporterPlugin.class);
/**
* Plugin name used by the Executor to retrieve this class
*/
public static final String NAME = "ISExporter";
public static final String DESCRIPTION = "IS Exporter";
public static final String VERSION = "1.0.0";
/**{@inheritDoc}*/
@Override
public void init() {
logger.debug(String.format("%s initialized", ISExporterPlugin.class.getSimpleName()));
}
/**{@inheritDoc}*/
@Override
public String getName() {
return NAME;
}
/**{@inheritDoc}*/
@Override
public String getDescription() {
return DESCRIPTION;
}
/**{@inheritDoc}*/
@Override
public String getVersion() {
return VERSION;
}
/**{@inheritDoc}*/
@Override
public Map<String, String> getSupportedCapabilities() {
Map<String, String> discoveredCapabilities = new HashMap<String, String>();
// No capabilities to discover
return discoveredCapabilities;
}
/**{@inheritDoc}*/
@Override
public Class<? extends Plugin<? extends PluginDeclaration>> getPluginImplementation() {
return ISExporterPlugin.class;
}
}

@ -0,0 +1 @@
org.gcube.informationsystem.exporter.ISExporterPlugin

@ -1 +0,0 @@
org.gcube.informationsystem.exporter.ISExporterPluginDeclaration

@ -24,7 +24,7 @@ public class ISExporterPluginTest {
logger.info("\n\n\n-------------------------------------------------------------------------");
ContextTest.setContextByName(context);
ISExporterPlugin isExporterPlugin = new ISExporterPlugin(new ISExporterPluginDeclaration());
ISExporterPlugin isExporterPlugin = new ISExporterPlugin();
Map<String,Object> inputs = new HashMap<String,Object>();
inputs.put(ISExporterPlugin.FILTERED_REPORT, true);
inputs.put(ISExporterPlugin.STATISTICS, false);

Loading…
Cancel
Save