gFeed/DataMinerAlgorithmsCrawler/src/main/java/org/gcube/data/publishing/gCatFeeder/collectors/dm/DataMinerPlugin.java

69 lines
2.3 KiB
Java

package org.gcube.data.publishing.gCatFeeder.collectors.dm;
import java.util.Collections;
import java.util.Set;
import org.gcube.data.publishing.gCatFeeder.collectors.dm.model.InternalAlgorithmDescriptor;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueFormatData;
import org.gcube.data.publishing.gCatFeeder.model.ControllerConfiguration;
import org.gcube.data.publishing.gCatfeeder.collectors.CatalogueRetriever;
import org.gcube.data.publishing.gCatfeeder.collectors.CollectorPlugin;
import org.gcube.data.publishing.gCatfeeder.collectors.DataCollector;
import org.gcube.data.publishing.gCatfeeder.collectors.DataTransformer;
import org.gcube.data.publishing.gCatfeeder.collectors.model.PluginDescriptor;
import org.gcube.data.publishing.gCatfeeder.collectors.model.faults.CatalogueNotSupportedException;
public class DataMinerPlugin implements CollectorPlugin<InternalAlgorithmDescriptor> {
@Override
public PluginDescriptor getDescriptor() {
return new PluginDescriptor("DATA_MINER_ALGORITHMS");
}
@Override
public CatalogueRetriever getRetrieverByCatalogueType(String catalogueType) throws CatalogueNotSupportedException {
switch(catalogueType) {
case Constants.GCAT_TYPE : return GCATRetriever.get();
default : throw new CatalogueNotSupportedException("No support for "+catalogueType);
}
}
@Override
public Set<String> getSupportedCatalogueTypes() {
return Collections.singleton(Constants.GCAT_TYPE);
}
@Override
public DataCollector<InternalAlgorithmDescriptor> getCollector() {
return new DMAlgorithmsInfoCollector();
}
@Override
public DataTransformer<? extends CatalogueFormatData, InternalAlgorithmDescriptor> getTransformerByCatalogueType(
String catalogueType) throws CatalogueNotSupportedException {
switch(catalogueType) {
case Constants.GCAT_TYPE : return new GCATTransformer();
default : throw new CatalogueNotSupportedException("No support for "+catalogueType);
}
}
@Override
public void init() throws Exception {
// TODO Auto-generated method stub
}
@Override
public void initInScope() throws Exception {
// TODO Auto-generated method stub
}
@Override
public ControllerConfiguration getPublisherControllerConfiguration(String catalogueType)
throws CatalogueNotSupportedException {
return new ControllerConfiguration();
}
}