From 7243c66412f9bc84f84d83d84487ad44e40bd223 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Wed, 16 Sep 2026 18:18:52 +0000
Subject: [PATCH] [#995] Classify the failure of a task on the message that reports it (#996)

---
 opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java b/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
index 3501eff..3036dd1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
+++ b/opendj-server-legacy/src/main/java/org/opends/admin/ads/util/ConnectionUtils.java
@@ -13,10 +13,16 @@
  *
  * Copyright 2008-2010 Sun Microsystems, Inc.
  * Portions Copyright 2012-2016 ForgeRock AS.
+ * Portions Copyright 2026 3A Systems, LLC.
  */
 package org.opends.admin.ads.util;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.forgerock.opendj.ldap.Attribute;
+import org.forgerock.opendj.ldap.ByteString;
 import org.forgerock.opendj.ldap.Entry;
 
 /**
@@ -44,4 +50,30 @@
     Attribute attr = entry.getAttribute(attrDesc);
     return (attr != null && !attr.isEmpty()) ? attr.firstValueAsString() : null;
   }
+
+  /**
+   * Returns all the values of this attribute decoded as UTF-8 strings, in the order they were
+   * returned by the server.
+   *
+   * @param entry
+   *          the entry
+   * @param attrDesc
+   *          the attribute description
+   * @return all the values of this attribute decoded as UTF-8 strings, an empty list if the
+   *         attribute is not present.
+   */
+  public static List<String> allValuesAsStrings(Entry entry, String attrDesc)
+  {
+    Attribute attr = entry.getAttribute(attrDesc);
+    if (attr == null || attr.isEmpty())
+    {
+      return Collections.emptyList();
+    }
+    List<String> values = new ArrayList<>(attr.size());
+    for (ByteString value : attr)
+    {
+      values.add(value.toString());
+    }
+    return values;
+  }
 }

--
Gitblit v1.10.0