2016-10-08 20:46:17 +02:00
|
|
|
package org.gcube.data_catalogue.grsf_publish_ws.services;
|
|
|
|
|
2016-10-09 16:06:45 +02:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
import javax.ws.rs.Consumes;
|
|
|
|
import javax.ws.rs.POST;
|
|
|
|
import javax.ws.rs.Path;
|
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
import javax.ws.rs.core.MediaType;
|
|
|
|
import javax.ws.rs.core.Response;
|
2016-10-09 16:06:45 +02:00
|
|
|
import javax.ws.rs.core.Response.Status;
|
2016-10-08 20:46:17 +02:00
|
|
|
|
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.json.input.FisheryRecord;
|
2016-10-09 16:06:45 +02:00
|
|
|
import org.gcube.data_catalogue.grsf_publish_ws.json.output.ResponseCreationBean;
|
2016-10-08 20:46:17 +02:00
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fishery web service methods
|
|
|
|
* @author Costantino Perciante at ISTI-CNR
|
|
|
|
*/
|
|
|
|
@Path("fishery/")
|
|
|
|
public class GrsfPublisherFisheryService {
|
2016-10-09 16:06:45 +02:00
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
// Logger
|
|
|
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(GrsfPublisherFisheryService.class);
|
2016-10-09 16:06:45 +02:00
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
@POST
|
|
|
|
@Path("publish-product")
|
|
|
|
@Consumes(MediaType.APPLICATION_JSON)
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
public Response publishFishery(FisheryRecord record){
|
2016-10-09 16:06:45 +02:00
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
logger.info("Incoming request for creating a fishery record");
|
2016-10-09 16:06:45 +02:00
|
|
|
System.out.println(record);
|
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
// TODO
|
2016-10-09 16:06:45 +02:00
|
|
|
return Response.status(Status.CREATED).entity(new ResponseCreationBean(UUID.randomUUID().toString(), null)).build();
|
|
|
|
|
2016-10-08 20:46:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|