public NamespacesInstanceModel buildTestModel(String namespace, Map<String,String> properties) { NamespacesInstanceModel model = new NamespacesInstanceModel(); for(String key: properties.keySet()){ model.addProperty(key, properties.get(key)); } return model; }
/** * Build a response for PUT alter namespace with no properties specified. * @param message value not used. * @param headers value not used. * @return response code. */ @PUT public Response putNoBody(final byte[] message, final @Context UriInfo uriInfo, final @Context HttpHeaders headers) { if (LOG.isTraceEnabled()) { LOG.trace("PUT " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try{ NamespacesInstanceModel model = new NamespacesInstanceModel(namespace); return processUpdate(model, true, uriInfo); }catch(IOException ioe){ servlet.getMetrics().incrementFailedPutRequests(1); throw new RuntimeException("Cannot retrieve info for '" + namespace + "'."); } }
/** * Build a response for POST create namespace with no properties specified. * @param message value not used. * @param headers value not used. * @return response code. */ @POST public Response postNoBody(final byte[] message, final @Context UriInfo uriInfo, final @Context HttpHeaders headers) { if (LOG.isTraceEnabled()) { LOG.trace("POST " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try{ NamespacesInstanceModel model = new NamespacesInstanceModel(namespace); return processUpdate(model, false, uriInfo); }catch(IOException ioe){ servlet.getMetrics().incrementFailedPutRequests(1); throw new RuntimeException("Cannot retrieve info for '" + namespace + "'."); } }
new NamespacesInstanceModel(servlet.getAdmin(), namespace); servlet.getMetrics().incrementSucessfulGetRequests(1); return Response.ok(rowModel).build();
public NamespacesInstanceModel buildTestModel(String namespace, Map<String,String> properties) { NamespacesInstanceModel model = new NamespacesInstanceModel(); for(String key: properties.keySet()){ model.addProperty(key, properties.get(key)); } return model; }
/** * Build a response for POST create namespace with no properties specified. * @param message value not used. * @param headers value not used. * @return response code. */ @POST public Response postNoBody(final byte[] message, final @Context UriInfo uriInfo, final @Context HttpHeaders headers) { if (LOG.isTraceEnabled()) { LOG.trace("POST " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try{ NamespacesInstanceModel model = new NamespacesInstanceModel(namespace); return processUpdate(model, false, uriInfo); }catch(IOException ioe){ servlet.getMetrics().incrementFailedPutRequests(1); throw new RuntimeException("Cannot retrieve info for '" + namespace + "'."); } }
/** * Build a response for POST create namespace with no properties specified. * @param message value not used. * @param headers value not used. * @return response code. */ @POST public Response postNoBody(final byte[] message, final @Context UriInfo uriInfo, final @Context HttpHeaders headers) { if (LOG.isTraceEnabled()) { LOG.trace("POST " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try{ NamespacesInstanceModel model = new NamespacesInstanceModel(namespace); return processUpdate(model, false, uriInfo); }catch(IOException ioe){ servlet.getMetrics().incrementFailedPutRequests(1); throw new RuntimeException("Cannot retrieve info for '" + namespace + "'."); } }
/** * Build a response for PUT alter namespace with no properties specified. * @param message value not used. * @param headers value not used. * @return response code. */ @PUT public Response putNoBody(final byte[] message, final @Context UriInfo uriInfo, final @Context HttpHeaders headers) { if (LOG.isTraceEnabled()) { LOG.trace("PUT " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try{ NamespacesInstanceModel model = new NamespacesInstanceModel(namespace); return processUpdate(model, true, uriInfo); }catch(IOException ioe){ servlet.getMetrics().incrementFailedPutRequests(1); throw new RuntimeException("Cannot retrieve info for '" + namespace + "'."); } }
/** * Build a response for PUT alter namespace with no properties specified. * @param message value not used. * @param headers value not used. * @return response code. */ @PUT public Response putNoBody(final byte[] message, final @Context UriInfo uriInfo, final @Context HttpHeaders headers) { if (LOG.isTraceEnabled()) { LOG.trace("PUT " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); try{ NamespacesInstanceModel model = new NamespacesInstanceModel(namespace); return processUpdate(model, true, uriInfo); }catch(IOException ioe){ servlet.getMetrics().incrementFailedPutRequests(1); throw new RuntimeException("Cannot retrieve info for '" + namespace + "'."); } }
new NamespacesInstanceModel(servlet.getAdmin(), namespace); servlet.getMetrics().incrementSucessfulGetRequests(1); return Response.ok(rowModel).build();
new NamespacesInstanceModel(servlet.getAdmin(), namespace); servlet.getMetrics().incrementSucessfulGetRequests(1); return Response.ok(rowModel).build();