@PUT @Path("/{itemname: [a-zA-Z_0-9]*}/state")
@Consumes(MediaType.TEXT_PLAIN)
public Response putItemState(@PathParam("itemname") String itemname, String value) {
Item item = getItem(itemname);
if(item!=null) {
State state = TypeParser.parseState(item.getAcceptedDataTypes(), value);
if(state!=null) {
logger.debug("Received HTTP PUT request at '{}' with value '{}'.", uriInfo.getPath(), value);
RESTApplication.getEventPublisher().postUpdate(itemname, state);
return Response.ok().build();
} else {