From 09fcb137f6d46e0c32f03b0313ac445a2ee7ecc3 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 25 Sep 2006 09:03:39 +0000
Subject: [PATCH] Implement test suite for org.opends.server.types.AttributeType and make it immutable (it's still not 100% immutable - the constructors do not perform deep copies of the extra properties).
---
opends/src/server/org/opends/server/plugins/EntryUUIDPlugin.java | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/opends/src/server/org/opends/server/plugins/EntryUUIDPlugin.java b/opends/src/server/org/opends/server/plugins/EntryUUIDPlugin.java
index 4afdccb..9c35138 100644
--- a/opends/src/server/org/opends/server/plugins/EntryUUIDPlugin.java
+++ b/opends/src/server/org/opends/server/plugins/EntryUUIDPlugin.java
@@ -29,6 +29,7 @@
import java.util.ArrayList;
+import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -74,6 +75,13 @@
+ /**
+ * The name of the entryUUID attribute type.
+ */
+ private static final String ENTRYUUID = "entryuuid";
+
+
+
// The attribute type for the "entryUUID" attribute.
private AttributeType entryUUIDType;
@@ -144,13 +152,17 @@
// Get the entryUUID attribute type.
- entryUUIDType = DirectoryServer.getAttributeType("entryuuid");
+ entryUUIDType = DirectoryServer.getAttributeType(ENTRYUUID);
if (entryUUIDType == null)
{
- entryUUIDType = DirectoryServer.getDefaultAttributeType("entryUUID");
- entryUUIDType.setUsage(AttributeUsage.DIRECTORY_OPERATION);
- entryUUIDType.setNoUserModification(true);
- entryUUIDType.setSingleValue(true);
+ entryUUIDType = new AttributeType(ENTRYUUID,
+ Collections.singleton(ENTRYUUID),
+ ENTRYUUID,
+ null,
+ null,
+ DirectoryServer.getDefaultAttributeSyntax(),
+ AttributeUsage.DIRECTORY_OPERATION,
+ false, true, false, true);
}
}
--
Gitblit v1.10.0