Fixed client usage due to client APIs changes

This commit is contained in:
Luca Frosini 2019-09-20 15:22:16 +02:00
parent a1563df6a0
commit 0f10b1a5d7
1 changed files with 8 additions and 5 deletions

View File

@ -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