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 2014/06/07 20:19:11 UTC
[13/50] [abbrv] git commit: refactoring
refactoring
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/8bfaffd2
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/8bfaffd2
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/8bfaffd2
Branch: refs/heads/master
Commit: 8bfaffd24177bba0431fc765f4b1d560aa58bf71
Parents: 10bf355
Author: randgalt <ra...@apache.org>
Authored: Fri May 30 11:02:06 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri May 30 11:02:06 2014 -0500
----------------------------------------------------------------------
.../curator/x/rpc/CuratorProjectionServer.java | 4 +-
.../curator/x/rpc/connections/CuratorEntry.java | 2 +-
.../x/rpc/details/RpcBackgroundCallback.java | 6 +-
.../curator/x/rpc/details/RpcWatcher.java | 6 +-
.../curator/x/rpc/idl/event/EventService.java | 33 --
.../curator/x/rpc/idl/event/LeaderEvent.java | 28 -
.../curator/x/rpc/idl/event/LeaderResult.java | 25 -
.../x/rpc/idl/event/OptionalChildrenList.java | 21 -
.../curator/x/rpc/idl/event/OptionalPath.java | 20 -
.../x/rpc/idl/event/OptionalRpcStat.java | 38 --
.../apache/curator/x/rpc/idl/event/RpcAcl.java | 42 --
.../curator/x/rpc/idl/event/RpcChildData.java | 39 --
.../x/rpc/idl/event/RpcCuratorEvent.java | 224 -------
.../x/rpc/idl/event/RpcCuratorEventType.java | 46 --
.../curator/x/rpc/idl/event/RpcEventType.java | 31 -
.../apache/curator/x/rpc/idl/event/RpcId.java | 42 --
.../curator/x/rpc/idl/event/RpcKeeperState.java | 34 --
.../curator/x/rpc/idl/event/RpcParticipant.java | 24 -
.../idl/event/RpcPathChildrenCacheEvent.java | 36 --
.../event/RpcPathChildrenCacheEventType.java | 15 -
.../event/RpcPersistentEphemeralNodeMode.java | 12 -
.../apache/curator/x/rpc/idl/event/RpcStat.java | 95 ---
.../x/rpc/idl/event/RpcWatchedEvent.java | 54 --
.../x/rpc/idl/projection/CreateSpec.java | 62 --
.../x/rpc/idl/projection/CuratorProjection.java | 39 --
.../projection/CuratorProjectionService.java | 592 -------------------
.../x/rpc/idl/projection/DeleteSpec.java | 54 --
.../x/rpc/idl/projection/ExistsSpec.java | 46 --
.../x/rpc/idl/projection/GenericProjection.java | 20 -
.../x/rpc/idl/projection/GetChildrenSpec.java | 46 --
.../x/rpc/idl/projection/GetDataSpec.java | 50 --
.../x/rpc/idl/projection/LeaderProjection.java | 20 -
.../x/rpc/idl/projection/LeaseProjection.java | 20 -
.../x/rpc/idl/projection/LockProjection.java | 20 -
.../rpc/idl/projection/NodeCacheProjection.java | 20 -
.../projection/PathChildrenCacheProjection.java | 20 -
.../projection/PathChildrenCacheStartMode.java | 8 -
.../PersistentEphemeralNodeProjection.java | 20 -
.../x/rpc/idl/projection/RpcCreateMode.java | 30 -
.../x/rpc/idl/projection/SetDataSpec.java | 58 --
.../curator/x/rpc/idl/projection/Version.java | 20 -
.../idl/services/CuratorProjectionService.java | 592 +++++++++++++++++++
.../x/rpc/idl/services/EventService.java | 34 ++
.../curator/x/rpc/idl/structs/CreateSpec.java | 62 ++
.../x/rpc/idl/structs/CuratorProjection.java | 39 ++
.../curator/x/rpc/idl/structs/DeleteSpec.java | 54 ++
.../curator/x/rpc/idl/structs/ExistsSpec.java | 46 ++
.../x/rpc/idl/structs/GetChildrenSpec.java | 46 ++
.../curator/x/rpc/idl/structs/GetDataSpec.java | 50 ++
.../curator/x/rpc/idl/structs/LeaderEvent.java | 28 +
.../x/rpc/idl/structs/LeaderProjection.java | 20 +
.../curator/x/rpc/idl/structs/LeaderResult.java | 24 +
.../x/rpc/idl/structs/LeaseProjection.java | 20 +
.../x/rpc/idl/structs/LockProjection.java | 20 +
.../x/rpc/idl/structs/NodeCacheProjection.java | 20 +
.../x/rpc/idl/structs/OptionalChildrenList.java | 21 +
.../curator/x/rpc/idl/structs/OptionalPath.java | 20 +
.../x/rpc/idl/structs/OptionalRpcStat.java | 38 ++
.../structs/PathChildrenCacheProjection.java | 20 +
.../idl/structs/PathChildrenCacheStartMode.java | 8 +
.../PersistentEphemeralNodeProjection.java | 20 +
.../curator/x/rpc/idl/structs/RpcAcl.java | 42 ++
.../curator/x/rpc/idl/structs/RpcChildData.java | 39 ++
.../x/rpc/idl/structs/RpcCreateMode.java | 30 +
.../x/rpc/idl/structs/RpcCuratorEvent.java | 224 +++++++
.../x/rpc/idl/structs/RpcCuratorEventType.java | 46 ++
.../curator/x/rpc/idl/structs/RpcEventType.java | 31 +
.../apache/curator/x/rpc/idl/structs/RpcId.java | 42 ++
.../x/rpc/idl/structs/RpcKeeperState.java | 34 ++
.../x/rpc/idl/structs/RpcParticipant.java | 24 +
.../idl/structs/RpcPathChildrenCacheEvent.java | 36 ++
.../structs/RpcPathChildrenCacheEventType.java | 15 +
.../structs/RpcPersistentEphemeralNodeMode.java | 12 +
.../curator/x/rpc/idl/structs/RpcStat.java | 95 +++
.../x/rpc/idl/structs/RpcWatchedEvent.java | 54 ++
.../curator/x/rpc/idl/structs/SetDataSpec.java | 58 ++
.../curator/x/rpc/idl/structs/Version.java | 20 +
curator-x-rpc/src/main/scripts/generate.sh | 2 +-
curator-x-rpc/src/main/thrift/curator.thrift | 68 +--
.../curator/generated/CuratorService.java | 288 +--------
.../curator/generated/GenericProjection.java | 388 ------------
81 files changed, 2031 insertions(+), 2721 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
index 0ab490b..78f8eaa 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
@@ -30,8 +30,8 @@ import com.google.common.io.Resources;
import org.apache.curator.x.rpc.configuration.Configuration;
import org.apache.curator.x.rpc.configuration.ConfigurationBuilder;
import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.idl.event.EventService;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjectionService;
+import org.apache.curator.x.rpc.idl.services.EventService;
+import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
index bb56cfb..d5a6d8a 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/connections/CuratorEntry.java
@@ -3,7 +3,7 @@ package org.apache.curator.x.rpc.connections;
import com.google.common.collect.Maps;
import com.google.common.collect.Queues;
import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.x.rpc.idl.event.RpcCuratorEvent;
+import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Closeable;
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
index 22a3fd2..bda795d 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcBackgroundCallback.java
@@ -3,9 +3,9 @@ package org.apache.curator.x.rpc.details;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.api.BackgroundCallback;
import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.x.rpc.idl.event.RpcCuratorEvent;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjection;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjectionService;
+import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
+import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
public class RpcBackgroundCallback implements BackgroundCallback
{
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
index 55dd866..3f4591c 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/details/RpcWatcher.java
@@ -1,8 +1,8 @@
package org.apache.curator.x.rpc.details;
-import org.apache.curator.x.rpc.idl.event.RpcCuratorEvent;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjection;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjectionService;
+import org.apache.curator.x.rpc.idl.structs.RpcCuratorEvent;
+import org.apache.curator.x.rpc.idl.structs.CuratorProjection;
+import org.apache.curator.x.rpc.idl.services.CuratorProjectionService;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java
deleted file mode 100644
index 933f3af..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/EventService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.idl.projection.CuratorProjection;
-
-@ThriftService("EventService")
-public class EventService
-{
- private final ConnectionManager connectionManager;
- private final long pingTimeMs;
-
- public EventService(ConnectionManager connectionManager, long pingTimeMs)
- {
- this.connectionManager = connectionManager;
- this.pingTimeMs = pingTimeMs;
- }
-
- @ThriftMethod
- public RpcCuratorEvent getNextEvent(CuratorProjection projection) throws InterruptedException
- {
- CuratorEntry entry = connectionManager.get(projection.id);
- if ( entry == null )
- {
- // TODO
- return null;
- }
- RpcCuratorEvent event = entry.pollForEvent(pingTimeMs);
- return (event != null) ? event : new RpcCuratorEvent();
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java
deleted file mode 100644
index 677c401..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderEvent.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaderEvent
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public String participantId;
-
- @ThriftField(3)
- public boolean isLeader;
-
- public LeaderEvent()
- {
- }
-
- public LeaderEvent(String path, String participantId, boolean isLeader)
- {
- this.path = path;
- this.participantId = participantId;
- this.isLeader = isLeader;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java
deleted file mode 100644
index 8666105..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/LeaderResult.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.x.rpc.idl.projection.LeaderProjection;
-
-@ThriftStruct
-public class LeaderResult
-{
- @ThriftField(1)
- public LeaderProjection projection;
-
- @ThriftField(2)
- public boolean hasLeadership;
-
- public LeaderResult()
- {
- }
-
- public LeaderResult(LeaderProjection projection, boolean hasLeadership)
- {
- this.projection = projection;
- this.hasLeadership = hasLeadership;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java
deleted file mode 100644
index 0f0a928..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalChildrenList.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import java.util.List;
-
-@ThriftStruct
-public class OptionalChildrenList
-{
- @ThriftField(1)
- public List<String> children;
-
- public OptionalChildrenList()
- {
- }
-
- public OptionalChildrenList(List<String> children)
- {
- this.children = children;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java
deleted file mode 100644
index 947dd75..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalPath.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class OptionalPath
-{
- @ThriftField(1)
- public String path;
-
- public OptionalPath()
- {
- }
-
- public OptionalPath(String path)
- {
- this.path = path;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java
deleted file mode 100644
index 5db40ce..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/OptionalRpcStat.java
+++ /dev/null
@@ -1,38 +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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("OptionalStat")
-public class OptionalRpcStat
-{
- @ThriftField(1)
- public RpcStat stat;
-
- public OptionalRpcStat()
- {
- }
-
- public OptionalRpcStat(RpcStat stat)
- {
- this.stat = stat;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java
deleted file mode 100644
index b2f1512..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcAcl.java
+++ /dev/null
@@ -1,42 +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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Acl")
-public class RpcAcl
-{
- @ThriftField(1)
- public int perms;
-
- @ThriftField(2)
- public RpcId id;
-
- public RpcAcl()
- {
- }
-
- public RpcAcl(int perms, RpcId id)
- {
- this.perms = perms;
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
deleted file mode 100644
index e490493..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcChildData.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.framework.recipes.cache.ChildData;
-
-@ThriftStruct("ChildData")
-public class RpcChildData
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public RpcStat stat;
-
- @ThriftField(3)
- public byte[] data;
-
- public RpcChildData()
- {
- }
-
- public RpcChildData(ChildData data)
- {
- if ( data != null )
- {
- this.path = data.getPath();
- this.stat = RpcCuratorEvent.toRpcStat(data.getStat());
- this.data = data.getData();
- }
- }
-
- public RpcChildData(String path, RpcStat stat, byte[] data)
- {
- this.path = path;
- this.stat = stat;
- this.data = data;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
deleted file mode 100644
index 400f8c9..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEvent.java
+++ /dev/null
@@ -1,224 +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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.framework.state.ConnectionState;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.data.ACL;
-import org.apache.zookeeper.data.Stat;
-import javax.annotation.Nullable;
-import java.util.List;
-
-@SuppressWarnings("deprecation")
-@ThriftStruct("CuratorEvent")
-public class RpcCuratorEvent
-{
- @ThriftField(2)
- public RpcCuratorEventType type;
-
- @ThriftField(3)
- public int resultCode;
-
- @ThriftField(4)
- public String path;
-
- @ThriftField(5)
- public String context;
-
- @ThriftField(6)
- public RpcStat stat;
-
- @ThriftField(7)
- public byte[] data;
-
- @ThriftField(8)
- public String name;
-
- @ThriftField(9)
- public List<String> children;
-
- @ThriftField(10)
- public List<RpcAcl> aclList;
-
- @ThriftField(11)
- public RpcWatchedEvent watchedEvent;
-
- @ThriftField(12)
- public LeaderEvent leaderEvent;
-
- @ThriftField(13)
- public RpcPathChildrenCacheEvent childrenCacheEvent;
-
- public RpcCuratorEvent()
- {
- this.type = RpcCuratorEventType.PING;
- this.resultCode = 0;
- this.path = null;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(RpcCuratorEventType type, String path)
- {
- this.type = type;
- this.resultCode = 0;
- this.path = path;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(RpcPathChildrenCacheEvent childrenCacheEvent)
- {
- this.type = RpcCuratorEventType.PATH_CHILDREN_CACHE;
- this.resultCode = 0;
- this.path = null;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = childrenCacheEvent;
- }
-
- public RpcCuratorEvent(CuratorEvent event)
- {
- this.type = RpcCuratorEventType.valueOf(event.getType().name());
- this.resultCode = event.getResultCode();
- this.path = event.getPath();
- this.context = (event.getContext() != null) ? String.valueOf(event.getContext()) : null;
- this.stat = toRpcStat(event.getStat());
- this.data = event.getData();
- this.name = event.getName();
- this.children = event.getChildren();
- this.aclList = toRpcAclList(event.getACLList());
- this.watchedEvent = toRpcWatchedEvent(event.getWatchedEvent());
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(ConnectionState newState)
- {
- this.type = RpcCuratorEventType.valueOf(newState.name());
- this.resultCode = 0;
- this.path = null;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(WatchedEvent event)
- {
- this.type = RpcCuratorEventType.WATCHED;
- this.resultCode = 0;
- this.path = event.getPath();
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = new RpcWatchedEvent(RpcKeeperState.valueOf(event.getState().name()), RpcEventType.valueOf(event.getType().name()), event.getPath());
- this.leaderEvent = null;
- this.childrenCacheEvent = null;
- }
-
- public RpcCuratorEvent(LeaderEvent event)
- {
- this.type = RpcCuratorEventType.LEADER;
- this.resultCode = 0;
- this.path = event.path;
- this.context = null;
- this.stat = null;
- this.data = null;
- this.name = null;
- this.children = null;
- this.aclList = null;
- this.watchedEvent = null;
- this.leaderEvent = event;
- this.childrenCacheEvent = null;
- }
-
- public static RpcStat toRpcStat(Stat stat)
- {
- if ( stat != null )
- {
- return new RpcStat(stat);
- }
- return null;
- }
-
- private List<RpcAcl> toRpcAclList(List<ACL> aclList)
- {
- if ( aclList != null )
- {
- return Lists.transform
- (
- aclList,
- new Function<ACL, RpcAcl>()
- {
- @Nullable
- @Override
- public RpcAcl apply(ACL acl)
- {
- RpcId id = new RpcId(acl.getId().getScheme(), acl.getId().getId());
- return new RpcAcl(acl.getPerms(), id);
- }
- }
- );
- }
- return null;
- }
-
- private RpcWatchedEvent toRpcWatchedEvent(WatchedEvent watchedEvent)
- {
- if ( watchedEvent != null )
- {
- return new RpcWatchedEvent(watchedEvent);
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.java
deleted file mode 100644
index 0bda3d6..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcCuratorEventType.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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("CuratorEventType")
-public enum RpcCuratorEventType
-{
- PING,
- CREATE,
- DELETE,
- EXISTS,
- GET_DATA,
- SET_DATA,
- CHILDREN,
- SYNC,
- GET_ACL,
- SET_ACL,
- WATCHED,
- CLOSING,
- CONNECTION_CONNECTED,
- CONNECTION_SUSPENDED,
- CONNECTION_RECONNECTED,
- CONNECTION_LOST,
- CONNECTION_READ_ONLY,
- LEADER,
- PATH_CHILDREN_CACHE,
- NODE_CACHE
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.java
deleted file mode 100644
index b7b5fa3..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcEventType.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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("EventType")
-public enum RpcEventType
-{
- None,
- NodeCreated,
- NodeDeleted,
- NodeDataChanged,
- NodeChildrenChanged
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java
deleted file mode 100644
index a86556a..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcId.java
+++ /dev/null
@@ -1,42 +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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Id")
-public class RpcId
-{
- @ThriftField(1)
- public String scheme;
-
- @ThriftField(2)
- public String id;
-
- public RpcId()
- {
- }
-
- public RpcId(String scheme, String id)
- {
- this.scheme = scheme;
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java
deleted file mode 100644
index 7d17366..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcKeeperState.java
+++ /dev/null
@@ -1,34 +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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("KeeperState")
-public enum RpcKeeperState
-{
- Unknown,
- Disconnected,
- NoSyncConnected,
- SyncConnected,
- AuthFailed,
- ConnectedReadOnly,
- SaslAuthenticated,
- Expired
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java
deleted file mode 100644
index 05a5d85..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcParticipant.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct("Participant")
-public class RpcParticipant
-{
- @ThriftField(1)
- public String id;
-
- @ThriftField(2)
- public boolean isLeader;
-
- public RpcParticipant()
- {
- }
-
- public RpcParticipant(String id, boolean isLeader)
- {
- this.id = id;
- this.isLeader = isLeader;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
deleted file mode 100644
index 59be6e2..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
-
-@ThriftStruct("PathChildrenCacheEvent")
-public class RpcPathChildrenCacheEvent
-{
- @ThriftField(1)
- public String cachedPath;
-
- @ThriftField(2)
- public RpcPathChildrenCacheEventType type;
-
- @ThriftField(3)
- public RpcChildData data;
-
- public RpcPathChildrenCacheEvent()
- {
- }
-
- public RpcPathChildrenCacheEvent(String cachedPath, PathChildrenCacheEvent event)
- {
- this.cachedPath = cachedPath;
- type = RpcPathChildrenCacheEventType.valueOf(event.getType().name());
- data = (event.getData() != null) ? new RpcChildData(event.getData()) : null;
- }
-
- public RpcPathChildrenCacheEvent(String cachedPath, RpcPathChildrenCacheEventType type, RpcChildData data)
- {
- this.cachedPath = cachedPath;
- this.type = type;
- this.data = data;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java
deleted file mode 100644
index 4ec5541..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPathChildrenCacheEventType.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("PathChildrenCacheEventType")
-public enum RpcPathChildrenCacheEventType
-{
- CHILD_ADDED,
- CHILD_UPDATED,
- CHILD_REMOVED,
- CONNECTION_SUSPENDED,
- CONNECTION_RECONNECTED,
- CONNECTION_LOST,
- INITIALIZED
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
deleted file mode 100644
index bda8b4d..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcPersistentEphemeralNodeMode.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.curator.x.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftEnum;
-
-@ThriftEnum("PersistentEphemeralNodeMode")
-public enum RpcPersistentEphemeralNodeMode
-{
- EPHEMERAL,
- EPHEMERAL_SEQUENTIAL,
- PROTECTED_EPHEMERAL,
- PROTECTED_EPHEMERAL_SEQUENTIAL
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java
deleted file mode 100644
index f5d2300..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcStat.java
+++ /dev/null
@@ -1,95 +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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.zookeeper.data.Stat;
-
-@ThriftStruct("Stat")
-public class RpcStat
-{
- @ThriftField(1)
- public long czxid;
-
- @ThriftField(2)
- public long mzxid;
-
- @ThriftField(3)
- public long ctime;
-
- @ThriftField(4)
- public long mtime;
-
- @ThriftField(5)
- public int version;
-
- @ThriftField(6)
- public int cversion;
-
- @ThriftField(7)
- public int aversion;
-
- @ThriftField(8)
- public long ephemeralOwner;
-
- @ThriftField(9)
- public int dataLength;
-
- @ThriftField(10)
- public int numChildren;
-
- @ThriftField(11)
- public long pzxid;
-
- public RpcStat()
- {
- }
-
- public RpcStat(Stat stat)
- {
- czxid = stat.getCzxid();
- mzxid = stat.getMzxid();
- ctime = stat.getCtime();
- mtime = stat.getMtime();
- version = stat.getVersion();
- cversion = stat.getCversion();
- aversion = stat.getAversion();
- ephemeralOwner = stat.getEphemeralOwner();
- dataLength = stat.getDataLength();
- numChildren = stat.getNumChildren();
- pzxid = stat.getPzxid();
- }
-
- public RpcStat(long czxid, long mzxid, long ctime, long mtime, int version, int cversion, int aversion, long ephemeralOwner, int dataLength, int numChildren, long pzxid)
- {
- this.czxid = czxid;
- this.mzxid = mzxid;
- this.ctime = ctime;
- this.mtime = mtime;
- this.version = version;
- this.cversion = cversion;
- this.aversion = aversion;
- this.ephemeralOwner = ephemeralOwner;
- this.dataLength = dataLength;
- this.numChildren = numChildren;
- this.pzxid = pzxid;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java
deleted file mode 100644
index 11856b3..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/event/RpcWatchedEvent.java
+++ /dev/null
@@ -1,54 +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.rpc.idl.event;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-import org.apache.zookeeper.WatchedEvent;
-
-@ThriftStruct("WatchedEvent")
-public class RpcWatchedEvent
-{
- @ThriftField(1)
- public RpcKeeperState keeperState;
-
- @ThriftField(2)
- public RpcEventType eventType;
-
- @ThriftField(3)
- public String path;
-
- public RpcWatchedEvent()
- {
- }
-
- public RpcWatchedEvent(WatchedEvent watchedEvent)
- {
- keeperState = RpcKeeperState.valueOf(watchedEvent.getState().name());
- eventType = RpcEventType.valueOf(watchedEvent.getType().name());
- path = watchedEvent.getPath();
- }
-
- public RpcWatchedEvent(RpcKeeperState keeperState, RpcEventType eventType, String path)
- {
- this.keeperState = keeperState;
- this.eventType = eventType;
- this.path = path;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java
deleted file mode 100644
index 7f156b4..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CreateSpec.java
+++ /dev/null
@@ -1,62 +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.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class CreateSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public byte[] data;
-
- @ThriftField(3)
- public RpcCreateMode mode;
-
- @ThriftField(4)
- public String asyncContext;
-
- @ThriftField(5)
- public boolean compressed;
-
- @ThriftField(6)
- public boolean creatingParentsIfNeeded;
-
- @ThriftField(7)
- public boolean withProtection;
-
- public CreateSpec()
- {
- }
-
- public CreateSpec(String path, byte[] data, RpcCreateMode mode, String asyncContext, boolean compressed, boolean creatingParentsIfNeeded, boolean withProtection)
- {
- this.path = path;
- this.data = data;
- this.mode = mode;
- this.asyncContext = asyncContext;
- this.compressed = compressed;
- this.creatingParentsIfNeeded = creatingParentsIfNeeded;
- this.withProtection = withProtection;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java
deleted file mode 100644
index 8ca3847..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjection.java
+++ /dev/null
@@ -1,39 +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.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftConstructor;
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class CuratorProjection
-{
- @ThriftField(1)
- public String id;
-
- public CuratorProjection()
- {
- }
-
- public CuratorProjection(String id)
- {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
deleted file mode 100644
index ab9add7..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/CuratorProjectionService.java
+++ /dev/null
@@ -1,592 +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.rpc.idl.projection;
-
-import com.facebook.swift.service.ThriftMethod;
-import com.facebook.swift.service.ThriftService;
-import com.google.common.base.Function;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import org.apache.curator.framework.CuratorFramework;
-import org.apache.curator.framework.api.*;
-import org.apache.curator.framework.recipes.cache.ChildData;
-import org.apache.curator.framework.recipes.cache.NodeCache;
-import org.apache.curator.framework.recipes.cache.NodeCacheListener;
-import org.apache.curator.framework.recipes.cache.PathChildrenCache;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
-import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
-import org.apache.curator.framework.recipes.leader.LeaderLatch;
-import org.apache.curator.framework.recipes.leader.LeaderLatchListener;
-import org.apache.curator.framework.recipes.leader.Participant;
-import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreMutex;
-import org.apache.curator.framework.recipes.locks.InterProcessSemaphoreV2;
-import org.apache.curator.framework.recipes.locks.Lease;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
-import org.apache.curator.framework.state.ConnectionState;
-import org.apache.curator.framework.state.ConnectionStateListener;
-import org.apache.curator.utils.ThreadUtils;
-import org.apache.curator.x.rpc.connections.Closer;
-import org.apache.curator.x.rpc.connections.ConnectionManager;
-import org.apache.curator.x.rpc.connections.CuratorEntry;
-import org.apache.curator.x.rpc.details.RpcBackgroundCallback;
-import org.apache.curator.x.rpc.details.RpcWatcher;
-import org.apache.curator.x.rpc.idl.event.*;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.data.Stat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-@ThriftService("CuratorService")
-public class CuratorProjectionService
-{
- private final Logger log = LoggerFactory.getLogger(getClass());
- private final ConnectionManager connectionManager;
-
- public CuratorProjectionService(ConnectionManager connectionManager)
- {
- this.connectionManager = connectionManager;
- }
-
- @ThriftMethod
- public CuratorProjection newCuratorProjection(String connectionName)
- {
- CuratorFramework client = connectionManager.newConnection(connectionName);
-
- String id = CuratorEntry.newId();
- client.start();
- connectionManager.add(id, client);
- final CuratorProjection projection = new CuratorProjection(id);
-
- ConnectionStateListener listener = new ConnectionStateListener()
- {
- @Override
- public void stateChanged(CuratorFramework client, ConnectionState newState)
- {
- addEvent(projection, new RpcCuratorEvent(newState));
- }
- };
- client.getConnectionStateListenable().addListener(listener);
-
- return projection;
- }
-
- @ThriftMethod(oneway = true)
- public void closeCuratorProjection(CuratorProjection projection)
- {
- CuratorEntry entry = connectionManager.remove(projection.id);
- if ( entry != null )
- {
- entry.close();
- }
- }
-
- @ThriftMethod(oneway = true)
- public void pingCuratorProjection(CuratorProjection projection)
- {
- connectionManager.get(projection.id);
- }
-
- @ThriftMethod
- public OptionalPath createNode(CuratorProjection projection, CreateSpec spec) throws Exception
- {
- CuratorFramework client = getEntry(projection).getClient();
-
- Object builder = client.create();
- if ( spec.creatingParentsIfNeeded )
- {
- builder = castBuilder(builder, CreateBuilder.class).creatingParentsIfNeeded();
- }
- if ( spec.compressed )
- {
- builder = castBuilder(builder, Compressible.class).compressed();
- }
- if ( spec.withProtection )
- {
- builder = castBuilder(builder, CreateBuilder.class).withProtection();
- }
- if ( spec.mode != null )
- {
- builder = castBuilder(builder, CreateModable.class).withMode(CreateMode.valueOf(spec.mode.name()));
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
- }
-
- Object path = castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
- return new OptionalPath((path != null) ? String.valueOf(path) : null);
- }
-
- @ThriftMethod
- public void deleteNode(CuratorProjection projection, DeleteSpec spec) throws Exception
- {
- CuratorFramework client = getEntry(projection).getClient();
-
- Object builder = client.delete();
- if ( spec.guaranteed )
- {
- builder = castBuilder(builder, DeleteBuilder.class).guaranteed();
- }
- if ( spec.version != null )
- {
- builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback, spec.asyncContext);
- }
-
- castBuilder(builder, Pathable.class).forPath(spec.path);
- }
-
- @ThriftMethod
- public byte[] getData(CuratorProjection projection, GetDataSpec spec) throws Exception
- {
- CuratorFramework client = getEntry(projection).getClient();
-
- Object builder = client.getData();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
-
- if ( spec.decompressed )
- {
- builder = castBuilder(builder, Decompressible.class).decompressed();
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- Stat stat = new Stat();
- builder = castBuilder(builder, Statable.class).storingStatIn(stat);
-
- return (byte[])castBuilder(builder, Pathable.class).forPath(spec.path);
- }
-
- @ThriftMethod
- public RpcStat setData(CuratorProjection projection, SetDataSpec spec) throws Exception
- {
- CuratorFramework client = getEntry(projection).getClient();
-
- Object builder = client.setData();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
- if ( spec.version != null )
- {
- builder = castBuilder(builder, Versionable.class).withVersion(spec.version.version);
- }
-
- if ( spec.compressed )
- {
- builder = castBuilder(builder, Compressible.class).compressed();
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- Stat stat = (Stat)castBuilder(builder, PathAndBytesable.class).forPath(spec.path, spec.data);
- return RpcCuratorEvent.toRpcStat(stat);
- }
-
- @ThriftMethod
- public OptionalRpcStat exists(CuratorProjection projection, ExistsSpec spec) throws Exception
- {
- CuratorFramework client = getEntry(projection).getClient();
-
- Object builder = client.checkExists();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- Stat stat = (Stat)castBuilder(builder, Pathable.class).forPath(spec.path);
- return new OptionalRpcStat((stat != null) ? RpcCuratorEvent.toRpcStat(stat) : null);
- }
-
- @ThriftMethod
- public OptionalChildrenList getChildren(CuratorProjection projection, GetChildrenSpec spec) throws Exception
- {
- CuratorFramework client = getEntry(projection).getClient();
-
- Object builder = client.getChildren();
- if ( spec.watched )
- {
- builder = castBuilder(builder, Watchable.class).usingWatcher(new RpcWatcher(this, projection));
- }
-
- if ( spec.asyncContext != null )
- {
- BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection);
- builder = castBuilder(builder, Backgroundable.class).inBackground(backgroundCallback);
- }
-
- @SuppressWarnings("unchecked")
- List<String> children = (List<String>)castBuilder(builder, Pathable.class).forPath(spec.path);
- return new OptionalChildrenList(children);
- }
-
- @ThriftMethod
- public boolean closeGenericProjection(CuratorProjection curatorProjection, String id) throws Exception
- {
- CuratorEntry entry = getEntry(curatorProjection);
- return entry.closeThing(id);
- }
-
- @ThriftMethod
- public LockProjection acquireLock(CuratorProjection projection, final String path, int maxWaitMs) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
- final InterProcessSemaphoreMutex lock = new InterProcessSemaphoreMutex(entry.getClient(), path);
- if ( !lock.acquire(maxWaitMs, TimeUnit.MILLISECONDS) )
- {
- return new LockProjection();
- }
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- if ( lock.isAcquiredInThisProcess() )
- {
- try
- {
- lock.release();
- }
- catch ( Exception e )
- {
- log.error("Could not release left-over lock for path: " + path, e);
- }
- }
- }
- };
- String id = entry.addThing(lock, closer);
- return new LockProjection(id);
- }
-
- @ThriftMethod
- public LeaderResult startLeaderSelector(final CuratorProjection projection, final String path, final String participantId, int waitForLeadershipMs) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- final LeaderLatch leaderLatch = new LeaderLatch(entry.getClient(), path, participantId);
- leaderLatch.start();
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- leaderLatch.close();
- }
- catch ( IOException e )
- {
- log.error("Could not close left-over leader latch for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(leaderLatch, closer);
-
- LeaderLatchListener listener = new LeaderLatchListener()
- {
- @Override
- public void isLeader()
- {
- addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, true)));
- }
-
- @Override
- public void notLeader()
- {
- addEvent(projection, new RpcCuratorEvent(new LeaderEvent(path, participantId, false)));
- }
- };
- leaderLatch.addListener(listener);
-
- if ( waitForLeadershipMs > 0 )
- {
- leaderLatch.await(waitForLeadershipMs, TimeUnit.MILLISECONDS);
- }
-
- return new LeaderResult(new LeaderProjection(id), leaderLatch.hasLeadership());
- }
-
- @ThriftMethod
- public List<RpcParticipant> getLeaderParticipants(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
- Collection<Participant> participants = leaderLatch.getParticipants();
- return Lists.transform(Lists.newArrayList(participants), new Function<Participant, RpcParticipant>()
- {
- @Override
- public RpcParticipant apply(Participant participant)
- {
- return new RpcParticipant(participant.getId(), participant.isLeader());
- }
- });
- }
-
- @ThriftMethod
- public boolean isLeader(CuratorProjection projection, LeaderProjection leaderProjection) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- LeaderLatch leaderLatch = getThing(entry, leaderProjection.id, LeaderLatch.class);
- return leaderLatch.hasLeadership();
- }
-
- @ThriftMethod
- public PathChildrenCacheProjection startPathChildrenCache(final CuratorProjection projection, final String path, boolean cacheData, boolean dataIsCompressed, PathChildrenCacheStartMode startMode) throws Exception
- {
- final CuratorEntry entry = getEntry(projection);
-
- final PathChildrenCache cache = new PathChildrenCache(entry.getClient(), path, cacheData, dataIsCompressed, ThreadUtils.newThreadFactory("PathChildrenCacheResource"));
- cache.start(PathChildrenCache.StartMode.valueOf(startMode.name()));
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- cache.close();
- }
- catch ( IOException e )
- {
- log.error("Could not close left-over PathChildrenCache for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(cache, closer);
-
- PathChildrenCacheListener listener = new PathChildrenCacheListener()
- {
- @Override
- public void childEvent(CuratorFramework client, PathChildrenCacheEvent event) throws Exception
- {
- entry.addEvent(new RpcCuratorEvent(new RpcPathChildrenCacheEvent(path, event)));
- }
- };
- cache.getListenable().addListener(listener);
-
- return new PathChildrenCacheProjection(id);
- }
-
- @ThriftMethod
- public List<RpcChildData> getPathChildrenCacheData(CuratorProjection projection, PathChildrenCacheProjection cacheProjection) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
- return Lists.transform
- (
- pathChildrenCache.getCurrentData(),
- new Function<ChildData, RpcChildData>()
- {
- @Override
- public RpcChildData apply(ChildData childData)
- {
- return new RpcChildData(childData);
- }
- }
- );
- }
-
- @ThriftMethod
- public RpcChildData getPathChildrenCacheDataForPath(CuratorProjection projection, PathChildrenCacheProjection cacheProjection, String path) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- PathChildrenCache pathChildrenCache = getThing(entry, cacheProjection.id, PathChildrenCache.class);
- return new RpcChildData(pathChildrenCache.getCurrentData(path));
- }
-
- @ThriftMethod
- public NodeCacheProjection startNodeCache(CuratorProjection projection, final String path, boolean dataIsCompressed, boolean buildInitial) throws Exception
- {
- final CuratorEntry entry = getEntry(projection);
-
- final NodeCache cache = new NodeCache(entry.getClient(), path, dataIsCompressed);
- cache.start(buildInitial);
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- cache.close();
- }
- catch ( IOException e )
- {
- log.error("Could not close left-over NodeCache for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(cache, closer);
-
- NodeCacheListener listener = new NodeCacheListener()
- {
- @Override
- public void nodeChanged() throws Exception
- {
- entry.addEvent(new RpcCuratorEvent(RpcCuratorEventType.NODE_CACHE, path));
- }
- };
- cache.getListenable().addListener(listener);
-
- return new NodeCacheProjection(id);
- }
-
- @ThriftMethod
- public RpcChildData getNodeCacheData(CuratorProjection projection, NodeCacheProjection cacheProjection) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- NodeCache nodeCache = getThing(entry, cacheProjection.id, NodeCache.class);
- return new RpcChildData(nodeCache.getCurrentData());
- }
-
- @ThriftMethod
- public PersistentEphemeralNodeProjection startPersistentEphemeralNode(CuratorProjection projection, final String path, byte[] data, RpcPersistentEphemeralNodeMode mode) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- final PersistentEphemeralNode node = new PersistentEphemeralNode(entry.getClient(), PersistentEphemeralNode.Mode.valueOf(mode.name()), path, data);
- node.start();
-
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- node.close();
- }
- catch ( Exception e )
- {
- log.error("Could not release left-over persistent ephemeral node for path: " + path, e);
- }
- }
- };
- String id = entry.addThing(node, closer);
- return new PersistentEphemeralNodeProjection(id);
- }
-
- @ThriftMethod
- public List<LeaseProjection> startSemaphore(CuratorProjection projection, final String path, int acquireQty, int maxWaitMs, int maxLeases) throws Exception
- {
- CuratorEntry entry = getEntry(projection);
-
- final InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(entry.getClient(), path, maxLeases);
- final Collection<Lease> leases = semaphore.acquire(acquireQty, maxWaitMs, TimeUnit.MILLISECONDS);
- if ( leases == null )
- {
- return Lists.newArrayList();
- }
-
- List<LeaseProjection> leaseProjections = Lists.newArrayList();
- for ( final Lease lease : leases )
- {
- Closer closer = new Closer()
- {
- @Override
- public void close()
- {
- try
- {
- semaphore.returnLease(lease);
- }
- catch ( Exception e )
- {
- log.error("Could not release semaphore leases for path: " + path, e);
- }
- }
- };
- leaseProjections.add(new LeaseProjection(entry.addThing(lease, closer)));
- }
- return leaseProjections;
- }
-
- public void addEvent(CuratorProjection projection, RpcCuratorEvent event)
- {
- CuratorEntry entry = connectionManager.get(projection.id);
- if ( entry != null )
- {
- entry.addEvent(event);
- }
- }
-
- private CuratorEntry getEntry(CuratorProjection projection) throws Exception
- {
- CuratorEntry entry = connectionManager.get(projection.id);
- if ( entry == null )
- {
- throw new Exception("No client found with id: " + projection.id);
- }
- return entry;
- }
-
- private static <T> T castBuilder(Object createBuilder, Class<T> clazz) throws Exception
- {
- if ( clazz.isAssignableFrom(createBuilder.getClass()) )
- {
- return clazz.cast(createBuilder);
- }
- throw new Exception("That operation is not available");
- }
-
- private <T> T getThing(CuratorEntry entry, String id, Class<T> clazz)
- {
- T thing = entry.getThing(id, clazz);
- Preconditions.checkNotNull(thing, "No item of type " + clazz.getSimpleName() + " found with id " + id);
- return thing;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java
deleted file mode 100644
index 0895d75..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/DeleteSpec.java
+++ /dev/null
@@ -1,54 +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.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class DeleteSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean guaranteed;
-
- @ThriftField(3)
- public String asyncContext;
-
- @ThriftField(4)
- public boolean compressed;
-
- @ThriftField(5)
- public Version version;
-
- public DeleteSpec()
- {
- }
-
- public DeleteSpec(String path, boolean guaranteed, String asyncContext, boolean compressed, Version version)
- {
- this.path = path;
- this.guaranteed = guaranteed;
- this.asyncContext = asyncContext;
- this.compressed = compressed;
- this.version = version;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.java
deleted file mode 100644
index dff67e4..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/ExistsSpec.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.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class ExistsSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean watched;
-
- @ThriftField(3)
- public String asyncContext;
-
- public ExistsSpec()
- {
- }
-
- public ExistsSpec(String path, boolean watched, String asyncContext)
- {
- this.path = path;
- this.watched = watched;
- this.asyncContext = asyncContext;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java
deleted file mode 100644
index cfdc74f..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GenericProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GenericProjection
-{
- @ThriftField(1)
- public String id;
-
- public GenericProjection()
- {
- }
-
- public GenericProjection(String id)
- {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.java
deleted file mode 100644
index fe9e4c1..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetChildrenSpec.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.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GetChildrenSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean watched;
-
- @ThriftField(3)
- public String asyncContext;
-
- public GetChildrenSpec()
- {
- }
-
- public GetChildrenSpec(String path, boolean watched, String asyncContext)
- {
- this.path = path;
- this.watched = watched;
- this.asyncContext = asyncContext;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java
deleted file mode 100644
index fe5b1ac..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/GetDataSpec.java
+++ /dev/null
@@ -1,50 +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.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class GetDataSpec
-{
- @ThriftField(1)
- public String path;
-
- @ThriftField(2)
- public boolean watched;
-
- @ThriftField(3)
- public String asyncContext;
-
- @ThriftField(4)
- public boolean decompressed;
-
- public GetDataSpec()
- {
- }
-
- public GetDataSpec(String path, boolean watched, String asyncContext, boolean decompressed)
- {
- this.path = path;
- this.watched = watched;
- this.asyncContext = asyncContext;
- this.decompressed = decompressed;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
deleted file mode 100644
index bf66497..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaderProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaderProjection
-{
- @ThriftField(1)
- public String id;
-
- public LeaderProjection()
- {
- }
-
- public LeaderProjection(String id)
- {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
deleted file mode 100644
index 2faa228..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LeaseProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LeaseProjection
-{
- @ThriftField(1)
- public String id;
-
- public LeaseProjection()
- {
- }
-
- public LeaseProjection(String id)
- {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
deleted file mode 100644
index 83bb68b..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/LockProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class LockProjection
-{
- @ThriftField(1)
- public String id;
-
- public LockProjection()
- {
- }
-
- public LockProjection(String id)
- {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
deleted file mode 100644
index 7fa8957..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/NodeCacheProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class NodeCacheProjection
-{
- @ThriftField(1)
- public String id;
-
- public NodeCacheProjection()
- {
- }
-
- public NodeCacheProjection(String id)
- {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
deleted file mode 100644
index a1ee396..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class PathChildrenCacheProjection
-{
- @ThriftField(1)
- public String id;
-
- public PathChildrenCacheProjection()
- {
- }
-
- public PathChildrenCacheProjection(String id)
- {
- this.id = id;
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java
deleted file mode 100644
index bf695ba..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PathChildrenCacheStartMode.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-public enum PathChildrenCacheStartMode
-{
- NORMAL,
- BUILD_INITIAL_CACHE,
- POST_INITIALIZED_EVENT
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/8bfaffd2/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
deleted file mode 100644
index a58d3c3..0000000
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/projection/PersistentEphemeralNodeProjection.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.apache.curator.x.rpc.idl.projection;
-
-import com.facebook.swift.codec.ThriftField;
-import com.facebook.swift.codec.ThriftStruct;
-
-@ThriftStruct
-public class PersistentEphemeralNodeProjection
-{
- @ThriftField(1)
- public String id;
-
- public PersistentEphemeralNodeProjection()
- {
- }
-
- public PersistentEphemeralNodeProjection(String id)
- {
- this.id = id;
- }
-}