001/*
002 *   Licensed to the Apache Software Foundation (ASF) under one
003 *   or more contributor license agreements.  See the NOTICE file
004 *   distributed with this work for additional information
005 *   regarding copyright ownership.  The ASF licenses this file
006 *   to you under the Apache License, Version 2.0 (the
007 *   "License"); you may not use this file except in compliance
008 *   with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *   Unless required by applicable law or agreed to in writing,
013 *   software distributed under the License is distributed on an
014 *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *   KIND, either express or implied.  See the License for the
016 *   specific language governing permissions and limitations
017 *   under the License.
018 *
019 */
020package org.apache.directory.api.ldap.model.message.controls;
021
022import org.apache.directory.api.ldap.model.message.Control;
023
024/**
025 * 
026 * <pre>
027 * SortResult ::= SEQUENCE {
028 *           sortResult  ENUMERATED {
029 *           success                   (0), -- results are sorted
030 *           operationsError           (1), -- server internal failure
031 *           timeLimitExceeded         (3), -- timelimit reached before sorting was completed
032 *           strongAuthRequired        (8), -- refused to return sorted results via insecure protocol
033 *           adminLimitExceeded       (11), -- too many matching entries for the server to sort
034 *           noSuchAttribute          (16), -- unrecognized attribute type in sort key
035 *           inappropriateMatching    (18), -- unrecognized or inappropriate matching rule in sort key
036 *           insufficientAccessRights (50), -- refused to return sorted results to this client
037 *           busy                     (51), -- too busy to process
038 *           unwillingToPerform       (53), -- unable to sort
039 *           other                    (80)
040 *           },
041 *       attributeType [0] AttributeDescription OPTIONAL }
042 * </pre>
043 *
044 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
045 */
046public interface SortResponse extends Control
047{
048    /** the OID of the response control */
049    String OID = "1.2.840.113556.1.4.474";
050    
051    /**
052     * sets the sort result
053     * 
054     * @param result The sort result code
055     */
056    void setSortResult( SortResultCode result );
057    
058    
059    /**
060     * @return the sort result
061     */
062    SortResultCode getSortResult();
063
064    
065    /**
066     * Sets the name of the first offending attribute
067     *  
068     * @param attributeName The attribute's name 
069     */
070    // didn't name the method setAttribute*Type*
071    // cause in our internal terminology AttributeType is a java type
072    void setAttributeName( String attributeName );
073    
074    
075    /**
076     * @return the name of the first offending attribute
077     */
078    String getAttributeName();
079}