Fixing POST and PUT methods in entity manager to be able to manage large content

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@134391 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-11-18 18:35:23 +00:00
parent 28e62b7b83
commit ebb17ba6bf
1 changed files with 4 additions and 6 deletions

View File

@ -169,13 +169,12 @@ public class EntityManager {
@PUT @PUT
@Path(EntityPath.CONSISTS_OF_PATH_PART + "/" + EntityPath.SOURCE_PATH_PART @Path(EntityPath.CONSISTS_OF_PATH_PART + "/" + EntityPath.SOURCE_PATH_PART
+ "/{" + SOURCE_ID_PATH_PARAM + "}/" + EntityPath.TARGET_PATH_PART + "/{" + SOURCE_ID_PATH_PARAM + "}/" + EntityPath.TARGET_PATH_PART
+ "/{" + TARGET_ID_PATH_PARAM + "}/{" + EntityPath.TYPE_PATH_PARAM + "/{" + TARGET_ID_PATH_PARAM + "}/{" + TYPE_PATH_PARAM + "}")
+ "}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String attachFacet( public String attachFacet(
@PathParam(SOURCE_ID_PATH_PARAM) String resourceUUID, @PathParam(SOURCE_ID_PATH_PARAM) String resourceUUID,
@PathParam(TARGET_ID_PATH_PARAM) String facetUUID, @PathParam(TARGET_ID_PATH_PARAM) String facetUUID,
@PathParam(EntityPath.TYPE_PATH_PARAM) String type, String json) @PathParam(TYPE_PATH_PARAM) String type, String json)
throws FacetNotFoundException, ResourceNotFoundException, throws FacetNotFoundException, ResourceNotFoundException,
ResourceRegistryException { ResourceRegistryException {
logger.info( logger.info(
@ -221,13 +220,13 @@ public class EntityManager {
@Path(EntityPath.IS_RELATED_TO_PATH_PART + "/" @Path(EntityPath.IS_RELATED_TO_PATH_PART + "/"
+ EntityPath.SOURCE_PATH_PART + "/{" + SOURCE_ID_PATH_PARAM + "}/" + EntityPath.SOURCE_PATH_PART + "/{" + SOURCE_ID_PATH_PARAM + "}/"
+ EntityPath.TARGET_PATH_PART + "/{" + TARGET_ID_PATH_PARAM + "}/{" + EntityPath.TARGET_PATH_PART + "/{" + TARGET_ID_PATH_PARAM + "}/{"
+ EntityPath.TYPE_PATH_PARAM + "}") + TYPE_PATH_PARAM + "}")
@Consumes({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON }) @Consumes({ MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON })
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public String attachResource( public String attachResource(
@PathParam(SOURCE_ID_PATH_PARAM) String sourceResourceUUID, @PathParam(SOURCE_ID_PATH_PARAM) String sourceResourceUUID,
@PathParam(TARGET_ID_PATH_PARAM) String targetResourceUUID, @PathParam(TARGET_ID_PATH_PARAM) String targetResourceUUID,
@PathParam(EntityPath.TYPE_PATH_PARAM) String type, String json) @PathParam(TYPE_PATH_PARAM) String type, String json)
throws ResourceNotFoundException, ResourceRegistryException { throws ResourceNotFoundException, ResourceRegistryException {
logger.info( logger.info(
"requested to attach source {} {} and target {} {} ({} Type {}) with properties {}", "requested to attach source {} {} and target {} {} ({} Type {}) with properties {}",
@ -276,7 +275,6 @@ public class EntityManager {
return entityManager.addResourceToContext(UUID.fromString(uuid)); return entityManager.addResourceToContext(UUID.fromString(uuid));
} }
/** /**
* e.g POST * e.g POST
* /resource-registry/add/facet/f6931232-c034-4979-9b2f-7193d3fba7df * /resource-registry/add/facet/f6931232-c034-4979-9b2f-7193d3fba7df