| | |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.controls; |
| | | import org.opends.messages.Message; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.messages.ProtocolMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import static org.opends.messages.ProtocolMessages.*; |
| | | import static org.opends.server.protocols.ldap.LDAPResultCode.PROTOCOL_ERROR; |
| | | import static org.opends.server.util.ServerConstants.OID_PAGED_RESULTS_CONTROL; |
| | | |
| | |
| | | |
| | | if (value == null) |
| | | { |
| | | int msgID = MSGID_LDAP_PAGED_RESULTS_DECODE_NULL; |
| | | String message = getMessage(msgID); |
| | | throw new LDAPException(PROTOCOL_ERROR, msgID, message); |
| | | Message message = ERR_LDAP_PAGED_RESULTS_DECODE_NULL.get(); |
| | | throw new LDAPException(PROTOCOL_ERROR, message); |
| | | } |
| | | |
| | | ArrayList<ASN1Element> elements; |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDAP_PAGED_RESULTS_DECODE_SEQUENCE; |
| | | String message = getMessage(msgID, String.valueOf(e)); |
| | | throw new LDAPException(PROTOCOL_ERROR, msgID, message, e); |
| | | Message message = |
| | | ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE.get(String.valueOf(e)); |
| | | throw new LDAPException(PROTOCOL_ERROR, message, e); |
| | | } |
| | | |
| | | int numElements = elements.size(); |
| | | if (numElements != 2) |
| | | { |
| | | int msgID = MSGID_LDAP_PAGED_RESULTS_DECODE_INVALID_ELEMENT_COUNT; |
| | | String message = getMessage(msgID, numElements); |
| | | throw new LDAPException(PROTOCOL_ERROR, msgID, message); |
| | | Message message = |
| | | ERR_LDAP_PAGED_RESULTS_DECODE_INVALID_ELEMENT_COUNT.get(numElements); |
| | | throw new LDAPException(PROTOCOL_ERROR, message); |
| | | } |
| | | |
| | | try |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDAP_PAGED_RESULTS_DECODE_SIZE; |
| | | String message = getMessage(msgID, String.valueOf(e)); |
| | | throw new LDAPException(PROTOCOL_ERROR, msgID, message, e); |
| | | Message message = |
| | | ERR_LDAP_PAGED_RESULTS_DECODE_SIZE.get(String.valueOf(e)); |
| | | throw new LDAPException(PROTOCOL_ERROR, message, e); |
| | | } |
| | | |
| | | try |
| | |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDAP_PAGED_RESULTS_DECODE_COOKIE; |
| | | String message = getMessage(msgID, String.valueOf(e)); |
| | | throw new LDAPException(PROTOCOL_ERROR, msgID, message, e); |
| | | Message message = |
| | | ERR_LDAP_PAGED_RESULTS_DECODE_COOKIE.get(String.valueOf(e)); |
| | | throw new LDAPException(PROTOCOL_ERROR, message, e); |
| | | } |
| | | } |
| | | |