Пример #1
0
  @PUT
  @Path("action/{domain: .+}")
  @Produces({MediaType.APPLICATION_JSON})
  public Response putAction(
      @Context HttpHeaders headers, @PathParam("domain") String domain, String action) {
    logger.trace("Received HTTP PUT request at '{}'.", uriInfo.getPath());

    OpenHABConfigurationService cfg = getConfigurationServices().get("ZWave");

    if (cfg == null) {
      return Response.notAcceptable(null).build();
    }

    cfg.doAction(domain, action);

    ConfigServiceListBean cfgList = new ConfigServiceListBean();

    Object responseObject = cfgList;
    return Response.ok(responseObject).build();
  }