From 401925979dc16f74f794ddd4941f74d0cef770db Mon Sep 17 00:00:00 2001
From: fdorson <fdorson@localhost>
Date: Tue, 07 Jul 2009 13:21:10 +0000
Subject: [PATCH] Fix for issue #4095 : Add getters methods to LDAPUpdateMsg
---
opends/src/server/org/opends/server/replication/protocol/AddMsg.java | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/protocol/AddMsg.java b/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
index dd7ae4b..2c3972a 100644
--- a/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/AddMsg.java
@@ -364,6 +364,24 @@
}
/**
+ * Get the attributes of this add msg.
+ * @throws LDAPException In case of LDAP decoding exception
+ * @throws ASN1Exception In case of ASN1 decoding exception
+ * @return the list of attributes
+ */
+ public List<Attribute> getAttributes() throws LDAPException, ASN1Exception
+ {
+ List<Attribute> attrs = new ArrayList<Attribute>();
+
+ ASN1Reader reader = ASN1.getReader(encodedAttributes);
+
+ while (reader.hasNextElement())
+ attrs.add(LDAPAttribute.decode(reader).toAttribute());
+
+ return attrs;
+ }
+
+ /**
* Set the parent unique id of this add msg.
*
* @param uid the parent unique id.
@@ -394,6 +412,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public byte[] getBytes_V1() throws UnsupportedEncodingException
{
int length = encodedAttributes.length;
--
Gitblit v1.10.0