2016-10-25 12:46:50 +02:00
|
|
|
package org.gcube.data.analysis.dataminermanagercl.server.dmservice;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.data.OutputData;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationData;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.ComputationStatus;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.Operator;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorsClassification;
|
2019-09-27 19:42:37 +02:00
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.service.ServiceInfo;
|
2016-10-25 12:46:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Client of service
|
|
|
|
*
|
2017-05-10 12:44:22 +02:00
|
|
|
* @author Giancarlo Panichi
|
|
|
|
*
|
2016-10-25 12:46:50 +02:00
|
|
|
*
|
|
|
|
*/
|
2017-04-06 12:20:56 +02:00
|
|
|
public abstract class SClient implements Serializable {
|
2016-10-25 12:46:50 +02:00
|
|
|
|
|
|
|
private static final long serialVersionUID = 7087349607933493388L;
|
|
|
|
|
|
|
|
public SClient() {
|
|
|
|
super();
|
|
|
|
}
|
2017-04-06 12:20:56 +02:00
|
|
|
|
2016-10-25 12:46:50 +02:00
|
|
|
/**
|
|
|
|
* Retrieve the list of operators
|
|
|
|
*
|
2017-05-10 12:44:22 +02:00
|
|
|
* @return list of operators classification
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract List<OperatorsClassification> getOperatorsClassifications() throws Exception;
|
2017-04-06 12:20:56 +02:00
|
|
|
|
2018-05-08 11:03:12 +02:00
|
|
|
/**
|
|
|
|
* Retrieve the list of operators and refresh them if required
|
|
|
|
*
|
|
|
|
* @param refresh
|
|
|
|
* refresh operators in cache
|
|
|
|
* @return list of operators classification
|
|
|
|
* @throws Exception
|
|
|
|
* exception
|
|
|
|
*/
|
|
|
|
public abstract List<OperatorsClassification> getOperatorsClassifications(boolean refresh) throws Exception;
|
|
|
|
|
2016-10-25 12:46:50 +02:00
|
|
|
/**
|
|
|
|
* Retrieve the operator by id
|
|
|
|
*
|
2017-04-06 12:20:56 +02:00
|
|
|
* @param id
|
|
|
|
* operator id
|
2017-05-10 12:44:22 +02:00
|
|
|
* @return operator
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
|
|
|
public abstract Operator getOperatorById(String id) throws Exception;
|
2017-04-06 12:20:56 +02:00
|
|
|
|
2019-01-14 20:03:53 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param id
|
|
|
|
* operator id
|
|
|
|
* @param refresh
|
|
|
|
* if true refresh the operators in cache
|
|
|
|
* @return operator
|
|
|
|
* @throws Exception
|
|
|
|
* exception
|
|
|
|
*/
|
|
|
|
public abstract Operator getOperatorById(String id, boolean refresh) throws Exception;
|
|
|
|
|
2016-10-25 12:46:50 +02:00
|
|
|
/**
|
|
|
|
* Get input paramters of the operator
|
|
|
|
*
|
2017-04-06 12:20:56 +02:00
|
|
|
* @param operator
|
|
|
|
* operator
|
2017-05-10 12:44:22 +02:00
|
|
|
* @return list of parameter
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract List<Parameter> getInputParameters(Operator operator) throws Exception;
|
2016-10-25 12:46:50 +02:00
|
|
|
|
2017-04-06 12:20:56 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Get output paramters of the operator
|
|
|
|
*
|
|
|
|
* @param operator
|
2017-05-10 12:44:22 +02:00
|
|
|
* operator
|
|
|
|
* @return list of parameter
|
2017-04-06 12:20:56 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2017-04-06 12:20:56 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract List<Parameter> getOutputParameters(Operator operator) throws Exception;
|
2017-04-06 12:20:56 +02:00
|
|
|
|
2016-10-25 12:46:50 +02:00
|
|
|
/**
|
|
|
|
* Start Computation
|
|
|
|
*
|
2017-04-06 12:20:56 +02:00
|
|
|
* @param operator
|
|
|
|
* operator
|
2017-05-10 12:44:22 +02:00
|
|
|
* @return computation id
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract ComputationId startComputation(Operator operator) throws Exception;
|
2016-10-25 12:46:50 +02:00
|
|
|
|
|
|
|
/**
|
2016-11-22 14:32:47 +01:00
|
|
|
* Cancel a computation
|
2016-10-25 12:46:50 +02:00
|
|
|
*
|
2017-04-06 12:20:56 +02:00
|
|
|
* @param computationId
|
|
|
|
* computation Id
|
2017-05-10 12:44:22 +02:00
|
|
|
* @return cancel
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract String cancelComputation(ComputationId computationId) throws Exception;
|
2016-10-25 12:46:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Computation Status
|
|
|
|
*
|
2017-04-06 12:20:56 +02:00
|
|
|
* @param computationId
|
|
|
|
* computation Id
|
2017-05-10 12:44:22 +02:00
|
|
|
* @return computation status
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract ComputationStatus getComputationStatus(ComputationId computationId) throws Exception;
|
2016-10-25 12:46:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Output of computation
|
|
|
|
*
|
|
|
|
* @param computationId
|
2017-05-10 12:44:22 +02:00
|
|
|
* computation id
|
|
|
|
* @return output data
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract OutputData getOutputDataByComputationId(ComputationId computationId) throws Exception;
|
2016-10-25 12:46:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Computation Data by computation properties
|
|
|
|
*
|
2017-04-06 12:20:56 +02:00
|
|
|
* @param computationProperties
|
|
|
|
* computation properties
|
2017-05-10 12:44:22 +02:00
|
|
|
* @return computation data
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract ComputationData getComputationDataByComputationProperties(Map<String, String> computationProperties)
|
|
|
|
throws Exception;
|
2017-04-06 12:20:56 +02:00
|
|
|
|
2016-10-25 12:46:50 +02:00
|
|
|
/**
|
|
|
|
* Resubmit a computation only by computation properties
|
|
|
|
*
|
|
|
|
* @param computationProperties
|
2017-05-10 12:44:22 +02:00
|
|
|
* map of computation properties
|
|
|
|
* @return computation id
|
2016-10-25 12:46:50 +02:00
|
|
|
* @throws Exception
|
2017-05-10 12:44:22 +02:00
|
|
|
* exception
|
2016-10-25 12:46:50 +02:00
|
|
|
*/
|
2017-05-10 12:44:22 +02:00
|
|
|
public abstract ComputationId resubmitComputation(Map<String, String> computationProperties) throws Exception;
|
2017-04-06 12:20:56 +02:00
|
|
|
|
2019-09-27 19:42:37 +02:00
|
|
|
/**
|
|
|
|
* Retrieve service info
|
|
|
|
*
|
|
|
|
* @return service info
|
|
|
|
* @throws Exception
|
|
|
|
* exception
|
|
|
|
*/
|
|
|
|
public abstract ServiceInfo getServiceInfo() throws Exception;
|
|
|
|
|
2016-10-25 12:46:50 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "SClient";
|
|
|
|
}
|
2017-04-06 12:20:56 +02:00
|
|
|
|
2016-10-25 12:46:50 +02:00
|
|
|
}
|