Add stubs for Resource and ResourcePath.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@158768 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Manuele Simi 2017-11-23 02:38:04 +00:00
parent 01b55f0327
commit 400cfe78ee
3 changed files with 38 additions and 4 deletions

View File

@ -0,0 +1,12 @@
package org.gcube.resourcemanagement.manager.io.rs;
/**
* REST paths exposed by the webapp.
*
* @author Manuele Simi (ISTI - CNR)
*
*/
public class ResourcePath {
public static final String ROOT = "context";
}

View File

@ -2,6 +2,7 @@ package org.gcube.resourcemanagement.manager.webapp.rs;
import javax.ws.rs.DefaultValue; import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.PathParam; import javax.ws.rs.PathParam;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
@ -13,7 +14,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* Methods for Context operations. * Methods for {@link org.gcube.informationsystem.model.entity.Context} operations.
* *
* @author Manuele Simi (ISTI-CNR) * @author Manuele Simi (ISTI-CNR)
* *
@ -27,15 +28,15 @@ public class Context {
public static final String TYPE_PATH_PARAM = "type"; public static final String TYPE_PATH_PARAM = "type";
/* /*
* e.g. GET /resource-manager/context/create * e.g. POST /resource-manager/context/
*/ */
@GET @POST
@Path(ContextPath.SCHEMA_PATH_PART + "/{" + TYPE_PATH_PARAM + "}") @Path(ContextPath.SCHEMA_PATH_PART + "/{" + TYPE_PATH_PARAM + "}")
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8) @Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
public String create(@PathParam(TYPE_PATH_PARAM) String type, public String create(@PathParam(TYPE_PATH_PARAM) String type,
@QueryParam(ContextPath.POLYMORPHIC_PARAM) @DefaultValue("false") Boolean polymorphic) @QueryParam(ContextPath.POLYMORPHIC_PARAM) @DefaultValue("false") Boolean polymorphic)
{ {
logger.info("Requested Schema for type {}", type); logger.info("Requested resource to be added to for type {}", type);
return ""; return "";
} }

View File

@ -0,0 +1,21 @@
package org.gcube.resourcemanagement.manager.webapp.rs;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import org.gcube.resourcemanagement.manager.io.rs.ResourcePath;
/**
* Methods for {@link org.gcube.informationsystem.model.entity.Resource} operations.
*
* @author Manuele Simi (ISTI-CNR)
*
*/
@Path(ResourcePath.ROOT)
public class Resource {
@PUT
public void addToContext() {
}
}