/* Remote access to EJB */ @GET @Path("/remote") public Response listIocsRemote() { return Response.status(Response.Status.OK) .header("Access-Control-Allow-Origin", "*") .header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization") .header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD") .header("Access-Control-Max-Age", "1209600") .entity(remoteBean.showIOCs()) .build(); }
@DELETE @Path("/remote/delete/{id}") public Response deleteIocRemote(@PathParam("id") Integer id) { remoteBean.removeIOC(id); return Response.status(Response.Status.OK) .header("Access-Control-Allow-Origin", "*") .header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization") .header("Access-Control-Allow-Credentials", "true") .header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD") .header("Access-Control-Max-Age", "1209600") .build(); }
@POST @Path("/remote/add") public Response createIocRemote(IOC ioc) { remoteBean.addIOC(ioc); return Response.status(Response.Status.CREATED) .header("Access-Control-Allow-Origin", "*") .header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization") .header("Access-Control-Allow-Credentials", "true") .header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD") .header("Access-Control-Max-Age", "1209600") .entity(ioc) .build(); }