When creating new relationships use POST,
if PUT is used, it should return 400 BAD_REQUEST.
When deleting relationships, ID should be passed
in the URL.
IssueID: AAI-463
Change-Id: I6dbe84707d54c509da3a01feb52e1b52f462f9bc
Signed-off-by: Shwetank Dave <shwetank.dave@amdocs.com>
+ @PUT
+ @Path("/relationships/{version}/{type}/")
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ public Response updateEdgeWithoutId(String content, @Context HttpHeaders headers, @Context HttpServletRequest req) {
+
+ LoggingUtil.initMdcContext(req, headers);
+
+ logger.debug("Incoming request..." + content);
+ Response response = Response.status (Status.BAD_REQUEST).entity ("Cannot Update Edge Without Specifying Id in URL").build();
+
+ LoggingUtil.logRestRequest(logger, auditLogger, req, response);
+ return response;
+ }
+
@PUT
@Path("/relationships/{version}/{type}/{id}")
@Consumes({MediaType.APPLICATION_JSON})
@PUT
@Path("/relationships/{version}/{type}/{id}")
@Consumes({MediaType.APPLICATION_JSON})
+ @DELETE
+ @Path("/relationships/{version}/{type}/")
+ @Consumes({MediaType.APPLICATION_JSON})
+ @Produces({MediaType.APPLICATION_JSON})
+ public Response deleteEdgeWithouId(String content, @Context HttpHeaders headers, @Context HttpServletRequest req) {
+
+ LoggingUtil.initMdcContext(req, headers);
+
+ logger.debug("Incoming request..." + content);
+ Response response = Response.status ( Status.BAD_REQUEST ).entity ( "Cannot Delete Edge Without Specifying Id in URL" ).build ();
+ LoggingUtil.logRestRequest(logger, auditLogger, req, response);
+ return response;
+ }
+
@DELETE
@Path("/relationships/{version}/{type}/{id}")
@Consumes({MediaType.APPLICATION_JSON})
@DELETE
@Path("/relationships/{version}/{type}/{id}")
@Consumes({MediaType.APPLICATION_JSON})