Example #1
0
 @Override
 protected void doExecute(IZKClient zk) throws Exception {
   if (zk.exists(path) == null) {
     zk.createWithParents(path, "", ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
   }
   // Call the editor
   ConsoleEditor editor = editorFactory.create(getTerminal());
   editor.setTitle("Znode");
   editor.setContentManager(new ZookeeperContentManager(zk));
   editor.open(path);
   editor.setOpenEnabled(false);
   editor.start();
 }
Example #2
0
 @Override
 protected void doExecute(CuratorFramework curator) throws Exception {
   if (exists(curator, path) == null) {
     curator.create().creatingParentsIfNeeded().withACL(ZooDefs.Ids.OPEN_ACL_UNSAFE).forPath(path);
   }
   // Call the editor
   ConsoleEditor editor = editorFactory.create(getTerminal());
   editor.setTitle("Znode");
   editor.setContentManager(new ZookeeperContentManager(curator));
   editor.open(path);
   editor.setOpenEnabled(false);
   editor.start();
 }
Example #3
0
 private void openInEditor(Profile profile) throws Exception {
   String id = profile.getId();
   String version = profile.getVersion();
   String path =
       ZkPath.CONFIG_VERSIONS_PROFILE.getPath(version, id)
           + "/org.fusesource.fabric.agent.properties";
   // Call the editor
   ConsoleEditor editor = editorFactory.create(getTerminal());
   editor.setTitle("Profile");
   editor.setOpenEnabled(false);
   editor.setContentManager(new ZookeeperContentManager(getZooKeeper()));
   editor.open(path, id + " " + version);
   editor.start();
 }