This commit is contained in:
Fabio Sinibaldi 2019-03-07 16:31:32 +00:00
parent 0b2b6a6a19
commit cdce2a3025
37 changed files with 423 additions and 0 deletions

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>crawler-plugin-framework</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -0,0 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gcube.data-publishing.gCat-Feeder</groupId>
<artifactId>gCat-Feeder-Suite</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>crawler-plugin-framework</artifactId>
<name>crawler-plugin-framework</name>
<description>Framework for crawler implementations</description>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.14.8</version>
</dependency>
<dependency>
<groupId>org.gcube.data-publishing.gCat-Feeder</groupId>
<artifactId>commons</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,9 @@
package org.gcube.data.publishing.gCatfeeder.collectors;
import org.gcube.data.publishing.gCatFeeder.model.CatalogueInstanceDescriptor;
public interface CatalogueRetriever {
public CatalogueInstanceDescriptor getInstance();
}

View File

@ -0,0 +1,20 @@
package org.gcube.data.publishing.gCatfeeder.collectors;
import java.util.Set;
import org.gcube.data.publishing.gCatFeeder.model.FormatData;
import org.gcube.data.publishing.gCatfeeder.collectors.model.CustomData;
import org.gcube.data.publishing.gCatfeeder.collectors.model.PluginDescriptor;
import org.gcube.data.publishing.gCatfeeder.collectors.model.PublisherFormatData;
import org.gcube.data.publishing.gCatfeeder.collectors.model.faults.CatalogueNotSupportedException;
public interface CrawlerPlugin<E extends CustomData>{
public PluginDescriptor getDescriptor();
public CatalogueRetriever getRetrieverByCatalogueType(FormatData catalogueType) throws CatalogueNotSupportedException;
public Set<DataTransformer<? extends PublisherFormatData,E>> getImplementedTransformers();
public DataCollector<E> getCollector();
}

View File

@ -0,0 +1,15 @@
package org.gcube.data.publishing.gCatfeeder.collectors;
import java.util.Set;
import org.gcube.data.publishing.gCatfeeder.collectors.model.CustomData;
import org.gcube.data.publishing.gCatfeeder.collectors.model.faults.CollectorFault;
public interface DataCollector<T extends CustomData> {
public Set<T> collect() throws CollectorFault;
}

View File

@ -0,0 +1,15 @@
package org.gcube.data.publishing.gCatfeeder.collectors;
import java.util.Collection;
import java.util.Set;
import org.gcube.data.publishing.gCatFeeder.model.FormatData;
import org.gcube.data.publishing.gCatfeeder.collectors.model.CustomData;
import org.gcube.data.publishing.gCatfeeder.collectors.model.PublisherFormatData;
public interface DataTransformer<T extends PublisherFormatData,E extends CustomData> {
public FormatData getTargetFormat();
public Set<T> transform(Collection<E> collectedData);
}

View File

@ -0,0 +1,5 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model;
public interface CustomData {
}

View File

@ -0,0 +1,22 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model;
import lombok.Getter;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@RequiredArgsConstructor
public class PluginDescriptor {
// Plugin info
@NonNull
private String name;
// Run Interval
}

View File

@ -0,0 +1,12 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model;
import org.gcube.data.publishing.gCatFeeder.model.FormatData;
public interface PublisherFormatData {
public FormatData getFormat();
public String serialize();
}

View File

@ -0,0 +1,29 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model.faults;
public class CatalogueNotFound extends CrawlerException {
public CatalogueNotFound() {
// TODO Auto-generated constructor stub
}
public CatalogueNotFound(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public CatalogueNotFound(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public CatalogueNotFound(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public CatalogueNotFound(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,30 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model.faults;
public class CatalogueNotSupportedException extends CrawlerException {
public CatalogueNotSupportedException() {
// TODO Auto-generated constructor stub
}
public CatalogueNotSupportedException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public CatalogueNotSupportedException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public CatalogueNotSupportedException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public CatalogueNotSupportedException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model.faults;
public class CollectorFault extends CrawlerException {
public CollectorFault() {
// TODO Auto-generated constructor stub
}
public CollectorFault(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public CollectorFault(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public CollectorFault(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public CollectorFault(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model.faults;
public class CrawlerException extends Exception {
public CrawlerException() {
// TODO Auto-generated constructor stub
}
public CrawlerException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public CrawlerException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public CrawlerException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public CrawlerException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,30 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model.faults;
public class InvalidCustomData extends CrawlerException {
public InvalidCustomData() {
// TODO Auto-generated constructor stub
}
public InvalidCustomData(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public InvalidCustomData(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public InvalidCustomData(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public InvalidCustomData(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,29 @@
package org.gcube.data.publishing.gCatfeeder.collectors.model.faults;
public class TransformException extends CrawlerException {
public TransformException() {
// TODO Auto-generated constructor stub
}
public TransformException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public TransformException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public TransformException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public TransformException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}

View File

@ -0,0 +1,11 @@
package org.gcube.data.publishing.gCatFeeder.crawlers.model;
import org.junit.Test;
public class ModelTests {
@Test
public void testConversion() {
}
}

View File

@ -0,0 +1,5 @@
Manifest-Version: 1.0
Built-By: fabio
Build-Jdk: 1.8.0_201
Created-By: Maven Integration for Eclipse

View File

@ -0,0 +1,7 @@
#Generated by Maven Integration for Eclipse
#Wed Mar 06 12:46:42 CET 2019
version=1.0.0-SNAPSHOT
groupId=org.gcube.data-publishing.gCat-Feeder
m2e.projectName=crawler-plugin-framework
m2e.projectLocation=/home/fabio/workspaces/DEV/gCat-Feeder-Suite/crawler-plugin-framework
artifactId=crawler-plugin-framework

View File

@ -0,0 +1,26 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gcube.data-publishing.gCat-Feeder</groupId>
<artifactId>gCat-Feeder-Suite</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>crawler-plugin-framework</artifactId>
<name>crawler-plugin-framework</name>
<description>Framework for crawler implementations</description>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.14.8</version>
</dependency>
<dependency>
<groupId>org.gcube.data-publishing.gCat-Feeder</groupId>
<artifactId>commons</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>