From cfc513043c5830b5a967733066068c7097b42e3c 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.
---
opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java b/opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java
index 1e0ff6f..a8b69f0 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java
@@ -25,6 +25,7 @@
* Portions Copyright 2007 Sun Microsystems, Inc.
*/
package org.opends.server.controls;
+import org.opends.messages.Message;
@@ -39,8 +40,7 @@
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
-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.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -461,9 +461,8 @@
ASN1OctetString controlValue = control.getValue();
if (controlValue == null)
{
- int msgID = MSGID_VLVREQ_CONTROL_NO_VALUE;
- String message = getMessage(msgID);
- throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
+ Message message = INFO_VLVREQ_CONTROL_NO_VALUE.get();
+ throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
}
try
@@ -474,9 +473,9 @@
if ((elements.size() < 3) || (elements.size() > 4))
{
- int msgID = MSGID_VLVREQ_CONTROL_INVALID_ELEMENT_COUNT;
- String message = getMessage(msgID, elements.size());
- throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
+ Message message =
+ INFO_VLVREQ_CONTROL_INVALID_ELEMENT_COUNT.get(elements.size());
+ throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
}
int beforeCount = elements.get(0).decodeAsInteger().intValue();
@@ -501,10 +500,9 @@
break;
default:
- int msgID = MSGID_VLVREQ_CONTROL_INVALID_TARGET_TYPE;
- String message = getMessage(msgID, byteToHex(targetType));
- throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID,
- message);
+ Message message = INFO_VLVREQ_CONTROL_INVALID_TARGET_TYPE.get(
+ byteToHex(targetType));
+ throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
}
ASN1OctetString contextID = null;
@@ -524,9 +522,9 @@
}
catch (Exception e)
{
- int msgID = MSGID_VLVREQ_CONTROL_CANNOT_DECODE_VALUE;
- String message = getMessage(msgID, getExceptionMessage(e));
- throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message, e);
+ Message message =
+ INFO_VLVREQ_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
+ throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
}
}
--
Gitblit v1.10.0