Switched to new APIs which removed the PluginDeclaration class

This commit is contained in:
Luca Frosini 2020-09-30 11:23:37 +02:00
parent 6206a091f4
commit 8bf985b124
3 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@ import java.util.List;
import java.util.UUID;
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
import org.gcube.vremanagement.executor.plugin.PluginDefinition;
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
@ -15,7 +15,7 @@ public interface SmartExecutorClient {
public String getAvailablePlugins();
public List<PluginDeclaration> getPlugins() throws IOException;
public List<PluginDefinition> getPlugins() throws IOException;
public String getLaunches();

View File

@ -21,7 +21,7 @@ import org.gcube.vremanagement.executor.api.rest.RestConstants;
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
import org.gcube.vremanagement.executor.exception.ExecutorException;
import org.gcube.vremanagement.executor.json.SEMapper;
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
import org.gcube.vremanagement.executor.plugin.PluginDefinition;
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
import org.slf4j.Logger;
@ -147,9 +147,9 @@ public class SmartExecutorClientImpl implements SmartExecutorClient {
}
@Override
public List<PluginDeclaration> getPlugins() throws IOException {
public List<PluginDefinition> getPlugins() throws IOException {
String pluginList = getAvailablePlugins();
return SEMapper.getInstance().unmarshalList(PluginDeclaration.class,pluginList);
return SEMapper.getInstance().unmarshalList(PluginDefinition.class,pluginList);
}
private String getScheduledTask(String name) {

View File

@ -10,7 +10,7 @@ import java.util.concurrent.TimeUnit;
import org.gcube.vremanagement.executor.api.types.LaunchParameter;
import org.gcube.vremanagement.executor.api.types.Scheduling;
import org.gcube.vremanagement.executor.client.query.Discover;
import org.gcube.vremanagement.executor.plugin.PluginDeclaration;
import org.gcube.vremanagement.executor.plugin.PluginDefinition;
import org.gcube.vremanagement.executor.plugin.PluginStateEvolution;
import org.gcube.vremanagement.executor.plugin.ScheduledTask;
import org.gcube.vremanagement.helloworld.HelloWorldPlugin;
@ -68,9 +68,9 @@ public class SmartExecutorClientTest extends ContextTest {
String host = smartExecutorClient.getHost();
Assert.assertTrue(host.contains("pc-frosini.isti.cnr.it"));
List<PluginDeclaration> plugins = smartExecutorClient.getPlugins();
List<PluginDefinition> plugins = smartExecutorClient.getPlugins();
Assert.assertTrue(plugins.size() == 1);
PluginDeclaration pluginDeclaration = plugins.get(0);
PluginDefinition pluginDeclaration = plugins.get(0);
Assert.assertTrue(pluginDeclaration.getName().compareTo(helloWorldPluginDeclaration.getName()) == 0);
Assert.assertTrue(
@ -118,8 +118,8 @@ public class SmartExecutorClientTest extends ContextTest {
logger.debug("Host {}", SmartExecutorClientImpl.getHostFromCompleteURL(host));
SmartExecutorClientImpl client = new SmartExecutorClientImpl();
client.setAddress(host);
List<PluginDeclaration> plugins = client.getPlugins();
for(PluginDeclaration p : plugins) {
List<PluginDefinition> plugins = client.getPlugins();
for(PluginDefinition p : plugins) {
logger.debug("\tPlugin {}", p);
client.setPluginName(p.getName());
List<ScheduledTask> tasks = client.getScheduledLaunches();