From c8b1165dbfbee716e8163f42301c650b370248af Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Tue, 21 Feb 2012 15:49:01 +0000
Subject: [PATCH] Initial cleanup work for OPENDJ-181: DirectoryException provided value has an invalid length for a UUID

---
 opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java b/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java
index 450f2bf..7080249 100644
--- a/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java
+++ b/opends/src/server/org/opends/server/replication/plugin/EntryHistorical.java
@@ -23,7 +23,7 @@
  *
  *
  *      Copyright 2006-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2011 ForgeRock AS
+ *      Portions Copyright 2011-2012 ForgeRock AS
  */
 package org.opends.server.replication.plugin;
 
@@ -71,7 +71,7 @@
   /**
    * Name of the attribute used to store historical information.
    */
-  public static final String HISTORICALATTRIBUTENAME = "ds-sync-hist";
+  public static final String HISTORICAL_ATTRIBUTE_NAME = "ds-sync-hist";
 
   /**
    * Name used to store attachment of historical information in the
@@ -83,7 +83,7 @@
   /**
    * Name of the entryuuid attribute.
    */
-  public static final String ENTRYUIDNAME = "entryuuid";
+  public static final String ENTRYUUID_ATTRIBUTE_NAME = "entryuuid";
 
   /* The delay to purge the historical informations
    * This delay indicates the time the domain keeps the historical
@@ -320,7 +320,7 @@
       PreOperationAddOperation addOperation)
   {
     AttributeType historicalAttrType =
-      DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+      DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
 
     // Get the changeNumber from the attached synchronization context
     // Create the attribute (encoded)
@@ -346,7 +346,7 @@
   private static AttributeValue encodeAddHistorical(ChangeNumber cn)
   {
     AttributeType historicalAttrType =
-      DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+      DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
 
     String strValue = "dn:" + cn.toString() +":add";
     AttributeValue val = AttributeValues.create(historicalAttrType, strValue);
@@ -365,7 +365,7 @@
   private static AttributeValue encodeMODDNHistorical(ChangeNumber cn)
   {
     AttributeType historicalAttrType =
-      DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+      DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
 
     String strValue = "dn:" + cn.toString() +":moddn";
     AttributeValue val = AttributeValues.create(historicalAttrType, strValue);
@@ -450,7 +450,7 @@
       purgeDate = TimeThread.getTime() - purgeDelayInMillisec;
 
     AttributeType historicalAttrType =
-      DirectoryServer.getSchema().getAttributeType(HISTORICALATTRIBUTENAME);
+      DirectoryServer.getSchema().getAttributeType(HISTORICAL_ATTRIBUTE_NAME);
     AttributeBuilder builder = new AttributeBuilder(historicalAttrType);
 
     for (Map.Entry<AttributeType, AttrHistoricalWithOptions> entryWithOptions :
@@ -837,7 +837,7 @@
             }
             else
             {
-              String uuidString = getEntryUuid(entry);
+              String uuidString = getEntryUUID(entry);
               if (uuidString != null)
               {
                 modifyFakeOperation = new FakeModifyOperation(entry.getDN(),
@@ -866,7 +866,7 @@
    */
   public static List<Attribute> getHistoricalAttr(Entry entry)
   {
-    return entry.getAttribute(HISTORICALATTRIBUTENAME);
+    return entry.getAttribute(HISTORICAL_ATTRIBUTE_NAME);
   }
 
   /**
@@ -876,11 +876,11 @@
    *
    * @return The Unique Id of the entry if it has one. null, otherwise.
    */
-  public static String getEntryUuid(Entry entry)
+  public static String getEntryUUID(Entry entry)
   {
     String uuidString = null;
     AttributeType entryuuidAttrType =
-      DirectoryServer.getSchema().getAttributeType(ENTRYUIDNAME);
+      DirectoryServer.getSchema().getAttributeType(ENTRYUUID_ATTRIBUTE_NAME);
     List<Attribute> uuidAttrs =
              entry.getOperationalAttribute(entryuuidAttrType);
     if (uuidAttrs != null)
@@ -903,12 +903,12 @@
    * @param op The operation
    * @return The Entry Unique Id String form.
    */
-  public static String getEntryUuid(PreOperationAddOperation op)
+  public static String getEntryUUID(PreOperationAddOperation op)
   {
     String uuidString = null;
     Map<AttributeType, List<Attribute>> attrs = op.getOperationalAttributes();
     AttributeType entryuuidAttrType =
-      DirectoryServer.getSchema().getAttributeType(ENTRYUIDNAME);
+      DirectoryServer.getSchema().getAttributeType(ENTRYUUID_ATTRIBUTE_NAME);
     List<Attribute> uuidAttrs = attrs.get(entryuuidAttrType);
 
     if (uuidAttrs != null)
@@ -936,7 +936,7 @@
   {
     AttributeType attrType = attr.getAttributeType();
     return
-      attrType.getNameOrOID().equals(EntryHistorical.HISTORICALATTRIBUTENAME);
+      attrType.getNameOrOID().equals(EntryHistorical.HISTORICAL_ATTRIBUTE_NAME);
   }
 
   /**

--
Gitblit v1.10.0