From 801602d7fa0aba9e5987683d26725daf91885c18 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 10 Jul 2015 08:26:35 +0000
Subject: [PATCH] Code cleanup

---
 opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java |   38 ++++++++++----------------------------
 1 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
index d499756..6ecb5c5 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
@@ -26,21 +26,19 @@
  */
 package org.opends.server.monitors;
 
-
-
 import static org.opends.server.util.ServerConstants.*;
 
+import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.opends.server.admin.std.server.MonitorProviderCfg;
 import org.opends.server.api.Backend;
 import org.opends.server.api.MonitorProvider;
-import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.opends.server.schema.BooleanSyntax;
 import org.opends.server.types.*;
 
-
 /**
  * This class implements a monitor provider that will report generic information
  * for an enabled Directory Server backend, including its backend ID, base DNs,
@@ -51,22 +49,14 @@
 {
   /** The attribute type that will be used to report the backend ID. */
   private AttributeType backendIDType;
-
   /** The attribute type that will be used to report the set of base DNs. */
   private AttributeType baseDNType;
-
   /** The attribute type that will be used to report the number of entries. */
   private AttributeType entryCountType;
-
-  /**
-   * The attribute type that will be used to report the number of entries per
-   * base DN.
-   */
+  /** The attribute type that will be used to report the number of entries per base DN. */
   private AttributeType baseDNEntryCountType;
-
   /** The attribute type that will be used to indicate if a backend is private. */
   private AttributeType isPrivateType;
-
   /** The attribute type that will be used to report the writability mode. */
   private AttributeType writabilityModeType;
 
@@ -89,9 +79,7 @@
     this.backend = backend;
   }
 
-
-
-  /** {@inheritDoc} */
+  @Override
   public void initializeMonitorProvider(MonitorProviderCfg configuration)
   {
     monitorName = backend.getBackendID() + " Backend";
@@ -108,16 +96,12 @@
          DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_WRITABILITY_MODE, true);
   }
 
-
-
-  /** {@inheritDoc} */
+  @Override
   public String getMonitorInstanceName()
   {
     return monitorName;
   }
 
-
-
   /**
    * Retrieves the objectclass that should be included in the monitor entry
    * created from this monitor provider.
@@ -125,25 +109,23 @@
    * @return  The objectclass that should be included in the monitor entry
    *          created from this monitor provider.
    */
+  @Override
   public ObjectClass getMonitorObjectClass()
   {
     return DirectoryConfig.getObjectClass(OC_MONITOR_BACKEND, true);
   }
 
-
-  /** {@inheritDoc} */
+  @Override
   public List<Attribute> getMonitorData()
   {
     LinkedList<Attribute> attrs = new LinkedList<>();
 
     attrs.add(Attributes.create(backendIDType, backend.getBackendID()));
 
-    AttributeBuilder builder = new AttributeBuilder(baseDNType);
     DN[] baseDNs = backend.getBaseDNs();
-    for (DN dn : baseDNs)
-    {
-      builder.add(dn.toString());
-    }
+
+    AttributeBuilder builder = new AttributeBuilder(baseDNType);
+    builder.addAllStrings(Arrays.asList(baseDNs));
     attrs.add(builder.toAttribute());
 
     attrs.add(Attributes.create(isPrivateType, BooleanSyntax

--
Gitblit v1.10.0