From 80c58327faaa4873369f6bb949e62792c2f708e0 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.
---
opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java | 54 +++++++++++++++++++++++++++---------------------------
1 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java b/opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java
index c2f5c87..4109f27 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java
@@ -25,6 +25,7 @@
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
package org.opends.server.protocols.ldap;
+import org.opends.messages.Message;
@@ -42,8 +43,7 @@
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
-import static org.opends.server.messages.MessageHandler.*;
-import static org.opends.server.messages.ProtocolMessages.*;
+import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.protocols.ldap.LDAPResultCode.*;
import static org.opends.server.util.ServerConstants.*;
@@ -73,7 +73,7 @@
private List<String> referralURLs;
// The error message for this response.
- private String errorMessage;
+ private Message errorMessage;
@@ -100,7 +100,7 @@
* @param resultCode The result code for this response.
* @param errorMessage The error message for this response.
*/
- public SearchResultDoneProtocolOp(int resultCode, String errorMessage)
+ public SearchResultDoneProtocolOp(int resultCode, Message errorMessage)
{
this.resultCode = resultCode;
this.errorMessage = errorMessage;
@@ -119,7 +119,7 @@
* @param matchedDN The matched DN for this response.
* @param referralURLs The referral URLs for this response.
*/
- public SearchResultDoneProtocolOp(int resultCode, String errorMessage,
+ public SearchResultDoneProtocolOp(int resultCode, Message errorMessage,
DN matchedDN, List<String> referralURLs)
{
this.resultCode = resultCode;
@@ -160,7 +160,7 @@
* @return The error message for this response, or <CODE>null</CODE> if none
* is available.
*/
- public String getErrorMessage()
+ public Message getErrorMessage()
{
return errorMessage;
}
@@ -172,7 +172,7 @@
*
* @param errorMessage The error message for this response.
*/
- public void setErrorMessage(String errorMessage)
+ public void setErrorMessage(Message errorMessage)
{
this.errorMessage = errorMessage;
}
@@ -326,18 +326,17 @@
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
- int msgID = MSGID_LDAP_RESULT_DECODE_SEQUENCE;
- String message = getMessage(msgID, String.valueOf(e));
- throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
+ Message message = ERR_LDAP_RESULT_DECODE_SEQUENCE.get(String.valueOf(e));
+ throw new LDAPException(PROTOCOL_ERROR, message, e);
}
int numElements = elements.size();
if ((numElements < 3) || (numElements > 4))
{
- int msgID = MSGID_LDAP_RESULT_DECODE_INVALID_ELEMENT_COUNT;
- String message = getMessage(msgID, numElements);
- throw new LDAPException(PROTOCOL_ERROR, msgID, message);
+ Message message =
+ ERR_LDAP_RESULT_DECODE_INVALID_ELEMENT_COUNT.get(numElements);
+ throw new LDAPException(PROTOCOL_ERROR, message);
}
@@ -353,9 +352,9 @@
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
- int msgID = MSGID_LDAP_RESULT_DECODE_RESULT_CODE;
- String message = getMessage(msgID, String.valueOf(e));
- throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
+ Message message =
+ ERR_LDAP_RESULT_DECODE_RESULT_CODE.get(String.valueOf(e));
+ throw new LDAPException(PROTOCOL_ERROR, message, e);
}
@@ -379,16 +378,17 @@
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
- int msgID = MSGID_LDAP_RESULT_DECODE_MATCHED_DN;
- String message = getMessage(msgID, String.valueOf(e));
- throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
+ Message message =
+ ERR_LDAP_RESULT_DECODE_MATCHED_DN.get(String.valueOf(e));
+ throw new LDAPException(PROTOCOL_ERROR, message, e);
}
- String errorMessage;
+ Message errorMessage;
try
{
- errorMessage = elements.get(2).decodeAsOctetString().stringValue();
+ errorMessage =
+ Message.raw(elements.get(2).decodeAsOctetString().stringValue());
if (errorMessage.length() == 0)
{
errorMessage = null;
@@ -401,9 +401,9 @@
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
- int msgID = MSGID_LDAP_RESULT_DECODE_ERROR_MESSAGE;
- String message = getMessage(msgID, String.valueOf(e));
- throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
+ Message message =
+ ERR_LDAP_RESULT_DECODE_ERROR_MESSAGE.get(String.valueOf(e));
+ throw new LDAPException(PROTOCOL_ERROR, message, e);
}
@@ -432,9 +432,9 @@
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
- int msgID = MSGID_LDAP_RESULT_DECODE_REFERRALS;
- String message = getMessage(msgID, String.valueOf(e));
- throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
+ Message message =
+ ERR_LDAP_RESULT_DECODE_REFERRALS.get(String.valueOf(e));
+ throw new LDAPException(PROTOCOL_ERROR, message, e);
}
}
--
Gitblit v1.10.0