From 22094368c2865dcfb6daf8366425212b721a4657 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 05 Feb 2009 17:42:14 +0000
Subject: [PATCH] Merge ASN1 branch to trunk
---
opends/src/server/org/opends/server/tools/LDAPCompare.java | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/LDAPCompare.java b/opends/src/server/org/opends/server/tools/LDAPCompare.java
index e352177..5117e2e 100644
--- a/opends/src/server/org/opends/server/tools/LDAPCompare.java
+++ b/opends/src/server/org/opends/server/tools/LDAPCompare.java
@@ -40,16 +40,12 @@
import java.util.concurrent.atomic.AtomicInteger;
import org.opends.server.protocols.asn1.ASN1Exception;
-import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.CompareRequestProtocolOp;
import org.opends.server.protocols.ldap.CompareResponseProtocolOp;
-import org.opends.server.protocols.ldap.LDAPControl;
import org.opends.server.protocols.ldap.LDAPFilter;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.ProtocolOp;
-import org.opends.server.types.NullOutputStream;
-import org.opends.server.types.DebugLogLevel;
-import org.opends.server.types.LDAPException;
+import org.opends.server.types.*;
import org.opends.server.util.Base64;
import org.opends.server.util.EmbeddedUtils;
import org.opends.server.util.PasswordReader;
@@ -67,6 +63,7 @@
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import static org.opends.server.tools.ToolConstants.*;
+import org.opends.server.controls.LDAPAssertionRequestControl;
/**
@@ -191,9 +188,9 @@
LDAPCompareOptions compareOptions)
throws IOException, LDAPException
{
- ArrayList<LDAPControl> controls = compareOptions.getControls();
- ASN1OctetString dnOctetStr = new ASN1OctetString(line);
- ASN1OctetString attrValOctetStr = new ASN1OctetString(attributeVal);
+ ArrayList<Control> controls = compareOptions.getControls();
+ ByteString dnOctetStr = ByteString.valueOf(line);
+ ByteString attrValOctetStr = ByteString.wrap(attributeVal);
ProtocolOp protocolOp = new CompareRequestProtocolOp(dnOctetStr,
attributeType, attrValOctetStr);
@@ -816,7 +813,7 @@
{
for (String ctrlString : controlStr.getValues())
{
- LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err);
+ Control ctrl = LDAPToolUtils.getControl(ctrlString, err);
if(ctrl == null)
{
Message message = ERR_TOOL_INVALID_CONTROL_STRING.get(ctrlString);
@@ -836,9 +833,8 @@
{
filter = LDAPFilter.decode(filterString);
- LDAPControl assertionControl =
- new LDAPControl(OID_LDAP_ASSERTION, true,
- new ASN1OctetString(filter.encode().encode()));
+ Control assertionControl =
+ new LDAPAssertionRequestControl(true, filter);
compareOptions.getControls().add(assertionControl);
}
catch (LDAPException le)
--
Gitblit v1.10.0