| | |
| | | import org.opends.server.controls.PagedResultsControl; |
| | | import org.opends.server.controls.ServerSideSortRequestControl; |
| | | import org.opends.server.controls.ServerSideSortResponseControl; |
| | | import org.opends.server.controls.VLVRequestControl; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | |
| | | List<Control> controls = searchOperation.getRequestControls(); |
| | | PagedResultsControl pageRequest = null; |
| | | ServerSideSortRequestControl sortRequest = null; |
| | | VLVRequestControl vlvRequest = null; |
| | | if (controls != null) |
| | | { |
| | | for (Control control : controls) |
| | |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | e.getMessage(), e.getMessageID(), e); |
| | | } |
| | | |
| | | if (vlvRequest != null) |
| | | { |
| | | int msgID = MSGID_JEB_SEARCH_CANNOT_MIX_PAGEDRESULTS_AND_VLV; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | message, msgID); |
| | | } |
| | | } |
| | | } |
| | | else if (control.getOID().equals(OID_SERVER_SIDE_SORT_REQUEST_CONTROL)) |
| | |
| | | } |
| | | } |
| | | } |
| | | else if (control.getOID().equals(OID_VLV_REQUEST_CONTROL)) |
| | | { |
| | | // Ignore all but the first VLV request control. |
| | | if (vlvRequest == null) |
| | | { |
| | | try |
| | | { |
| | | vlvRequest = VLVRequestControl.decodeControl(control); |
| | | } |
| | | catch (LDAPException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | e.getMessage(), e.getMessageID(), e); |
| | | } |
| | | |
| | | if (pageRequest != null) |
| | | { |
| | | int msgID = MSGID_JEB_SEARCH_CANNOT_MIX_PAGEDRESULTS_AND_VLV; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | message, msgID); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | entryIDList = EntryIDSetSorter.sort(this, entryIDList, |
| | | searchOperation, |
| | | sortRequest.getSortOrder()); |
| | | sortRequest.getSortOrder(), |
| | | vlvRequest); |
| | | searchOperation.addResponseControl( |
| | | new ServerSideSortResponseControl(LDAPResultCode.SUCCESS, null)); |
| | | } |