@SuppressWarnings("unchecked")
	@Post
	public Representation handlePost(Representation entity){
		try{
			 Form responseHeaders = (Form) getResponse().getAttributes().get("org.restlet.http.headers");
			 if (responseHeaders == null) {
	            responseHeaders = new Form();
	            getResponse().getAttributes().put("org.restlet.http.headers", responseHeaders);
	        }
	        responseHeaders.add("Access-Control-Allow-Origin", "*");
	        
			JSONObject returnMessage=new JSONObject();
			JSONObject args=AddressUtil.parseArgs(entity.getText());
			String tracemark=(String) args.get("tracemark")==null?null:AddressUtil.unescape((String) args.get("tracemark"));
			String classname = (String) args.get("classname")==null?null:AddressUtil.unescape((String) args.get("classname"));
			String methodname = (String) args.get("methodname")==null?null:AddressUtil.unescape((String) args.get("methodname"));
			String params = (String) args.get("params")==null?null:AddressUtil.unescape((String) args.get("params"));
			String levelStr= (String) args.get("level");
			TraceLevel level = null;
			if (levelStr!=null) {
				level =  TraceLevel.valueOf(levelStr);
			}else {
				level = TraceLevel.ALL;
			}
			 Pipeline pipeline = DirectOutputTracker.instance.getPipeline(tracemark, classname, StackUtils.parseMethod(methodname, params, "%3B"),level);//%3B equals ';'
			 Auditor.getInstance().register(pipeline);
			 String link=(String) AddressUtil.constructJsonObject(getReference(), pipeline).get("accessibleAddress");
			returnMessage.put("link", link);
			Representation  rep = new StringRepresentation(returnMessage.toJSONString(),MediaType.APPLICATION_JSON);
			return rep;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}