@Override
	public void delete(String id) {
		CuratorFramework client = zkConnection.getClient();

		try {
			client.setData().forPath(
					Paths.build(Paths.JOB_DEPLOYMENTS, id, Paths.STATUS),
					ZooKeeperUtils.mapToBytes(new DeploymentUnitStatus(
							DeploymentUnitStatus.State.undeploying).toMap()));
		}
		catch (Exception e) {
			logger.warn("Exception while transitioning job '{}' state to {}", id,
					DeploymentUnitStatus.State.undeploying, e);
		}

		try {
			client.delete().deletingChildrenIfNeeded().forPath(Paths.build(Paths.JOB_DEPLOYMENTS, id));
		}
		catch (Exception e) {
			//NoNodeException - nothing to delete
			ZooKeeperUtils.wrapAndThrowIgnoring(e, KeeperException.NoNodeException.class);
		}
	}
Job instance repository. It should only return values for Jobs that are deployed.

@author Mark Fisher
@author David Turanski
@author Gunnar Hillert
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/zookeeper/ZooKeeperJobRepository.java