From 94bbd5bb7c20a490558d8ec97d1be7e3dc492a42 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 09 Sep 2007 23:08:09 +0000
Subject: [PATCH] Update the server to provide a basic framework for controlling when plugins will be invoked. There are two basic changes:
---
opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java | 66 +++++++++++++++++++++++++++++++++
1 files changed, 66 insertions(+), 0 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java
index fa77cfa..735636e 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java
@@ -89,6 +89,8 @@
private static AtomicInteger preOperationCounter = new AtomicInteger(0);
private static AtomicInteger postOperationCounter = new AtomicInteger(0);
private static AtomicInteger postResponseCounter = new AtomicInteger(0);
+ private static AtomicInteger postSynchronizationCounter =
+ new AtomicInteger(0);
private static AtomicInteger searchEntryCounter = new AtomicInteger(0);
private static AtomicInteger searchReferenceCounter = new AtomicInteger(0);
private static AtomicInteger subordinateModifyDNCounter =
@@ -704,6 +706,69 @@
* {@inheritDoc}
*/
@Override()
+ public void doPostSynchronization(PostSynchronizationAddOperation
+ addOperation)
+ {
+ postSynchronizationCounter.incrementAndGet();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override()
+ public void doPostSynchronization(PostSynchronizationModifyOperation
+ modifyOperation)
+ {
+ postSynchronizationCounter.incrementAndGet();
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override()
+ public void doPostSynchronization(PostSynchronizationModifyDNOperation
+ modifyDNOperation)
+ {
+ postSynchronizationCounter.incrementAndGet();
+ }
+
+
+
+ /**
+ * Retrieves the number of times that the post-synchronization plugins have
+ * been called since the last reset.
+ *
+ * @return The number of times that the post-synchronization plugins have
+ * been called since the last reset.
+ */
+ public static int getPostSynchronizationCount()
+ {
+ return postSynchronizationCounter.get();
+ }
+
+
+
+ /**
+ * Resets the post-synchronization plugin invocation count to zero.
+ *
+ * @return The post-synchronization plugin invocation count before it was
+ * reset.
+ */
+ public static int resetPostSynchronizationCount()
+ {
+ return postSynchronizationCounter.getAndSet(0);
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override()
public SearchEntryPluginResult
processSearchEntry(SearchEntrySearchOperation searchOperation,
SearchResultEntry searchEntry)
@@ -1031,6 +1096,7 @@
resetPreOperationCount();
resetPostOperationCount();
resetPostResponseCount();
+ resetPostSynchronizationCount();
resetSearchEntryCount();
resetSearchReferenceCount();
resetSubordinateModifyDNCount();
--
Gitblit v1.10.0