Stub implementation of the create method.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@158800 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b3c66a742f
commit
87de702639
|
@ -8,8 +8,10 @@ package org.gcube.resourcemanagement.manager.io.rs;
|
||||||
*/
|
*/
|
||||||
public class ContextPath {
|
public class ContextPath {
|
||||||
|
|
||||||
public static final String ROOT = "context";
|
public static final String CONTEXT_ROOT = "context";
|
||||||
public static final String SCHEMA_PATH_PART = "schema";
|
|
||||||
public static final String POLYMORPHIC_PARAM = "polymorphic";
|
public static final String CREATE_PATH_PART = "create";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
package org.gcube.resourcemanagement.manager.webapp.rs;
|
package org.gcube.resourcemanagement.manager.webapp.rs;
|
||||||
|
|
||||||
import javax.ws.rs.DefaultValue;
|
|
||||||
import javax.ws.rs.GET;
|
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.PathParam;
|
|
||||||
import javax.ws.rs.Produces;
|
import javax.ws.rs.Produces;
|
||||||
import javax.ws.rs.QueryParam;
|
import javax.ws.rs.core.Response;
|
||||||
|
import javax.ws.rs.core.Response.Status;
|
||||||
|
|
||||||
import org.gcube.resourcemanagement.manager.io.rs.*;
|
import org.gcube.resourcemanagement.manager.io.rs.*;
|
||||||
import org.gcube.resourcemanagement.manager.webapp.ResourceInitializer;
|
import org.gcube.resourcemanagement.manager.webapp.ResourceInitializer;
|
||||||
|
@ -19,25 +17,25 @@ import org.slf4j.LoggerFactory;
|
||||||
* @author Manuele Simi (ISTI-CNR)
|
* @author Manuele Simi (ISTI-CNR)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Path(ContextPath.ROOT)
|
@Path(ContextPath.CONTEXT_ROOT)
|
||||||
public class Context {
|
public class Context {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(Context.class);
|
private static Logger logger = LoggerFactory.getLogger(Context.class);
|
||||||
|
|
||||||
public static final String ID_PATH_PARAM = "id";
|
|
||||||
public static final String TYPE_PATH_PARAM = "type";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* e.g. POST /resource-manager/context/
|
* e.g. POST /resource-manager/context/
|
||||||
*/
|
*/
|
||||||
@POST
|
@POST
|
||||||
@Path(ContextPath.SCHEMA_PATH_PART + "/{" + TYPE_PATH_PARAM + "}")
|
@Path(ContextPath.CREATE_PATH_PART)
|
||||||
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
||||||
public String create(@PathParam(TYPE_PATH_PARAM) String type,
|
public Response create(String json)
|
||||||
@QueryParam(ContextPath.POLYMORPHIC_PARAM) @DefaultValue("false") Boolean polymorphic)
|
|
||||||
{
|
{
|
||||||
logger.info("Requested resource to be added to for type {}", type);
|
logger.info("Requested to create context {} with json {}",
|
||||||
|
org.gcube.informationsystem.model.entity.Context.NAME, json);
|
||||||
|
String response = "";
|
||||||
|
//TODO
|
||||||
|
return Response.status(Status.CREATED).entity(response).
|
||||||
|
type(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8).build();
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue