You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2017/02/09 18:36:25 UTC
[26/47] curator git commit: refactoring
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetChildrenBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetChildrenBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetChildrenBuilder.java
new file mode 100644
index 0000000..4e3d8db
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetChildrenBuilder.java
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.AsyncStage;
+import org.apache.zookeeper.data.Stat;
+import java.util.List;
+
+/**
+ * Builder for getChildren()
+ */
+public interface AsyncGetChildrenBuilder extends AsyncPathable<AsyncStage<List<String>>>
+{
+ /**
+ * Have the operation fill the provided stat object
+ *
+ * @param stat the stat to have filled in
+ * @return this
+ */
+ AsyncPathable<AsyncStage<List<String>>> storingStatIn(Stat stat);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetConfigBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetConfigBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetConfigBuilder.java
new file mode 100644
index 0000000..94b0e97
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetConfigBuilder.java
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.AsyncStage;
+import org.apache.zookeeper.data.Stat;
+
+/**
+ * Builder for getConfig()
+ */
+public interface AsyncGetConfigBuilder extends AsyncEnsemblable<AsyncStage<byte[]>>
+{
+ /**
+ * Have the operation fill the provided stat object
+ *
+ * @param stat the stat to have filled in
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<byte[]>> storingStatIn(Stat stat);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetDataBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetDataBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetDataBuilder.java
new file mode 100644
index 0000000..caa90cb
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncGetDataBuilder.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.AsyncStage;
+import org.apache.zookeeper.data.Stat;
+
+/**
+ * Builder to get ZNode data
+ */
+public interface AsyncGetDataBuilder extends AsyncPathable<AsyncStage<byte[]>>
+{
+ /**
+ * Cause the data to be de-compressed using the configured compression provider
+ *
+ * @return this
+ */
+ AsyncPathable<AsyncStage<byte[]>> decompressed();
+
+ /**
+ * Have the operation fill the provided stat object
+ *
+ * @param stat the stat to have filled in
+ * @return this
+ */
+ AsyncPathable<AsyncStage<byte[]>> storingStatIn(Stat stat);
+
+ /**
+ * Have the operation fill the provided stat object and have the data be de-compressed
+ *
+ * @param stat the stat to have filled in
+ * @see #decompressed()
+ * @see #storingStatIn(org.apache.zookeeper.data.Stat)
+ * @return this
+ */
+ AsyncPathable<AsyncStage<byte[]>> decompressedStoringStatIn(Stat stat);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncMultiTransaction.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncMultiTransaction.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncMultiTransaction.java
new file mode 100644
index 0000000..b972141
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncMultiTransaction.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.framework.api.transaction.CuratorOp;
+import org.apache.curator.framework.api.transaction.CuratorTransactionResult;
+import org.apache.curator.x.async.AsyncStage;
+import java.util.List;
+
+/**
+ * Terminal operation to support multi/transactions
+ */
+public interface AsyncMultiTransaction
+{
+ /**
+ * Invoke ZooKeeper to commit the given operations as a single transaction. Create the
+ * operation instances via {@link org.apache.curator.x.async.AsyncCuratorFramework#transactionOp()}
+ *
+ * @param operations operations that make up the transaction.
+ * @return AsyncStage instance for managing the completion
+ */
+ AsyncStage<List<CuratorTransactionResult>> forOperations(List<CuratorOp> operations);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathAndBytesable.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathAndBytesable.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathAndBytesable.java
new file mode 100644
index 0000000..c34b1ec
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathAndBytesable.java
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.curator.x.async.api;
+
+/**
+ * Terminal operation for various builders
+ */
+public interface AsyncPathAndBytesable<T> extends AsyncPathable<T>
+{
+ /**
+ * Commit the currently building operation using the given path and data
+ * and invoke ZooKeeper
+ *
+ * @param path the path
+ * @param data the data
+ * @return usually an async stage
+ */
+ T forPath(String path, byte[] data);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathable.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathable.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathable.java
new file mode 100644
index 0000000..fbcba48
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncPathable.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+/**
+ * Terminal operation for various builders
+ */
+public interface AsyncPathable<T>
+{
+ /**
+ * Commit the currently building operation using the given path
+ * and invoke ZooKeeper
+ *
+ * @param path the path
+ * @return usually an async stage
+ */
+ T forPath(String path);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncReconfigBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncReconfigBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncReconfigBuilder.java
new file mode 100644
index 0000000..a5b5255
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncReconfigBuilder.java
@@ -0,0 +1,118 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.AsyncStage;
+import org.apache.zookeeper.data.Stat;
+import java.util.List;
+
+/**
+ * Builder for reconfigs
+ */
+public interface AsyncReconfigBuilder
+{
+ /**
+ * Sets one or more members that are meant to be the ensemble.
+ * The expected format is: <code>server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]</code>
+ *
+ * @param servers The new server list
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withNewMembers(List<String> servers);
+
+ /**
+ * Adds servers to join the ensemble and/or servers to leave the ensemble. The format for <strong>joining</strong>
+ * is: <code>server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]</code>. The format
+ * for <strong>leaving</strong> is a list of server IDs.
+ *
+ * @param joining The servers joining
+ * @param leaving The servers leaving
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withJoiningAndLeaving(List<String> joining, List<String> leaving);
+
+ /**
+ * Same as {@link #withNewMembers(java.util.List)} but allows specified the configuration version to use.
+ * By default the configuration version is -1.
+ *
+ * @param servers The new server list
+ * @param fromConfig the config version to use
+ * @see #withNewMembers(java.util.List)
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withNewMembers(List<String> servers, long fromConfig);
+
+ /**
+ * Specify joiners, leaves and config version. By default the configuration version is -1.
+ *
+ * @param joining The servers joining
+ * @param leaving The servers leaving
+ * @param fromConfig the config version to use
+ * @see #withJoiningAndLeaving(java.util.List, java.util.List)
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withJoiningAndLeaving(List<String> joining, List<String> leaving, long fromConfig);
+
+ /**
+ * Same as {@link #withNewMembers(java.util.List)} but allows a stat to hold the stat info from "/zookeeper/config"
+ *
+ * @param servers The servers joining.
+ * @param stat stat to hold the stat value
+ * @see #withNewMembers(java.util.List)
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withNewMembers(List<String> servers, Stat stat);
+
+ /**
+ * Same as {@link #withJoiningAndLeaving(java.util.List, java.util.List)}
+ * but allows a stat to hold the stat info from "/zookeeper/config"
+ *
+ * @param joining The servers joining
+ * @param leaving The servers leaving
+ * @param stat stat to hold the stat value
+ * @see #withJoiningAndLeaving(java.util.List, java.util.List)
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withJoiningAndLeaving(List<String> joining, List<String> leaving, Stat stat);
+
+ /**
+ * Same as {@link #withNewMembers(java.util.List)} with stat and config version
+ *
+ * @param servers The servers joining.
+ * @param stat stat to hold the stat value
+ * @param fromConfig the config version to use
+ * @see #withNewMembers(java.util.List, long)
+ * @see #withNewMembers(java.util.List, org.apache.zookeeper.data.Stat)
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withNewMembers(List<String> servers, Stat stat, long fromConfig);
+
+ /**
+ * Same as {@link #withJoiningAndLeaving(java.util.List, java.util.List)} with stat and config version
+ *
+ * @param joining The servers joining
+ * @param leaving The servers leaving
+ * @param stat stat to hold the stat value
+ * @param fromConfig the config version to use
+ * @see #withJoiningAndLeaving(java.util.List, java.util.List, long)
+ * @see #withJoiningAndLeaving(java.util.List, java.util.List, org.apache.zookeeper.data.Stat)
+ * @return this
+ */
+ AsyncEnsemblable<AsyncStage<Void>> withJoiningAndLeaving(List<String> joining, List<String> leaving, Stat stat, long fromConfig);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncRemoveWatchesBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncRemoveWatchesBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncRemoveWatchesBuilder.java
new file mode 100644
index 0000000..3cd985f
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncRemoveWatchesBuilder.java
@@ -0,0 +1,126 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.framework.api.CuratorWatcher;
+import org.apache.curator.x.async.AsyncStage;
+import org.apache.zookeeper.Watcher;
+import java.util.Set;
+
+/**
+ * Builder for watcher removal
+ */
+public interface AsyncRemoveWatchesBuilder
+{
+ /**
+ * @param watcher the watcher to remove
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(Watcher watcher);
+
+ /**
+ * @param watcher the watcher to remove
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(CuratorWatcher watcher);
+
+ /**
+ * Remove all watchers
+ *
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removingAll();
+
+ /**
+ * @param watcher the watcher to remove
+ * @param options watcher removal options
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(Watcher watcher, Set<RemoveWatcherOption> options);
+
+ /**
+ * @param watcher the watcher to remove
+ * @param options watcher removal options
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(CuratorWatcher watcher, Set<RemoveWatcherOption> options);
+
+ /**
+ * Remove all watchers
+ *
+ * @param options watcher removal options
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removingAll(Set<RemoveWatcherOption> options);
+
+ /**
+ * Remove a watcher of a given type
+ *
+ * @param watcher the watcher to remove
+ * @param watcherType watcher type
+ * @param options watcher removal options
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(Watcher watcher, Watcher.WatcherType watcherType, Set<RemoveWatcherOption> options);
+
+ /**
+ * Remove a watcher of a given type
+ *
+ * @param watcher the watcher to remove
+ * @param watcherType watcher type
+ * @param options watcher removal options
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(CuratorWatcher watcher, Watcher.WatcherType watcherType, Set<RemoveWatcherOption> options);
+
+ /**
+ * Remove all watchers of a given type
+ *
+ * @param watcherType watcher type
+ * @param options watcher removal options
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removingAll(Watcher.WatcherType watcherType, Set<RemoveWatcherOption> options);
+
+ /**
+ * Remove a watcher of a given type
+ *
+ * @param watcher the watcher to remove
+ * @param watcherType watcher type
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(Watcher watcher, Watcher.WatcherType watcherType);
+
+ /**
+ * Remove a watcher of a given type
+ *
+ * @param watcher the watcher to remove
+ * @param watcherType watcher type
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removing(CuratorWatcher watcher, Watcher.WatcherType watcherType);
+
+ /**
+ * Remove all watchers of a given type
+ *
+ * @param watcherType watcher type
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Void>> removingAll(Watcher.WatcherType watcherType);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetACLBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetACLBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetACLBuilder.java
new file mode 100644
index 0000000..8503d2f
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetACLBuilder.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.AsyncStage;
+import org.apache.zookeeper.data.ACL;
+import org.apache.zookeeper.data.Stat;
+import java.util.List;
+
+/**
+ * Builder for setting ACLs
+ */
+public interface AsyncSetACLBuilder
+{
+ /**
+ * Set the given ACLs
+ *
+ * @param aclList ACLs to set
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Stat>> withACL(List<ACL> aclList);
+
+ /**
+ * Set the given ACLs only if the "a" version matches. By default -1 is used
+ * which matches all versions.
+ *
+ * @param aclList ACLs to set
+ * @param version "a" version
+ * @see org.apache.zookeeper.data.Stat#getAversion()
+ * @return this
+ */
+ AsyncPathable<AsyncStage<Stat>> withACL(List<ACL> aclList, int version);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetDataBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetDataBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetDataBuilder.java
new file mode 100644
index 0000000..848d0dd
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSetDataBuilder.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.AsyncStage;
+import org.apache.zookeeper.data.Stat;
+
+/**
+ * Builder for setting ZNode data
+ */
+public interface AsyncSetDataBuilder extends AsyncPathAndBytesable<AsyncStage<Stat>>
+{
+ /**
+ * Cause the data to be compressed using the configured compression provider
+ *
+ * @return this
+ */
+ AsyncPathAndBytesable<AsyncStage<Stat>> compressed();
+
+ /**
+ * Cause the data to be compressed using the configured compression provider.
+ * Only sets if the version matches. By default -1 is used
+ * which matches all versions.
+ *
+ * @param version version
+ * @return this
+ */
+ AsyncPathAndBytesable<AsyncStage<Stat>> compressedWithVersion(int version);
+
+ /**
+ * Only sets if the version matches. By default -1 is used
+ * which matches all versions.
+ *
+ * @param version version
+ * @return this
+ */
+ AsyncPathAndBytesable<AsyncStage<Stat>> withVersion(int version);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSyncBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSyncBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSyncBuilder.java
new file mode 100644
index 0000000..d24ba5d
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncSyncBuilder.java
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.AsyncStage;
+
+/**
+ * Builder for syncs
+ */
+public interface AsyncSyncBuilder extends
+ AsyncPathable<AsyncStage<Void>>
+{
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCheckBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCheckBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCheckBuilder.java
new file mode 100644
index 0000000..1e52fb4
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCheckBuilder.java
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.framework.api.transaction.CuratorOp;
+
+/**
+ * @see AsyncTransactionOp#check()
+ */
+public interface AsyncTransactionCheckBuilder extends AsyncPathable<CuratorOp>
+{
+ /**
+ * Use the given version (the default is -1)
+ *
+ * @param version version to use
+ * @return this
+ */
+ AsyncPathable<CuratorOp> withVersion(int version);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java
new file mode 100644
index 0000000..439db81
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionCreateBuilder.java
@@ -0,0 +1,66 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.framework.api.transaction.CuratorOp;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.data.ACL;
+import java.util.List;
+
+/**
+ * @see AsyncTransactionOp#create()
+ */
+public interface AsyncTransactionCreateBuilder extends AsyncPathAndBytesable<CuratorOp>
+{
+ /**
+ * Specify a mode for the create. The default is {@link org.apache.zookeeper.CreateMode#PERSISTENT}
+ *
+ * @param createMode mode
+ * @return this
+ */
+ AsyncPathable<CuratorOp> withMode(CreateMode createMode);
+
+ /**
+ * Set an ACL list (default is {@link org.apache.zookeeper.ZooDefs.Ids#OPEN_ACL_UNSAFE})
+ *
+ * @param aclList the ACL list to use
+ * @return this
+ */
+ AsyncPathable<CuratorOp> withACL(List<ACL> aclList);
+
+ /**
+ * Cause the data to be compressed using the configured compression provider
+ *
+ * @return this
+ */
+ AsyncPathable<CuratorOp> compressed();
+
+ /**
+ * Specify mode, acl list and compression
+ *
+ * @param createMode mode
+ * @param aclList the ACL list to use
+ * @param compressed true to compress
+ * @see #withMode(org.apache.zookeeper.CreateMode)
+ * @see #withACL(java.util.List)
+ * @see #compressed()
+ * @return this
+ */
+ AsyncPathable<CuratorOp> withOptions(CreateMode createMode, List<ACL> aclList, boolean compressed);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionDeleteBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionDeleteBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionDeleteBuilder.java
new file mode 100644
index 0000000..45b572f
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionDeleteBuilder.java
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.framework.api.transaction.CuratorOp;
+
+/**
+ * @see AsyncTransactionOp#delete()
+ */
+public interface AsyncTransactionDeleteBuilder extends AsyncPathable<CuratorOp>
+{
+ /**
+ * Changes the version number used. By default, -1 is used
+ *
+ * @param version version to use
+ * @return this
+ */
+ AsyncPathable<CuratorOp> withVersion(int version);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionOp.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionOp.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionOp.java
new file mode 100644
index 0000000..2c0554b
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionOp.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+/**
+ * Builds operations that can be committed as a transaction
+ * via {@link org.apache.curator.x.async.AsyncCuratorFramework#transaction()}
+ */
+public interface AsyncTransactionOp
+{
+ /**
+ * Start a create builder in the transaction
+ *
+ * @return builder object
+ */
+ AsyncTransactionCreateBuilder create();
+
+ /**
+ * Start a delete builder in the transaction
+ *
+ * @return builder object
+ */
+ AsyncTransactionDeleteBuilder delete();
+
+ /**
+ * Start a setData builder in the transaction
+ *
+ * @return builder object
+ */
+ AsyncTransactionSetDataBuilder setData();
+
+ /**
+ * Start a check builder in the transaction
+ *
+ * @return builder object
+ */
+ AsyncTransactionCheckBuilder check();
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionSetDataBuilder.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionSetDataBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionSetDataBuilder.java
new file mode 100644
index 0000000..7d41eb1
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/AsyncTransactionSetDataBuilder.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.framework.api.transaction.CuratorOp;
+
+/**
+ * @see AsyncTransactionOp#setData()
+ */
+public interface AsyncTransactionSetDataBuilder extends AsyncPathAndBytesable<CuratorOp>
+{
+ /**
+ * Changes the version number used. By default, -1 is used
+ *
+ * @param version version to use
+ * @return this
+ */
+ AsyncPathAndBytesable<CuratorOp> withVersion(int version);
+
+ /**
+ * Cause the data to be compressed using the configured compression provider
+ *
+ * @return this
+ */
+ AsyncPathAndBytesable<CuratorOp> compressed();
+
+ /**
+ * Cause the data to be compressed using the configured compression provider.
+ * Also changes the version number used. By default, -1 is used
+ *
+ * @param version version to use
+ * @return this
+ */
+ AsyncPathAndBytesable<CuratorOp> withVersionCompressed(int version);
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/CreateOption.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/CreateOption.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/CreateOption.java
new file mode 100644
index 0000000..c8d6db8
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/CreateOption.java
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+/**
+ * Options when creating ZNodes
+ */
+public enum CreateOption
+{
+ /**
+ * Causes any parent nodes to get created if they haven't already been
+ */
+ createParentsIfNeeded,
+
+ /**
+ * Causes any parent nodes to get created using {@link org.apache.zookeeper.CreateMode#CONTAINER} if they haven't already been.
+ * IMPORTANT NOTE: container creation is a new feature in recent versions of ZooKeeper.
+ * If the ZooKeeper version you're using does not support containers, the parent nodes
+ * are created as ordinary PERSISTENT nodes.
+ */
+ createParentsAsContainers,
+
+ /**
+ * <p>
+ * Hat-tip to https://github.com/sbridges for pointing this out
+ * </p>
+ *
+ * <p>
+ * It turns out there is an edge case that exists when creating sequential-ephemeral
+ * nodes. The creation can succeed on the server, but the server can crash before
+ * the created node name is returned to the client. However, the ZK session is still
+ * valid so the ephemeral node is not deleted. Thus, there is no way for the client to
+ * determine what node was created for them.
+ * </p>
+ *
+ * <p>
+ * Even without sequential-ephemeral, however, the create can succeed on the sever
+ * but the client (for various reasons) will not know it.
+ * </p>
+ *
+ * <p>
+ * Putting the create builder into protection mode works around this.
+ * The name of the node that is created is prefixed with a GUID. If node creation fails
+ * the normal retry mechanism will occur. On the retry, the parent path is first searched
+ * for a node that has the GUID in it. If that node is found, it is assumed to be the lost
+ * node that was successfully created on the first try and is returned to the caller.
+ * </p>
+ */
+ doProtected,
+
+ /**
+ * Cause the data to be compressed using the configured compression provider
+ */
+ compress,
+
+ /**
+ * If the ZNode already exists, Curator will instead call setData()
+ */
+ setDataIfExists
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/DeleteOption.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/DeleteOption.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/DeleteOption.java
new file mode 100644
index 0000000..b5cc167
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/DeleteOption.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+/**
+ * Options to use when deleting ZNodes
+ */
+public enum DeleteOption
+{
+ /**
+ * Prevents the reporting of {@link org.apache.zookeeper.KeeperException.NoNodeException}s.
+ * If the ZNode doesn't exist the delete method will appear to succeed.
+ */
+ quietly,
+
+ /**
+ * Will also delete children if they exist
+ */
+ deletingChildrenIfNeeded,
+
+ /**
+ * Solves edge cases where an operation may succeed on the server but connection failure occurs before a
+ * response can be successfully returned to the client.
+ *
+ * @see org.apache.curator.framework.api.GuaranteeableDeletable
+ */
+ guaranteed
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/ExistsOption.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/ExistsOption.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/ExistsOption.java
new file mode 100644
index 0000000..87490f0
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/ExistsOption.java
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+/**
+ * Options to use when checking for ZNode existence
+ */
+public enum ExistsOption
+{
+ /**
+ * see {@link CreateOption#createParentsIfNeeded}
+ */
+ createParentsIfNeeded,
+
+ /**
+ * see {@link CreateOption#createParentsAsContainers}
+ */
+ createParentsAsContainers
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/RemoveWatcherOption.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/RemoveWatcherOption.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/RemoveWatcherOption.java
new file mode 100644
index 0000000..e4f6add
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/RemoveWatcherOption.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+/**
+ * Options to use when removing watchers
+ */
+public enum RemoveWatcherOption
+{
+ /**
+ * Solves edge cases where an operation may succeed on the server but connection failure occurs before a
+ * response can be successfully returned to the client.
+ *
+ * @see org.apache.curator.framework.api.GuaranteeableDeletable
+ */
+ guaranteed,
+
+ /**
+ * Specify if the client should just remove client side watches if a connection to ZK
+ * is not available. Note that the standard Curator retry loop will not be used in t
+ */
+ local,
+
+ /**
+ * Prevents the reporting of {@link org.apache.zookeeper.KeeperException.NoNodeException}s.
+ * If the watcher doesn't exist the remove method will appear to succeed.
+ */
+ quietly
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/api/WatchedAsyncCuratorFramework.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/api/WatchedAsyncCuratorFramework.java b/curator-x-async/src/main/java/org/apache/curator/x/async/api/WatchedAsyncCuratorFramework.java
new file mode 100644
index 0000000..7e284a3
--- /dev/null
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/api/WatchedAsyncCuratorFramework.java
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.curator.x.async.api;
+
+import org.apache.curator.x.async.api.AsyncExistsBuilder;
+import org.apache.curator.x.async.api.AsyncGetChildrenBuilder;
+import org.apache.curator.x.async.api.AsyncGetConfigBuilder;
+import org.apache.curator.x.async.api.AsyncGetDataBuilder;
+
+/**
+ * operations that support watching
+ */
+public interface WatchedAsyncCuratorFramework
+{
+ /**
+ * Start an exists builder. The builder will return a Stat object as if org.apache.zookeeper.ZooKeeper.exists() were called. Thus, a null
+ * means that it does not exist and an actual Stat object means it does exist.
+ *
+ * @return builder object
+ */
+ AsyncExistsBuilder checkExists();
+
+ /**
+ * Start a get data builder
+ *
+ * @return builder object
+ */
+ AsyncGetDataBuilder getData();
+
+ /**
+ * Start a get children builder
+ *
+ * @return builder object
+ */
+ AsyncGetChildrenBuilder getChildren();
+
+ /**
+ * Start a getConfig builder
+ *
+ * @return builder object
+ */
+ AsyncGetConfigBuilder getConfig();
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
index 60483ef..ce5b31e 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCreateBuilderImpl.java
@@ -21,10 +21,10 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CreateBuilderImpl;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
-import org.apache.curator.x.async.AsyncCreateBuilder;
-import org.apache.curator.x.async.AsyncPathAndBytesable;
+import org.apache.curator.x.async.api.AsyncCreateBuilder;
+import org.apache.curator.x.async.api.AsyncPathAndBytesable;
import org.apache.curator.x.async.AsyncStage;
-import org.apache.curator.x.async.CreateOption;
+import org.apache.curator.x.async.api.CreateOption;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
index 19b1b2e..057f8e1 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncCuratorFrameworkImpl.java
@@ -26,6 +26,7 @@ import org.apache.curator.framework.imps.CuratorMultiTransactionImpl;
import org.apache.curator.framework.imps.GetACLBuilderImpl;
import org.apache.curator.framework.imps.SyncBuilderImpl;
import org.apache.curator.x.async.*;
+import org.apache.curator.x.async.api.*;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;
import java.util.List;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
index 06363db..54073b0 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncDeleteBuilderImpl.java
@@ -21,10 +21,10 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.DeleteBuilderImpl;
-import org.apache.curator.x.async.AsyncDeleteBuilder;
-import org.apache.curator.x.async.AsyncPathable;
+import org.apache.curator.x.async.api.AsyncDeleteBuilder;
+import org.apache.curator.x.async.api.AsyncPathable;
import org.apache.curator.x.async.AsyncStage;
-import org.apache.curator.x.async.DeleteOption;
+import org.apache.curator.x.async.api.DeleteOption;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
index 4cf8e2d..c77a0aa 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncExistsBuilderImpl.java
@@ -21,10 +21,10 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.ExistsBuilderImpl;
-import org.apache.curator.x.async.AsyncExistsBuilder;
-import org.apache.curator.x.async.AsyncPathable;
+import org.apache.curator.x.async.api.AsyncExistsBuilder;
+import org.apache.curator.x.async.api.AsyncPathable;
import org.apache.curator.x.async.AsyncStage;
-import org.apache.curator.x.async.ExistsOption;
+import org.apache.curator.x.async.api.ExistsOption;
import org.apache.zookeeper.data.Stat;
import java.util.Collections;
import java.util.Objects;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
index 17fd102..b429c58 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetChildrenBuilderImpl.java
@@ -21,8 +21,8 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.GetChildrenBuilderImpl;
-import org.apache.curator.x.async.AsyncGetChildrenBuilder;
-import org.apache.curator.x.async.AsyncPathable;
+import org.apache.curator.x.async.api.AsyncGetChildrenBuilder;
+import org.apache.curator.x.async.api.AsyncPathable;
import org.apache.curator.x.async.AsyncStage;
import org.apache.zookeeper.data.Stat;
import java.util.List;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
index ba72acb..7ecb18a 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetConfigBuilderImpl.java
@@ -21,8 +21,8 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.GetConfigBuilderImpl;
-import org.apache.curator.x.async.AsyncEnsemblable;
-import org.apache.curator.x.async.AsyncGetConfigBuilder;
+import org.apache.curator.x.async.api.AsyncEnsemblable;
+import org.apache.curator.x.async.api.AsyncGetConfigBuilder;
import org.apache.curator.x.async.AsyncStage;
import org.apache.zookeeper.data.Stat;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
index 78d44ae..7214cd8 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncGetDataBuilderImpl.java
@@ -21,8 +21,8 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.GetDataBuilderImpl;
-import org.apache.curator.x.async.AsyncGetDataBuilder;
-import org.apache.curator.x.async.AsyncPathable;
+import org.apache.curator.x.async.api.AsyncGetDataBuilder;
+import org.apache.curator.x.async.api.AsyncPathable;
import org.apache.curator.x.async.AsyncStage;
import org.apache.zookeeper.data.Stat;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
index a73800b..f6a097e 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncReconfigBuilderImpl.java
@@ -21,8 +21,8 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.ReconfigBuilderImpl;
-import org.apache.curator.x.async.AsyncEnsemblable;
-import org.apache.curator.x.async.AsyncReconfigBuilder;
+import org.apache.curator.x.async.api.AsyncEnsemblable;
+import org.apache.curator.x.async.api.AsyncReconfigBuilder;
import org.apache.curator.x.async.AsyncStage;
import org.apache.zookeeper.data.Stat;
import java.util.List;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
index ae5bb09..7e9e091 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncRemoveWatchesBuilderImpl.java
@@ -22,10 +22,10 @@ import org.apache.curator.framework.api.CuratorWatcher;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.RemoveWatchesBuilderImpl;
-import org.apache.curator.x.async.AsyncPathable;
-import org.apache.curator.x.async.AsyncRemoveWatchesBuilder;
+import org.apache.curator.x.async.api.AsyncPathable;
+import org.apache.curator.x.async.api.AsyncRemoveWatchesBuilder;
import org.apache.curator.x.async.AsyncStage;
-import org.apache.curator.x.async.RemoveWatcherOption;
+import org.apache.curator.x.async.api.RemoveWatcherOption;
import org.apache.zookeeper.Watcher;
import java.util.Collections;
import java.util.Objects;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
index fdf1ea8..b5f5a06 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java
@@ -21,8 +21,8 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.SetACLBuilderImpl;
-import org.apache.curator.x.async.AsyncPathable;
-import org.apache.curator.x.async.AsyncSetACLBuilder;
+import org.apache.curator.x.async.api.AsyncPathable;
+import org.apache.curator.x.async.api.AsyncSetACLBuilder;
import org.apache.curator.x.async.AsyncStage;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Stat;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
index 9216af9..3df52b9 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetDataBuilderImpl.java
@@ -21,8 +21,8 @@ package org.apache.curator.x.async.details;
import org.apache.curator.framework.api.UnhandledErrorListener;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
import org.apache.curator.framework.imps.SetDataBuilderImpl;
-import org.apache.curator.x.async.AsyncPathAndBytesable;
-import org.apache.curator.x.async.AsyncSetDataBuilder;
+import org.apache.curator.x.async.api.AsyncPathAndBytesable;
+import org.apache.curator.x.async.api.AsyncSetDataBuilder;
import org.apache.curator.x.async.AsyncStage;
import org.apache.zookeeper.data.Stat;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
index 744dace..89f0a22 100644
--- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
+++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncTransactionOpImpl.java
@@ -25,13 +25,13 @@ import org.apache.curator.framework.api.transaction.CuratorOp;
import org.apache.curator.framework.api.transaction.TransactionCreateBuilder;
import org.apache.curator.framework.api.transaction.TransactionSetDataBuilder;
import org.apache.curator.framework.imps.CuratorFrameworkImpl;
-import org.apache.curator.x.async.AsyncPathAndBytesable;
-import org.apache.curator.x.async.AsyncPathable;
-import org.apache.curator.x.async.AsyncTransactionCheckBuilder;
-import org.apache.curator.x.async.AsyncTransactionCreateBuilder;
-import org.apache.curator.x.async.AsyncTransactionDeleteBuilder;
-import org.apache.curator.x.async.AsyncTransactionOp;
-import org.apache.curator.x.async.AsyncTransactionSetDataBuilder;
+import org.apache.curator.x.async.api.AsyncPathAndBytesable;
+import org.apache.curator.x.async.api.AsyncPathable;
+import org.apache.curator.x.async.api.AsyncTransactionCheckBuilder;
+import org.apache.curator.x.async.api.AsyncTransactionCreateBuilder;
+import org.apache.curator.x.async.api.AsyncTransactionDeleteBuilder;
+import org.apache.curator.x.async.api.AsyncTransactionOp;
+import org.apache.curator.x.async.api.AsyncTransactionSetDataBuilder;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.data.ACL;
import java.util.List;
http://git-wip-us.apache.org/repos/asf/curator/blob/476d55fe/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
----------------------------------------------------------------------
diff --git a/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java b/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
index eca679e..2e0fb4d 100644
--- a/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
+++ b/curator-x-async/src/test/java/org/apache/curator/x/async/TestBasicOperations.java
@@ -35,8 +35,8 @@ import java.util.concurrent.ExecutionException;
import java.util.function.BiConsumer;
import static java.util.EnumSet.of;
-import static org.apache.curator.x.async.CreateOption.compress;
-import static org.apache.curator.x.async.CreateOption.setDataIfExists;
+import static org.apache.curator.x.async.api.CreateOption.compress;
+import static org.apache.curator.x.async.api.CreateOption.setDataIfExists;
import static org.apache.zookeeper.CreateMode.EPHEMERAL_SEQUENTIAL;
public class TestBasicOperations extends BaseClassForTests