/** * Create an persistent path * @param path path * @return the path created */ public String create(String path) { return create(path, (byte[])null); }
/** * Create an persistent path, save the object to json * @param path path * @param obj object * @return the path created */ public String create(String path, Object obj){ return create(path, JSON.toJSONString(obj)); }
/** * Create an persistent path * @param path path * @param data string data * @return the path created */ public String create(String path, String data){ try { return create(path, data.getBytes("UTF-8")); } catch (Exception e) { handleConnectionLoss(e); throw new ZkException(e); } }
/** * Trigger the job instance * @param appName the app name * @param jobClass the job class * @param instance the instance */ public void triggerJobInstance(String appName, String jobClass, JobInstance instance) { String jobInstancePath = ZkPaths.pathOfJobInstance(appName, jobClass, instance.getId()); zk.client().create(jobInstancePath, instance.getStatus()); }