2019-03-07 18:01:44 +01:00
|
|
|
package org.gcube.data.publishing.gCatFeeder.collectors.dm;
|
2019-03-06 11:13:28 +01:00
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.server.DataMinerService;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.server.dmservice.SClient;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Parameter;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.Operator;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorCategory;
|
|
|
|
import org.gcube.data.analysis.dataminermanagercl.shared.process.OperatorsClassification;
|
2019-03-07 18:01:44 +01:00
|
|
|
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.InternalAlgorithmDescriptor;
|
2019-03-07 17:29:38 +01:00
|
|
|
import org.gcube.data.publishing.gCatfeeder.collectors.DataCollector;
|
|
|
|
import org.gcube.data.publishing.gCatfeeder.collectors.model.faults.CollectorFault;
|
2019-03-06 11:13:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
public class DMAlgorithmsInfoCollector implements DataCollector<InternalAlgorithmDescriptor> {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Set<InternalAlgorithmDescriptor> collect() throws CollectorFault {
|
|
|
|
try {
|
|
|
|
SClient client=new DataMinerService().getClient();
|
|
|
|
for(OperatorsClassification opClass: client.getOperatorsClassifications()) {
|
|
|
|
// Load info
|
|
|
|
String opClassName =opClass.getName();
|
|
|
|
|
|
|
|
for(Operator op : opClass.getOperators()) {
|
|
|
|
// OperatorCategory Info
|
|
|
|
OperatorCategory cat = op.getCategory();
|
|
|
|
String categoryBriefDescription = cat.getBriefDescription();
|
|
|
|
String categoryDescription= cat.getDescription();
|
|
|
|
String categoryID=cat.getId();
|
|
|
|
String categoryName=cat.getName();
|
|
|
|
|
|
|
|
// Operator info
|
|
|
|
|
|
|
|
String opBriefDescription=op.getBriefDescription();
|
|
|
|
String opDescription=op.getDescription();
|
|
|
|
String opID=op.getId();
|
|
|
|
String operatorName=op.getName();
|
|
|
|
|
|
|
|
|
|
|
|
// Parameters info
|
|
|
|
for(Parameter param:op.getOperatorParameters()) {
|
|
|
|
String paramDescription=param.getDescription();
|
|
|
|
String paramName=param.getName();
|
|
|
|
String paramType=param.getTypology().toString();
|
|
|
|
String paramValue=param.getValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Create bean
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HashSet<InternalAlgorithmDescriptor> toReturn=new HashSet();
|
|
|
|
|
|
|
|
|
|
|
|
return toReturn;
|
|
|
|
}catch(Exception e) {
|
|
|
|
throw new CollectorFault("Unable to retrieve information",e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|