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

51 lines
1.8 KiB
Java
Raw Normal View History

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.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() {
// TODO Auto-generated method stub
return null;
}
@Override
public CatalogueRetriever getRetrieverByCatalogueType(String catalogueType) throws CatalogueNotSupportedException {
switch(catalogueType) {
case Constants.CKAN_TYPE : return CKANRetriever.get();
default : throw new CatalogueNotSupportedException("No support for "+catalogueType);
}
}
@Override
public Set<String> getSupportedCatalogueTypes() {
return Collections.singleton(Constants.CKAN_TYPE);
}
@Override
public DataCollector<InternalAlgorithmDescriptor> getCollector() {
return new DMAlgorithmsInfoCollector();
}
@Override
public DataTransformer<? extends CatalogueFormatData, InternalAlgorithmDescriptor> getTransformerByCatalogueType(
String catalogueType) throws CatalogueNotSupportedException {
switch(catalogueType) {
case Constants.CKAN_TYPE : return new CKANTransformer();
default : throw new CatalogueNotSupportedException("No support for "+catalogueType);
}
}
}