Finished first pass, added license, etc.
Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/394eb900 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/394eb900 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/394eb900 Branch: refs/heads/CURATOR-3.0 Commit: 394eb9008f226433d983b3ffde31abd6a49f4571 Parents: 10170c2 Author: randgalt <randg...@apache.org> Authored: Fri Jan 6 13:10:40 2017 -0500 Committer: randgalt <randg...@apache.org> Committed: Fri Jan 6 13:10:40 2017 -0500 ---------------------------------------------------------------------- .../curator/framework/CuratorFramework.java | 1 + .../framework/imps/GetACLBuilderImpl.java | 9 +- .../framework/imps/SetACLBuilderImpl.java | 10 +- .../curator/x/async/AsyncCreateBuilder.java | 18 ++ .../curator/x/async/AsyncCuratorFramework.java | 26 +- .../x/async/AsyncCuratorFrameworkDsl.java | 27 +- .../curator/x/async/AsyncExistsBuilder.java | 18 ++ .../curator/x/async/AsyncGetACLBuilder.java | 35 +++ .../curator/x/async/AsyncGetConfigBuilder.java | 18 ++ .../curator/x/async/AsyncGetDataBuilder.java | 18 ++ .../curator/x/async/AsyncReconfigBuilder.java | 18 ++ .../x/async/AsyncRemoveWatchesBuilder.java | 18 ++ .../curator/x/async/AsyncSetACLBuilder.java | 30 +++ .../org/apache/curator/x/async/AsyncStage.java | 18 ++ .../curator/x/async/AsyncSyncBuilder.java | 18 ++ .../x/async/AsyncTransactionCheckBuilder.java | 18 ++ .../x/async/AsyncTransactionCreateBuilder.java | 18 ++ .../x/async/AsyncTransactionDeleteBuilder.java | 18 ++ .../x/async/AsyncTransactionSetDataBuilder.java | 18 ++ .../apache/curator/x/async/CreateOption.java | 18 ++ .../apache/curator/x/async/DeleteOption.java | 18 ++ .../curator/x/async/RemoveWatcherOption.java | 18 ++ .../x/async/WatchedAsyncCuratorFramework.java | 18 ++ .../x/async/details/AsyncCreateBuilderImpl.java | 18 ++ .../details/AsyncCuratorFrameworkImpl.java | 69 ++++- .../x/async/details/AsyncDeleteBuilderImpl.java | 18 ++ .../x/async/details/AsyncExistsBuilderImpl.java | 18 ++ .../details/AsyncGetChildrenBuilderImpl.java | 18 ++ .../details/AsyncGetConfigBuilderImpl.java | 18 ++ .../async/details/AsyncGetDataBuilderImpl.java | 18 ++ .../async/details/AsyncReconfigBuilderImpl.java | 18 ++ .../details/AsyncRemoveWatchesBuilderImpl.java | 18 ++ .../x/async/details/AsyncSetACLBuilderImpl.java | 69 +++++ .../async/details/AsyncSetDataBuilderImpl.java | 18 ++ .../x/async/details/AsyncTransactionOpImpl.java | 18 ++ .../x/async/details/BackgroundProcs.java | 18 ++ .../curator/x/async/details/BuilderCommon.java | 18 ++ curator-x-crimps/pom.xml | 42 --- .../org/apache/curator/x/crimps/Crimps.java | 46 ---- .../x/crimps/async/AsyncCuratorFramework.java | 46 ---- .../crimps/async/AsyncCuratorFrameworkDsl.java | 124 --------- .../x/crimps/async/AsyncDeleteBuilder.java | 31 --- .../x/crimps/async/AsyncGetChildrenBuilder.java | 29 -- .../x/crimps/async/AsyncMultiTransaction.java | 37 --- .../x/crimps/async/AsyncPathAndBytesable.java | 32 --- .../curator/x/crimps/async/AsyncPathable.java | 31 --- .../x/crimps/async/AsyncSetDataBuilder.java | 36 --- .../async/AsyncWatchedGetChildrenBuilder.java | 29 -- .../curator/x/crimps/async/DeleteOption.java | 8 - .../async/WatchedAsyncCuratorFramework.java | 63 ----- .../x/crimps/async/details/AsyncCrimps.java | 264 ------------------- .../x/crimps/async/details/BackgroundProc.java | 27 -- .../curator/x/crimps/async/details/Crimped.java | 27 -- .../details/CrimpedBackgroundCallback.java | 50 ---- .../details/CrimpedConfigEnsembleable.java | 30 --- .../async/details/CrimpedEnsembleable.java | 29 -- .../async/details/CrimpedEnsembleableImpl.java | 84 ------ .../x/crimps/async/details/CrimpedPathable.java | 30 --- .../details/CrimpedWatchedEnsembleable.java | 28 -- .../details/CrimpedWatchedEnsembleableImpl.java | 83 ------ .../x/crimps/async/details/CrimpedWatcher.java | 60 ----- .../async/details/CrimpledEnsembleable.java | 24 -- .../async/details/CrimpledPathAndBytesable.java | 32 --- .../details/CrimpledPathAndBytesableImpl.java | 92 ------- .../async/imps/AsyncCuratorFrameworkImpl.java | 144 ---------- .../async/imps/AsyncDeleteBuilderImpl.java | 66 ----- .../async/imps/AsyncGetChildrenBuilderImpl.java | 42 --- .../async/imps/AsyncSetDataBuilderImpl.java | 68 ----- .../imps/WatchedAsyncCuratorFrameworkImpl.java | 58 ---- .../curator/x/crimps/async/TestCrimps.java | 258 ------------------ pom.xml | 1 - 71 files changed, 761 insertions(+), 2070 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java index 9423631..4135e82 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java @@ -25,6 +25,7 @@ import org.apache.curator.framework.api.transaction.CuratorMultiTransaction; import org.apache.curator.framework.api.transaction.CuratorOp; import org.apache.curator.framework.api.transaction.CuratorTransaction; import org.apache.curator.framework.api.transaction.TransactionOp; +import org.apache.curator.framework.imps.CuratorFrameworkImpl; import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.framework.listen.Listenable; import org.apache.curator.framework.schema.SchemaSet; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-framework/src/main/java/org/apache/curator/framework/imps/GetACLBuilderImpl.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/GetACLBuilderImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/GetACLBuilderImpl.java index e60b0da..620242b 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/GetACLBuilderImpl.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/GetACLBuilderImpl.java @@ -33,7 +33,7 @@ import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.Executor; -class GetACLBuilderImpl implements GetACLBuilder, BackgroundOperation<String>, ErrorListenerPathable<List<ACL>> +public class GetACLBuilderImpl implements GetACLBuilder, BackgroundOperation<String>, ErrorListenerPathable<List<ACL>> { private final CuratorFrameworkImpl client; @@ -47,6 +47,13 @@ class GetACLBuilderImpl implements GetACLBuilder, BackgroundOperation<String>, E responseStat = new Stat(); } + public GetACLBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, Stat responseStat) + { + this.client = client; + this.backgrounding = backgrounding; + this.responseStat = responseStat; + } + @Override public ErrorListenerPathable<List<ACL>> inBackground(BackgroundCallback callback, Object context) { http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-framework/src/main/java/org/apache/curator/framework/imps/SetACLBuilderImpl.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/SetACLBuilderImpl.java b/curator-framework/src/main/java/org/apache/curator/framework/imps/SetACLBuilderImpl.java index 738e82f..a80be81 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/imps/SetACLBuilderImpl.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/SetACLBuilderImpl.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.Executor; -class SetACLBuilderImpl implements SetACLBuilder, BackgroundPathable<Stat>, BackgroundOperation<String>, ErrorListenerPathable<Stat> +public class SetACLBuilderImpl implements SetACLBuilder, BackgroundPathable<Stat>, BackgroundOperation<String>, ErrorListenerPathable<Stat> { private final CuratorFrameworkImpl client; @@ -48,6 +48,14 @@ class SetACLBuilderImpl implements SetACLBuilder, BackgroundPathable<Stat>, Back version = -1; } + public SetACLBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, List<ACL> aclList, int version) + { + this.client = client; + this.acling = new ACLing(client.getAclProvider(), aclList); + this.version = version; + this.backgrounding = backgrounding; + } + @Override public BackgroundPathable<Stat> withACL(List<ACL> aclList) { http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCreateBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCreateBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCreateBuilder.java index 7e28398..fbcf99c 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCreateBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCreateBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.zookeeper.CreateMode; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java index 604be98..9751af6 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFramework.java @@ -1,15 +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; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.api.UnhandledErrorListener; -import org.apache.curator.framework.api.transaction.CuratorOp; -import org.apache.curator.framework.api.transaction.TransactionOp; +import org.apache.curator.x.async.details.AsyncCuratorFrameworkImpl; /** * Zookeeper framework-style client */ public interface AsyncCuratorFramework extends AsyncCuratorFrameworkDsl { + static AsyncCuratorFramework wrap(CuratorFramework client) + { + return new AsyncCuratorFrameworkImpl(client); + } + CuratorFramework unwrap(); WatchedAsyncCuratorFramework watched(); http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFrameworkDsl.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFrameworkDsl.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFrameworkDsl.java index b7e03d1..4a3880e 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFrameworkDsl.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncCuratorFrameworkDsl.java @@ -1,10 +1,23 @@ +/** + * 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; -import org.apache.curator.framework.api.GetACLBuilder; -import org.apache.curator.framework.api.ReconfigBuilder; -import org.apache.curator.framework.api.RemoveWatchesBuilder; -import org.apache.curator.framework.api.SetACLBuilder; -import org.apache.curator.framework.api.SyncBuilder; import org.apache.curator.framework.api.transaction.CuratorOp; /** @@ -38,14 +51,14 @@ public interface AsyncCuratorFrameworkDsl extends WatchedAsyncCuratorFramework * * @return builder object */ - GetACLBuilder getACL(); + AsyncGetACLBuilder getACL(); /** * Start a set ACL builder * * @return builder object */ - SetACLBuilder setACL(); + AsyncSetACLBuilder setACL(); /** * Start a reconfig builder http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncExistsBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncExistsBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncExistsBuilder.java index 2ee1099..6f8d861 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncExistsBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncExistsBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.zookeeper.CreateMode; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetACLBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetACLBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetACLBuilder.java new file mode 100644 index 0000000..5fd3685 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetACLBuilder.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; + +import org.apache.zookeeper.data.ACL; +import org.apache.zookeeper.data.Stat; +import java.util.List; + +public interface AsyncGetACLBuilder extends + AsyncPathable<AsyncStage<List<ACL>>> +{ + /** + * Have the operation fill the provided stat object + * + * @param stat the stat to have filled in + * @return this + */ + AsyncPathable<AsyncStage<List<ACL>>> storingStatIn(Stat stat); +} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetConfigBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetConfigBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetConfigBuilder.java index 19e5b6a..a6c0b10 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetConfigBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetConfigBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.zookeeper.data.Stat; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetDataBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetDataBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetDataBuilder.java index 0712f43..a3932ee 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetDataBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncGetDataBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.zookeeper.data.Stat; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncReconfigBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncReconfigBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncReconfigBuilder.java index 75b898e..f7d2eba 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncReconfigBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncReconfigBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.zookeeper.data.Stat; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncRemoveWatchesBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncRemoveWatchesBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncRemoveWatchesBuilder.java index fe8efa1..559d826 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncRemoveWatchesBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncRemoveWatchesBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.curator.framework.api.CuratorWatcher; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSetACLBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSetACLBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSetACLBuilder.java new file mode 100644 index 0000000..274e7b7 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSetACLBuilder.java @@ -0,0 +1,30 @@ +/** + * 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; + +import org.apache.zookeeper.data.ACL; +import org.apache.zookeeper.data.Stat; +import java.util.List; + +public interface AsyncSetACLBuilder +{ + AsyncPathable<AsyncStage<Stat>> withACL(List<ACL> aclList); + + AsyncPathable<AsyncStage<Stat>> withACL(List<ACL> aclList, int version); +} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncStage.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncStage.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncStage.java index bae7165..5f83d9c 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncStage.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncStage.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.zookeeper.WatchedEvent; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSyncBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSyncBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSyncBuilder.java index 0289aa7..9a218aa 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSyncBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncSyncBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; public interface AsyncSyncBuilder extends http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCheckBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCheckBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCheckBuilder.java index 032029d..eeb57e4 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCheckBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCheckBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.curator.framework.api.transaction.CuratorOp; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCreateBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCreateBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCreateBuilder.java index a94a011..d852e76 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCreateBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionCreateBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.curator.framework.api.transaction.CuratorOp; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionDeleteBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionDeleteBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionDeleteBuilder.java index 984999e..f4f68d4 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionDeleteBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionDeleteBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.curator.framework.api.transaction.CuratorOp; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionSetDataBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionSetDataBuilder.java b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionSetDataBuilder.java index dfb1b9a..8f91f10 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionSetDataBuilder.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/AsyncTransactionSetDataBuilder.java @@ -1,3 +1,21 @@ +/** + * 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; import org.apache.curator.framework.api.transaction.CuratorOp; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/CreateOption.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/CreateOption.java b/curator-x-async/src/main/java/org/apache/curator/x/async/CreateOption.java index 5c7b741..4397b71 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/CreateOption.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/CreateOption.java @@ -1,3 +1,21 @@ +/** + * 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; public enum CreateOption http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/DeleteOption.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/DeleteOption.java b/curator-x-async/src/main/java/org/apache/curator/x/async/DeleteOption.java index 73d1866..6a58598 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/DeleteOption.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/DeleteOption.java @@ -1,3 +1,21 @@ +/** + * 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; public enum DeleteOption http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/RemoveWatcherOption.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/RemoveWatcherOption.java b/curator-x-async/src/main/java/org/apache/curator/x/async/RemoveWatcherOption.java index e4e8688..0603da2 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/RemoveWatcherOption.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/RemoveWatcherOption.java @@ -1,3 +1,21 @@ +/** + * 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; public enum RemoveWatcherOption http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/WatchedAsyncCuratorFramework.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/WatchedAsyncCuratorFramework.java b/curator-x-async/src/main/java/org/apache/curator/x/async/WatchedAsyncCuratorFramework.java index 62f03ed..8e8618d 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/WatchedAsyncCuratorFramework.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/WatchedAsyncCuratorFramework.java @@ -1,3 +1,21 @@ +/** + * 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; /** http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 921cc0d..53a44b7 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 2bb922b..6111312 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 @@ -1,17 +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.details; import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.api.GetACLBuilder; -import org.apache.curator.framework.api.ReconfigBuilder; -import org.apache.curator.framework.api.RemoveWatchesBuilder; -import org.apache.curator.framework.api.SetACLBuilder; import org.apache.curator.framework.api.UnhandledErrorListener; import org.apache.curator.framework.api.transaction.CuratorTransactionResult; import org.apache.curator.framework.imps.CuratorFrameworkImpl; 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.zookeeper.data.ACL; +import org.apache.zookeeper.data.Stat; import java.util.List; +import java.util.Objects; import static org.apache.curator.x.async.details.BackgroundProcs.*; @@ -21,6 +39,23 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework private final UnhandledErrorListener unhandledErrorListener; private final boolean watched; + public AsyncCuratorFrameworkImpl(CuratorFramework client) + { + this(reveal(client), null, false); + } + + private static CuratorFrameworkImpl reveal(CuratorFramework client) + { + try + { + return (CuratorFrameworkImpl)Objects.requireNonNull(client, "client cannot be null"); + } + catch ( Exception e ) + { + throw new IllegalArgumentException("Only Curator clients created through CuratorFrameworkFactory are supported: " + client.getClass().getName()); + } + } + public AsyncCuratorFrameworkImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener, boolean watched) { this.client = client; @@ -47,15 +82,33 @@ public class AsyncCuratorFrameworkImpl implements AsyncCuratorFramework } @Override - public GetACLBuilder getACL() + public AsyncGetACLBuilder getACL() { - return null; + return new AsyncGetACLBuilder() + { + private Stat stat = null; + + @Override + public AsyncPathable<AsyncStage<List<ACL>>> storingStatIn(Stat stat) + { + this.stat = stat; + return this; + } + + @Override + public AsyncStage<List<ACL>> forPath(String path) + { + BuilderCommon<List<ACL>> common = new BuilderCommon<>(unhandledErrorListener, false, aclProc); + GetACLBuilderImpl builder = new GetACLBuilderImpl(client, common.backgrounding, stat); + return safeCall(common.internalCallback, () -> builder.forPath(path)); + } + }; } @Override - public SetACLBuilder setACL() + public AsyncSetACLBuilder setACL() { - return null; + return new AsyncSetACLBuilderImpl(client, unhandledErrorListener); } @Override http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 f7c1cb6..7395915 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 24df834..e8b529a 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 d9b505a..17fd102 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 5673e29..ba72acb 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 b87061d..78d44ae 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 ce0c21e..a73800b 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 553cd68..4e6b41c 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.CuratorWatcher; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 new file mode 100644 index 0000000..fdf1ea8 --- /dev/null +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/AsyncSetACLBuilderImpl.java @@ -0,0 +1,69 @@ +/** + * 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.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.AsyncStage; +import org.apache.zookeeper.data.ACL; +import org.apache.zookeeper.data.Stat; +import java.util.List; + +import static org.apache.curator.x.async.details.BackgroundProcs.safeCall; +import static org.apache.curator.x.async.details.BackgroundProcs.statProc; + +class AsyncSetACLBuilderImpl implements AsyncSetACLBuilder, AsyncPathable<AsyncStage<Stat>> +{ + private final CuratorFrameworkImpl client; + private final UnhandledErrorListener unhandledErrorListener; + private int version = -1; + private List<ACL> aclList = null; + + AsyncSetACLBuilderImpl(CuratorFrameworkImpl client, UnhandledErrorListener unhandledErrorListener) + { + this.client = client; + this.unhandledErrorListener = unhandledErrorListener; + } + + @Override + public AsyncPathable<AsyncStage<Stat>> withACL(List<ACL> aclList) + { + this.aclList = aclList; + return this; + } + + @Override + public AsyncPathable<AsyncStage<Stat>> withACL(List<ACL> aclList, int version) + { + this.aclList = aclList; + this.version = version; + return this; + } + + @Override + public AsyncStage<Stat> forPath(String path) + { + BuilderCommon<Stat> common = new BuilderCommon<>(unhandledErrorListener, false, statProc); + SetACLBuilderImpl builder = new SetACLBuilderImpl(client, common.backgrounding, aclList, version); + return safeCall(common.internalCallback, () -> builder.forPath(path)); + } +} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 1d298fc..eb05666 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/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 02506c1..744dace 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 @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.ACLCreateModePathAndBytesable; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/details/BackgroundProcs.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/BackgroundProcs.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/BackgroundProcs.java index 81fba5e..944a82e 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/BackgroundProcs.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/BackgroundProcs.java @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.CuratorEvent; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java ---------------------------------------------------------------------- diff --git a/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java b/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java index 22e8559..56cd462 100644 --- a/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java +++ b/curator-x-async/src/main/java/org/apache/curator/x/async/details/BuilderCommon.java @@ -1,3 +1,21 @@ +/** + * 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.details; import org.apache.curator.framework.api.UnhandledErrorListener; http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/pom.xml ---------------------------------------------------------------------- diff --git a/curator-x-crimps/pom.xml b/curator-x-crimps/pom.xml deleted file mode 100644 index fd43b3f..0000000 --- a/curator-x-crimps/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <groupId>org.apache.curator</groupId> - <artifactId>apache-curator</artifactId> - <version>3.2.2-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>curator-x-crimps</artifactId> - - <dependencies> - <dependency> - <groupId>org.apache.curator</groupId> - <artifactId>curator-framework</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.curator</groupId> - <artifactId>curator-test</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - </plugins> - </build> -</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/Crimps.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/Crimps.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/Crimps.java deleted file mode 100644 index e3ecaa4..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/Crimps.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.crimps; - -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.x.crimps.async.AsyncCuratorFramework; -import org.apache.curator.x.crimps.async.details.AsyncCrimps; -import org.apache.curator.x.crimps.async.imps.AsyncCuratorFrameworkImpl; - -public class Crimps -{ - public static AsyncCrimps async() - { - return new AsyncCrimps(null); - } - - public static AsyncCuratorFramework async(CuratorFramework client) - { - return async(client, async()); - } - - public static AsyncCuratorFramework async(CuratorFramework client, AsyncCrimps async) - { - return new AsyncCuratorFrameworkImpl(client, async, null); - } - - private Crimps() - { - } -} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFramework.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFramework.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFramework.java deleted file mode 100644 index 95e633d..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFramework.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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.crimps.async; - -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.api.*; -import org.apache.curator.framework.api.transaction.CuratorOp; -import org.apache.curator.framework.api.transaction.TransactionOp; - -/** - * Zookeeper framework-style client - */ -public interface AsyncCuratorFramework extends AsyncCuratorFrameworkDsl -{ - CuratorFramework getCuratorFramework(); - - WatchedAsyncCuratorFramework watched(); - - AsyncCuratorFrameworkDsl withUnhandledErrorListener(UnhandledErrorListener listener); - - /** - * Allocate an operation that can be used with {@link #transaction()}. - * NOTE: {@link CuratorOp} instances created by this builder are - * reusable. - * - * @return operation builder - */ - TransactionOp transactionOp(); -} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFrameworkDsl.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFrameworkDsl.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFrameworkDsl.java deleted file mode 100644 index a848b90..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncCuratorFrameworkDsl.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 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.crimps.async; - -import org.apache.curator.framework.api.*; -import java.util.List; -import java.util.concurrent.CompletionStage; - -/** - * Zookeeper framework-style client - */ -public interface AsyncCuratorFrameworkDsl -{ - /** - * Start a create builder - * - * @return builder object - */ - CreateBuilder create(); - - /** - * Start a delete builder - * - * @return builder object - */ - AsyncDeleteBuilder delete(); - - /** - * Start an exists builder - * <p> - * 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 - */ - ExistsBuilder checkExists(); - - /** - * Start a get data builder - * - * @return builder object - */ - GetDataBuilder getData(); - - /** - * Start a set data builder - * - * @return builder object - */ - AsyncSetDataBuilder setData(); - - /** - * Start a get children builder - * - * @return builder object - */ - AsyncGetChildrenBuilder<CompletionStage<List<String>>> getChildren(); - - /** - * Start a get ACL builder - * - * @return builder object - */ - GetACLBuilder getACL(); - - /** - * Start a set ACL builder - * - * @return builder object - */ - SetACLBuilder setACL(); - - /** - * Start a reconfig builder - * - * @return builder object - */ - ReconfigBuilder reconfig(); - - /** - * Start a getConfig builder - * - * @return builder object - */ - GetConfigBuilder getConfig(); - - /** - * Start a transaction builder - * - * @return builder object - */ - AsyncMultiTransaction transaction(); - - /** - * Start a sync builder. Note: sync is ALWAYS in the background even - * if you don't use one of the background() methods - * - * @return builder object - */ - SyncBuilder sync(); - - /** - * Start a remove watches builder. - * @return builder object - */ - RemoveWatchesBuilder watches(); -} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncDeleteBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncDeleteBuilder.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncDeleteBuilder.java deleted file mode 100644 index 0fb728c..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncDeleteBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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.crimps.async; - -import java.util.Set; -import java.util.concurrent.CompletionStage; - -public interface AsyncDeleteBuilder extends AsyncPathable<CompletionStage<Void>> -{ - AsyncPathable<CompletionStage<Void>> withOptions(Set<DeleteOption> options); - - AsyncPathable<CompletionStage<Void>> withOptionsAndVersion(Set<DeleteOption> options, int version); - - AsyncPathable<CompletionStage<Void>> withVersion(int version); -} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncGetChildrenBuilder.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncGetChildrenBuilder.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncGetChildrenBuilder.java deleted file mode 100644 index 90e0f4d..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncGetChildrenBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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.crimps.async; - -import org.apache.curator.framework.api.Statable; -import java.util.List; -import java.util.concurrent.CompletionStage; - -public interface AsyncGetChildrenBuilder<T> extends - AsyncPathable<T>, - Statable<AsyncPathable<T>> -{ -} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncMultiTransaction.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncMultiTransaction.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncMultiTransaction.java deleted file mode 100644 index 1a7652c..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncMultiTransaction.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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.crimps.async; - -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.api.transaction.CuratorOp; -import org.apache.curator.framework.api.transaction.CuratorTransactionResult; -import java.util.List; -import java.util.concurrent.CompletionStage; - -public interface AsyncMultiTransaction -{ - /** - * Commit the given operations as a single transaction. Create the - * operation instances via {@link CuratorFramework#transactionOp()} - * - * @param operations operations that make up the transaction. - * @return result details for foreground operations or <code>null</code> for background operations - */ - CompletionStage<List<CuratorTransactionResult>> forOperations(List<CuratorOp> operations); -} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathAndBytesable.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathAndBytesable.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathAndBytesable.java deleted file mode 100644 index f90722b..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathAndBytesable.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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.crimps.async; - -public interface AsyncPathAndBytesable<T> extends AsyncPathable<T> -{ - /** - * Commit the currently building operation using the given path and data - * - * @param path the path - * @param data the data - * @return operation result if any - */ - T forPath(String path, byte[] data); -} http://git-wip-us.apache.org/repos/asf/curator/blob/394eb900/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathable.java ---------------------------------------------------------------------- diff --git a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathable.java b/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathable.java deleted file mode 100644 index a8f4e8f..0000000 --- a/curator-x-crimps/src/main/java/org/apache/curator/x/crimps/async/AsyncPathable.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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.crimps.async; - -public interface AsyncPathable<T> -{ - /** - * Commit the currently building operation using the given path - * - * @param path the path - * @return operation result if any - */ - T forPath(String path); -}