mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

kenneth_suter
15.34.2007 cfc513043c5830b5a967733066068c7097b42e3c
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyResponseProtocolOp.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 ModifyResponseProtocolOp(int resultCode, String errorMessage)
  public ModifyResponseProtocolOp(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 ModifyResponseProtocolOp(int resultCode, String errorMessage,
  public ModifyResponseProtocolOp(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;
  }
@@ -319,18 +319,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);
    }
@@ -346,9 +345,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);
    }
@@ -372,16 +371,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;
@@ -394,9 +394,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);
    }
@@ -425,9 +425,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);
      }
    }