Rename rest packages to rs, as per convention from java.ws.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@156279 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Manuele Simi 2017-10-15 11:46:25 +00:00
parent 3d16c2ff4f
commit 5e62131194
5 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,15 @@
package org.gcube.resourcemanagement.manager.io.rs;
/**
* REST paths exposed by the webapp.
*
* @author Manuele Simi (ISTI - CNR)
*
*/
public class AccessPath {
public static final String ACCESS_PATH_PART = "access";
public static final String SCHEMA_PATH_PART = "schema";
public static final String POLYMORPHIC_PARAM = "polymorphic";
}

View File

@ -0,0 +1,5 @@
/**
* @author Manuele Simi (ISTI - CNR)
*
*/
package org.gcube.resourcemanagement.manager.io.rs;

View File

@ -3,7 +3,7 @@ package org.gcube.resourcemanagement.manager.webapp;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.MediaType;
import org.gcube.resourcemanagement.manager.webapp.rest.Access;
import org.gcube.resourcemanagement.manager.webapp.rs.Access;
import org.glassfish.jersey.server.ResourceConfig;
/**

View File

@ -0,0 +1,41 @@
package org.gcube.resourcemanagement.manager.webapp.rs;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import org.gcube.resourcemanagement.manager.io.rs.*;
import org.gcube.resourcemanagement.manager.webapp.ResourceInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author Manuele Simi (ISTI-CNR)
*
*/
@Path(AccessPath.ACCESS_PATH_PART)
public class Access {
private static Logger logger = LoggerFactory.getLogger(Access.class);
public static final String ID_PATH_PARAM = "id";
public static final String TYPE_PATH_PARAM = "type";
/*
* e.g. GET /resource-manager/access/schema/ContactFacet?polymorphic=true
*/
@GET
@Path(AccessPath.SCHEMA_PATH_PART + "/{" + TYPE_PATH_PARAM + "}")
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
public String voidMethod(@PathParam(TYPE_PATH_PARAM) String type,
@QueryParam(AccessPath.POLYMORPHIC_PARAM) @DefaultValue("false") Boolean polymorphic)
{
logger.info("Requested Schema for type {}", type);
return "";
}
}

View File

@ -0,0 +1,5 @@
/**
* @author Manuele Simi (ISTI - CNR)
*
*/
package org.gcube.resourcemanagement.manager.webapp.rs;