diff --git a/src/main/java/org/gcube/vremanagement/executor/persistence/SmartExecutorPersistenceConnector.java b/src/main/java/org/gcube/vremanagement/executor/persistence/SmartExecutorPersistenceConnector.java index 8eeb1ba..98df528 100644 --- a/src/main/java/org/gcube/vremanagement/executor/persistence/SmartExecutorPersistenceConnector.java +++ b/src/main/java/org/gcube/vremanagement/executor/persistence/SmartExecutorPersistenceConnector.java @@ -6,11 +6,12 @@ package org.gcube.vremanagement.executor.persistence; import java.util.HashMap; import java.util.UUID; +import javax.ws.rs.WebApplicationException; + import org.gcube.common.clients.exceptions.DiscoveryException; import org.gcube.common.resources.gcore.HostingNode; import org.gcube.smartgears.ContextProvider; -import org.gcube.vremanagement.executor.api.rest.SmartExecutor; -import org.gcube.vremanagement.executor.client.SmartExecutorClientFactory; +import org.gcube.vremanagement.executor.client.SmartExecutorClientImpl; import org.gcube.vremanagement.executor.exception.ExecutorException; import org.gcube.vremanagement.executor.exception.PluginInstanceNotFoundException; import org.gcube.vremanagement.executor.json.SEMapper; @@ -78,12 +79,14 @@ public abstract class SmartExecutorPersistenceConnector extends PluginStateNotif .getPluginName(); try { - SmartExecutor smartExecutor = SmartExecutorClientFactory.create(pluginName, address); - smartExecutor.getLaunchState(pluginName, uuid.toString(), null); + SmartExecutorClientImpl smartExecutorClient = new SmartExecutorClientImpl(); + smartExecutorClient.setAddress(address); + smartExecutorClient.setPluginName(pluginName); + smartExecutorClient.getPluginStateEvolution(uuid); logger.trace("{} is not orphan.", SEMapper .getObjectMapper().writeValueAsString(scheduledTask)); return false; - } catch (DiscoveryException | ExecutorException e) { + } catch (DiscoveryException | WebApplicationException e) { // The instance was not found or the request failed. // The scheduledTask is considered orphan logger.trace("{} is considered orphan.", SEMapper