You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/03/27 17:09:31 UTC
[02/22] incubator-tinkerpop git commit: Renamed GraphChangedListener
to MutationListener.
Renamed GraphChangedListener to MutationListener.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/4599dfb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/4599dfb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/4599dfb8
Branch: refs/heads/variables
Commit: 4599dfb8805abc3a5c0713aa28118bded47bad91
Parents: 11e15de
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 27 07:52:53 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Mar 27 07:52:53 2015 -0400
----------------------------------------------------------------------
.../util/event/ConsoleGraphChangedListener.java | 89 ---------------
.../util/event/ConsoleMutationListener.java | 89 +++++++++++++++
.../step/util/event/EdgeAddedEvent.java | 2 +-
.../util/event/EdgePropertyChangedEvent.java | 2 +-
.../util/event/EdgePropertyRemovedEvent.java | 2 +-
.../step/util/event/EdgeRemovedEvent.java | 3 +-
.../step/util/event/ElementPropertyEvent.java | 4 +-
.../traversal/step/util/event/Event.java | 2 +-
.../step/util/event/GraphChangedListener.java | 111 -------------------
.../step/util/event/MutationListener.java | 111 +++++++++++++++++++
.../step/util/event/VertexAddedEvent.java | 2 +-
.../util/event/VertexPropertyChangedEvent.java | 2 +-
.../VertexPropertyPropertyChangedEvent.java | 2 +-
.../VertexPropertyPropertyRemovedEvent.java | 2 +-
.../util/event/VertexPropertyRemovedEvent.java | 2 +-
.../step/util/event/VertexRemovedEvent.java | 3 +-
.../strategy/decoration/EventStrategy.java | 18 +--
.../strategy/decoration/EventStrategyTest.java | 6 +-
.../decoration/EventStrategyProcessTest.java | 60 +++++-----
19 files changed, 252 insertions(+), 260 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleGraphChangedListener.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleGraphChangedListener.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleGraphChangedListener.java
deleted file mode 100644
index ab0888c..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleGraphChangedListener.java
+++ /dev/null
@@ -1,89 +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.tinkerpop.gremlin.process.traversal.step.util.event;
-
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-
-/**
- * An example listener that writes a message to the console for each event that fires from the graph.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class ConsoleGraphChangedListener implements GraphChangedListener {
-
- private final Graph graph;
-
- public ConsoleGraphChangedListener(final Graph graph) {
- this.graph = graph;
- }
-
- @Override
- public void vertexAdded(final Vertex vertex) {
- System.out.println("Vertex [" + vertex.toString() + "] added to graph [" + graph.toString() + "]");
- }
-
- @Override
- public void vertexRemoved(final Vertex vertex) {
- System.out.println("Vertex [" + vertex.toString() + "] removed from graph [" + graph.toString() + "]");
- }
-
- @Override
- public void vertexPropertyRemoved(final VertexProperty vertexProperty) {
- System.out.println("Vertex Property [" + vertexProperty.toString() + "] removed from graph [" + graph.toString() + "]");
- }
-
- @Override
- public void edgeAdded(final Edge edge) {
- System.out.println("Edge [" + edge.toString() + "] added to graph [" + graph.toString() + "]");
- }
-
- @Override
- public void edgeRemoved(final Edge edge) {
- System.out.println("Edge [" + edge.toString() + "] removed from graph [" + graph.toString() + "]");
- }
-
- @Override
- public void edgePropertyRemoved(final Edge element, final Property removedValue) {
- System.out.println("Edge [" + element.toString() + "] property with value of [" + removedValue + "] removed in graph [" + graph.toString() + "]");
- }
-
- @Override
- public void edgePropertyChanged(final Edge element, final Property oldValue, final Object setValue) {
- System.out.println("Edge [" + element.toString() + "] property change value from [" + oldValue + "] to [" + setValue + "] in graph [" + graph.toString() + "]");
- }
-
- @Override
- public void vertexPropertyPropertyChanged(final VertexProperty element, final Property oldValue, final Object setValue) {
- System.out.println("VertexProperty [" + element.toString() + "] property change value from [" + oldValue + "] to [" + setValue + "] in graph [" + graph.toString() + "]");
- }
-
- @Override
- public void vertexPropertyPropertyRemoved(final VertexProperty element, final Property oldValue) {
- System.out.println("VertexProperty [" + element.toString() + "] property with value of [" + oldValue + "] removed in graph [" + graph.toString() + "]");
- }
-
- @Override
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
- System.out.println("Vertex [" + element.toString() + "] property [" + oldValue + "] change to [" + setValue + "] in graph [" + graph.toString() + "]");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java
new file mode 100644
index 0000000..a454d46
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ConsoleMutationListener.java
@@ -0,0 +1,89 @@
+/*
+ * 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.tinkerpop.gremlin.process.traversal.step.util.event;
+
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+
+/**
+ * An example listener that writes a message to the console for each event that fires from the graph.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class ConsoleMutationListener implements MutationListener {
+
+ private final Graph graph;
+
+ public ConsoleMutationListener(final Graph graph) {
+ this.graph = graph;
+ }
+
+ @Override
+ public void vertexAdded(final Vertex vertex) {
+ System.out.println("Vertex [" + vertex.toString() + "] added to graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void vertexRemoved(final Vertex vertex) {
+ System.out.println("Vertex [" + vertex.toString() + "] removed from graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void vertexPropertyRemoved(final VertexProperty vertexProperty) {
+ System.out.println("Vertex Property [" + vertexProperty.toString() + "] removed from graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void edgeAdded(final Edge edge) {
+ System.out.println("Edge [" + edge.toString() + "] added to graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void edgeRemoved(final Edge edge) {
+ System.out.println("Edge [" + edge.toString() + "] removed from graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void edgePropertyRemoved(final Edge element, final Property removedValue) {
+ System.out.println("Edge [" + element.toString() + "] property with value of [" + removedValue + "] removed in graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void edgePropertyChanged(final Edge element, final Property oldValue, final Object setValue) {
+ System.out.println("Edge [" + element.toString() + "] property change value from [" + oldValue + "] to [" + setValue + "] in graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void vertexPropertyPropertyChanged(final VertexProperty element, final Property oldValue, final Object setValue) {
+ System.out.println("VertexProperty [" + element.toString() + "] property change value from [" + oldValue + "] to [" + setValue + "] in graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void vertexPropertyPropertyRemoved(final VertexProperty element, final Property oldValue) {
+ System.out.println("VertexProperty [" + element.toString() + "] property with value of [" + oldValue + "] removed in graph [" + graph.toString() + "]");
+ }
+
+ @Override
+ public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues) {
+ System.out.println("Vertex [" + element.toString() + "] property [" + oldValue + "] change to [" + setValue + "] in graph [" + graph.toString() + "]");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeAddedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeAddedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeAddedEvent.java
index aecc110..3011806 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeAddedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeAddedEvent.java
@@ -34,7 +34,7 @@ public class EdgeAddedEvent implements Event {
}
@Override
- public void fireEvent(final Iterator<GraphChangedListener> eventListeners) {
+ public void fireEvent(final Iterator<MutationListener> eventListeners) {
while (eventListeners.hasNext()) {
eventListeners.next().edgeAdded(edge);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyChangedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyChangedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyChangedEvent.java
index c5c36b6..210f939 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyChangedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyChangedEvent.java
@@ -32,7 +32,7 @@ public class EdgePropertyChangedEvent extends ElementPropertyChangedEvent {
}
@Override
- void fire(final GraphChangedListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
+ void fire(final MutationListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
listener.edgePropertyChanged((Edge) element, oldValue, newValue);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyRemovedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyRemovedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyRemovedEvent.java
index e8769fc..c82cf6b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyRemovedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgePropertyRemovedEvent.java
@@ -34,7 +34,7 @@ public class EdgePropertyRemovedEvent extends ElementPropertyEvent {
}
@Override
- void fire(final GraphChangedListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
+ void fire(final MutationListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
listener.edgePropertyRemoved((Edge) element, oldValue);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeRemovedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeRemovedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeRemovedEvent.java
index 6ba442a..74c0b7e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeRemovedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/EdgeRemovedEvent.java
@@ -21,7 +21,6 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.util.event;
import org.apache.tinkerpop.gremlin.structure.Edge;
import java.util.Iterator;
-import java.util.Map;
/**
* Event fired when an edge is removed.
@@ -37,7 +36,7 @@ public class EdgeRemovedEvent implements Event {
}
@Override
- public void fireEvent(final Iterator<GraphChangedListener> eventListeners) {
+ public void fireEvent(final Iterator<MutationListener> eventListeners) {
while (eventListeners.hasNext()) {
eventListeners.next().edgeRemoved(edge);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ElementPropertyEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ElementPropertyEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ElementPropertyEvent.java
index de3cbb9..8bab91c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ElementPropertyEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/ElementPropertyEvent.java
@@ -40,10 +40,10 @@ public abstract class ElementPropertyEvent implements Event {
this.vertexPropertyKeyValues = vertexPropertyKeyValues;
}
- abstract void fire(final GraphChangedListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues);
+ abstract void fire(final MutationListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues);
@Override
- public void fireEvent(final Iterator<GraphChangedListener> eventListeners) {
+ public void fireEvent(final Iterator<MutationListener> eventListeners) {
while (eventListeners.hasNext()) {
fire(eventListeners.next(), element, oldValue, newValue, vertexPropertyKeyValues);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/Event.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/Event.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/Event.java
index 24c54c5..0bbb053 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/Event.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/Event.java
@@ -25,6 +25,6 @@ import java.util.Iterator;
*/
public interface Event {
- public void fireEvent(final Iterator<GraphChangedListener> eventListeners);
+ public void fireEvent(final Iterator<MutationListener> eventListeners);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/GraphChangedListener.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/GraphChangedListener.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/GraphChangedListener.java
deleted file mode 100644
index 2c51990..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/GraphChangedListener.java
+++ /dev/null
@@ -1,111 +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.tinkerpop.gremlin.process.traversal.step.util.event;
-
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Element;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-
-/**
- * Interface for a listener to {@link org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy}
- * change events.
- *
- * Implementations of this interface should be added to the list of listeners on the addListener method on
- * the {@link org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy}.
- *
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public interface GraphChangedListener {
-
- /**
- * Raised when a new {@link Vertex} is added.
- *
- * @param vertex the {@link Vertex} that was added
- */
- public void vertexAdded(final Vertex vertex);
-
- /**
- * Raised after a {@link Vertex} was removed from the graph.
- *
- * @param vertex the {@link Vertex} that was removed
- */
- public void vertexRemoved(final Vertex vertex);
-
- /**
- * Raised after the property of a {@link Vertex} changed.
- *
- * @param element the {@link Vertex} that changed
- * @param setValue the new value of the property
- */
- public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues);
-
- /**
- * Raised after a {@link VertexProperty} was removed from the graph.
- *
- * @param vertexProperty the {@link VertexProperty} that was removed
- */
- public void vertexPropertyRemoved(final VertexProperty vertexProperty);
-
- /**
- * Raised after a new {@link Edge} is added.
- *
- * @param edge the {@link Edge} that was added
- */
- public void edgeAdded(final Edge edge);
-
- /**
- * Raised after an {@link Edge} was removed from the graph.
- *
- * @param edge the {@link Edge} that was removed.
- */
- public void edgeRemoved(final Edge edge);
-
- /**
- * Raised after the property of a {@link Edge} changed.
- *
- * @param element the {@link Edge} that changed
- * @param setValue the new value of the property
- */
- public void edgePropertyChanged(final Edge element, final Property oldValue, final Object setValue);
-
- /**
- * Raised after an {@link Property} property was removed from an {@link Edge}.
- *
- * @param property the {@link Property} that was removed
- */
- public void edgePropertyRemoved(final Edge element, final Property property);
-
- /**
- * Raised after the property of a {@link VertexProperty} changed.
- *
- * @param element the {@link VertexProperty} that changed
- * @param setValue the new value of the property
- */
- public void vertexPropertyPropertyChanged(final VertexProperty element, final Property oldValue, final Object setValue);
-
- /**
- * Raised after an {@link Property} property was removed from a {@link VertexProperty}.
- *
- * @param property the {@link Property} that removed
- */
- public void vertexPropertyPropertyRemoved(final VertexProperty element, final Property property);
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java
new file mode 100644
index 0000000..422074c
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/MutationListener.java
@@ -0,0 +1,111 @@
+/*
+ * 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.tinkerpop.gremlin.process.traversal.step.util.event;
+
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Element;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
+
+/**
+ * Interface for a listener to {@link org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy}
+ * change events.
+ *
+ * Implementations of this interface should be added to the list of listeners on the addListener method on
+ * the {@link org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy}.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public interface MutationListener {
+
+ /**
+ * Raised when a new {@link Vertex} is added.
+ *
+ * @param vertex the {@link Vertex} that was added
+ */
+ public void vertexAdded(final Vertex vertex);
+
+ /**
+ * Raised after a {@link Vertex} was removed from the graph.
+ *
+ * @param vertex the {@link Vertex} that was removed
+ */
+ public void vertexRemoved(final Vertex vertex);
+
+ /**
+ * Raised after the property of a {@link Vertex} changed.
+ *
+ * @param element the {@link Vertex} that changed
+ * @param setValue the new value of the property
+ */
+ public void vertexPropertyChanged(final Vertex element, final Property oldValue, final Object setValue, final Object... vertexPropertyKeyValues);
+
+ /**
+ * Raised after a {@link VertexProperty} was removed from the graph.
+ *
+ * @param vertexProperty the {@link VertexProperty} that was removed
+ */
+ public void vertexPropertyRemoved(final VertexProperty vertexProperty);
+
+ /**
+ * Raised after a new {@link Edge} is added.
+ *
+ * @param edge the {@link Edge} that was added
+ */
+ public void edgeAdded(final Edge edge);
+
+ /**
+ * Raised after an {@link Edge} was removed from the graph.
+ *
+ * @param edge the {@link Edge} that was removed.
+ */
+ public void edgeRemoved(final Edge edge);
+
+ /**
+ * Raised after the property of a {@link Edge} changed.
+ *
+ * @param element the {@link Edge} that changed
+ * @param setValue the new value of the property
+ */
+ public void edgePropertyChanged(final Edge element, final Property oldValue, final Object setValue);
+
+ /**
+ * Raised after an {@link Property} property was removed from an {@link Edge}.
+ *
+ * @param property the {@link Property} that was removed
+ */
+ public void edgePropertyRemoved(final Edge element, final Property property);
+
+ /**
+ * Raised after the property of a {@link VertexProperty} changed.
+ *
+ * @param element the {@link VertexProperty} that changed
+ * @param setValue the new value of the property
+ */
+ public void vertexPropertyPropertyChanged(final VertexProperty element, final Property oldValue, final Object setValue);
+
+ /**
+ * Raised after an {@link Property} property was removed from a {@link VertexProperty}.
+ *
+ * @param property the {@link Property} that removed
+ */
+ public void vertexPropertyPropertyRemoved(final VertexProperty element, final Property property);
+}
+
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexAddedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexAddedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexAddedEvent.java
index 4e5917b..aa2dbdc 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexAddedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexAddedEvent.java
@@ -34,7 +34,7 @@ public class VertexAddedEvent implements Event {
}
@Override
- public void fireEvent(final Iterator<GraphChangedListener> eventListeners) {
+ public void fireEvent(final Iterator<MutationListener> eventListeners) {
while (eventListeners.hasNext()) {
eventListeners.next().vertexAdded(vertex);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyChangedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyChangedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyChangedEvent.java
index 0084fec..caf96c4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyChangedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyChangedEvent.java
@@ -32,7 +32,7 @@ public class VertexPropertyChangedEvent extends ElementPropertyChangedEvent {
}
@Override
- void fire(final GraphChangedListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
+ void fire(final MutationListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
listener.vertexPropertyChanged((Vertex) element, oldValue, newValue, vertexPropertyKeyValues);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyChangedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyChangedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyChangedEvent.java
index 6b9b712..633f01b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyChangedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyChangedEvent.java
@@ -32,7 +32,7 @@ public class VertexPropertyPropertyChangedEvent extends ElementPropertyChangedEv
}
@Override
- void fire(final GraphChangedListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
+ void fire(final MutationListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
listener.vertexPropertyPropertyChanged((VertexProperty) element, oldValue, newValue);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyRemovedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyRemovedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyRemovedEvent.java
index 31f7ae3..e7efec7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyRemovedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyPropertyRemovedEvent.java
@@ -32,7 +32,7 @@ public class VertexPropertyPropertyRemovedEvent extends ElementPropertyEvent {
}
@Override
- void fire(final GraphChangedListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
+ void fire(final MutationListener listener, final Element element, final Property oldValue, final Object newValue, final Object... vertexPropertyKeyValues) {
listener.vertexPropertyPropertyRemoved((VertexProperty) element, oldValue);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyRemovedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyRemovedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyRemovedEvent.java
index 8ffdef4..0282a1b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyRemovedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexPropertyRemovedEvent.java
@@ -34,7 +34,7 @@ public class VertexPropertyRemovedEvent implements Event {
}
@Override
- public void fireEvent(final Iterator<GraphChangedListener> eventListeners) {
+ public void fireEvent(final Iterator<MutationListener> eventListeners) {
while (eventListeners.hasNext()) {
eventListeners.next().vertexPropertyRemoved(vertexProperty);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexRemovedEvent.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexRemovedEvent.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexRemovedEvent.java
index 2d691f8..067ab0c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexRemovedEvent.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/event/VertexRemovedEvent.java
@@ -21,7 +21,6 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.util.event;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import java.util.Iterator;
-import java.util.Map;
/**
* @author Stephen Mallette (http://stephen.genoprime.com)
@@ -35,7 +34,7 @@ public class VertexRemovedEvent implements Event {
}
@Override
- public void fireEvent(final Iterator<GraphChangedListener> eventListeners) {
+ public void fireEvent(final Iterator<MutationListener> eventListeners) {
while (eventListeners.hasNext()) {
eventListeners.next().vertexRemoved(vertex);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
index 22b1345..1843190 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategy.java
@@ -20,15 +20,9 @@ package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeByPathStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddPropertyStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.EventCallback;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.GraphChangedListener;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.MutationListener;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import org.apache.tinkerpop.gremlin.structure.Graph;
@@ -51,9 +45,9 @@ import java.util.List;
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public class EventStrategy extends AbstractTraversalStrategy {
- private final List<GraphChangedListener> listeners = new ArrayList<>();
+ private final List<MutationListener> listeners = new ArrayList<>();
- private EventStrategy(final GraphChangedListener... listeners) {
+ private EventStrategy(final MutationListener... listeners) {
this.listeners.addAll(Arrays.asList(listeners));
}
@@ -86,17 +80,17 @@ public class EventStrategy extends AbstractTraversalStrategy {
}
public static class Builder {
- private final List<GraphChangedListener> listeners = new ArrayList<>();
+ private final List<MutationListener> listeners = new ArrayList<>();
Builder() {}
- public Builder addListener(GraphChangedListener listener) {
+ public Builder addListener(MutationListener listener) {
this.listeners.add(listener);
return this;
}
public EventStrategy create() {
- return new EventStrategy(this.listeners.toArray(new GraphChangedListener[this.listeners.size()]));
+ return new EventStrategy(this.listeners.toArray(new MutationListener[this.listeners.size()]));
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java
index ece5d2c..9ab7251 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyTest.java
@@ -21,8 +21,8 @@ package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.ConsoleGraphChangedListener;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.GraphChangedListener;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.ConsoleMutationListener;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.MutationListener;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
import org.junit.Test;
@@ -73,7 +73,7 @@ public class EventStrategyTest {
@Test
public void shouldEventOnMutatingSteps() {
- final GraphChangedListener listener1 = new ConsoleGraphChangedListener(EmptyGraph.instance());
+ final MutationListener listener1 = new ConsoleMutationListener(EmptyGraph.instance());
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1).create();
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/4599dfb8/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
index 62d7c97..2103582 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/EventStrategyProcessTest.java
@@ -24,7 +24,7 @@ import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.UseEngine;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.GraphChangedListener;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.MutationListener;
import org.apache.tinkerpop.gremlin.structure.Compare;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Graph;
@@ -50,8 +50,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldTriggerAddVertex() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -68,8 +68,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldTriggerAddVertexFromStart() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -86,8 +86,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldTriggerAddEdge() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -110,8 +110,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldTriggerAddEdgeByPath() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -134,8 +134,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldTriggerAddVertexPropertyAdded() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -156,8 +156,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldTriggerAddVertexPropertyChanged() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -180,8 +180,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
public void shouldTriggerAddVertexPropertyPropertyChanged() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -203,8 +203,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldTriggerAddEdgePropertyAdded() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -231,8 +231,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldTriggerEdgePropertyChanged() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -259,8 +259,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldTriggerRemoveVertex() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -278,8 +278,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldTriggerRemoveEdge() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -298,8 +298,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
public void shouldTriggerRemoveVertexProperty() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -317,8 +317,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldTriggerRemoveEdgeProperty() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -338,8 +338,8 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
public void shouldTriggerAddVertexPropertyPropertyRemoved() {
- final StubGraphChangedListener listener1 = new StubGraphChangedListener();
- final StubGraphChangedListener listener2 = new StubGraphChangedListener();
+ final StubMutationListener listener1 = new StubMutationListener();
+ final StubMutationListener listener2 = new StubMutationListener();
final EventStrategy eventStrategy = EventStrategy.build()
.addListener(listener1)
.addListener(listener2).create();
@@ -365,7 +365,7 @@ public class EventStrategyProcessTest extends AbstractGremlinProcessTest {
return graphProvider.traversal(graph, strategy);
}
- public static class StubGraphChangedListener implements GraphChangedListener {
+ public static class StubMutationListener implements MutationListener {
private final AtomicLong addEdgeEvent = new AtomicLong(0);
private final AtomicLong addVertexEvent = new AtomicLong(0);
private final AtomicLong vertexRemovedEvent = new AtomicLong(0);