From 1c67282f3df6ce5ae04d2c750367e52582e78d09 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Sun, 02 Sep 2007 16:30:55 +0000
Subject: [PATCH] Minor refactoring of the admin driver API. Remove the hasManagedObject methods and replace them with a single managedObjectExists method. This will be more useful and more simple for dependency call-backs.

---
 opends/src/server/org/opends/server/admin/client/spi/AbstractManagedObject.java |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/client/spi/AbstractManagedObject.java b/opends/src/server/org/opends/server/admin/client/spi/AbstractManagedObject.java
index 5e9c9c2..44480e0 100644
--- a/opends/src/server/org/opends/server/admin/client/spi/AbstractManagedObject.java
+++ b/opends/src/server/org/opends/server/admin/client/spi/AbstractManagedObject.java
@@ -342,7 +342,7 @@
     validateRelationDefinition(r);
     Driver ctx = getDriver();
     try {
-      return ctx.hasManagedObject(path, r);
+      return ctx.managedObjectExists(path.child(r));
     } catch (ManagedObjectNotFoundException e) {
       throw new ConcurrentModificationException();
     }
@@ -668,11 +668,9 @@
       Driver ctx = getDriver();
 
       try {
-        ctx.getManagedObject(path);
-      } catch (DefinitionDecodingException e) {
-        // Ignore.
-      } catch (ManagedObjectDecodingException e) {
-        // Ignore.
+        if (!ctx.managedObjectExists(path)) {
+          throw new ConcurrentModificationException();
+        }
       } catch (ManagedObjectNotFoundException e) {
         throw new ConcurrentModificationException();
       }

--
Gitblit v1.10.0