Creating a gcat-client refs #13216

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/gcat-api@176864 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2019-01-29 16:43:59 +00:00
commit 1eee18c459
16 changed files with 320 additions and 0 deletions

36
.classpath Normal file
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>

23
.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gcat-api</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

83
pom.xml Normal file
View File

@ -0,0 +1,83 @@
<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.tools</groupId>
<artifactId>maven-parent</artifactId>
<version>1.0.0</version>
</parent>
<groupId>org.gcube.data-publishing</groupId>
<artifactId>gcat-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>gCat APIs</name>
<description>gCat APIs</description>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-smartgears-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<distroDirectory>${project.basedir}/distro</distroDirectory>
<serviceClass>DataPublishing</serviceClass>
</properties>
<scm>
<connection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/${project.artifactId}</connection>
<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube//trunk/data-publishing/${project.artifactId}</developerConnection>
<url>https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-publishing/${project.artifactId}</url>
</scm>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make-servicearchive</id>
<phase>package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,14 @@
package org.gcube.gcat.api;
public class GCatConstants {
public static final String SERVICE_CLASS = "DataPublishing";
public static final String SERVICE_NAME = "gcat";
public static final String SERVICE_ENTRY_NAME = "org.gcube.gcat.ResourceInitializer";
public static final String PURGE_QUERY_PARAMETER = "purge";
public static final String APPLICATION_JSON_CHARSET_UTF_8 = "application/json;charset=UTF-8";
public static final String LIMIT_PARAMETER = "limit";
public static final String OFFSET_PARAMETER = "offset";
}

View File

@ -0,0 +1,14 @@
package org.gcube.gcat.api.interfaces;
import javax.xml.ws.WebServiceException;
public interface CRUD<C,D> {
public C create(String json) throws WebServiceException;
public String read(String name) throws WebServiceException ;
public String update(String name, String json) throws WebServiceException;
public D delete(String name) throws WebServiceException;
}

View File

@ -0,0 +1,20 @@
package org.gcube.gcat.api.interfaces;
import javax.xml.ws.WebServiceException;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface Group<C,D> extends CRUD<C,D> {
String GROUPS = "groups";
public String list(int limit, int offset) throws WebServiceException;
public String patch(String name, String json) throws WebServiceException;
public D delete(String name, boolean purge) throws WebServiceException;
public D purge(String name) throws WebServiceException;
}

View File

@ -0,0 +1,17 @@
package org.gcube.gcat.api.interfaces;
import javax.xml.ws.WebServiceException;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface Item<C,D> extends CRUD<C,D> {
String ITEMS = "items";
public String list(int limit, int offset) throws WebServiceException;
public D delete(String name, boolean purge) throws WebServiceException;
public D purge(String name) throws WebServiceException;
}

View File

@ -0,0 +1,12 @@
package org.gcube.gcat.api.interfaces;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface License {
String LICENSES = "licenses";
public String list();
}

View File

@ -0,0 +1,12 @@
package org.gcube.gcat.api.interfaces;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface Namespace {
String NAMESPACES = "namespaces";
public String list();
}

View File

@ -0,0 +1,14 @@
package org.gcube.gcat.api.interfaces;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface Organization<C,D> extends CRUD<C,D> {
String ORGANIZATIONS = "organizations";
public String list(int limit, int offset);
public String patch(String name, String json);
}

View File

@ -0,0 +1,20 @@
package org.gcube.gcat.api.interfaces;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface Profile<C,D> {
String PROFILES = "profiles";
public String list();
public C create(String name, String xml);
public String read(String name);
public String update(String name, String xml);
public D delete(String name);
}

View File

@ -0,0 +1,19 @@
package org.gcube.gcat.api.interfaces;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface Resource<C,D> {
String RESOURCES = "resources";
public String list(String itemID);
public C create(String itemID, String json);
public String read(String itemID,String resourceID);
public String update(String itemID, String resourceID, String json);
public D delete(String itemID, String resourceID);
}

View File

@ -0,0 +1,21 @@
package org.gcube.gcat.api.interfaces;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public interface User<C,D> extends CRUD<C,D> {
String USERS = "users";
public String list();
@Override
public String read(String username);
@Override
public String update(String username, String json);
@Override
public D delete(String username);
}