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>SortResult ::= SEQUENCE {<br>
027 *           sortResult  ENUMERATED {<br>
028 *           success                   (0), -- results are sorted<br>
029 *           operationsError           (1), -- server internal failure<br>
030 *           timeLimitExceeded         (3), -- timelimit reached before sorting was completed<br>
031 *           strongAuthRequired        (8), -- refused to return sorted results via insecure protocol<br>
032 *           adminLimitExceeded       (11), -- too many matching entries for the server to sort<br>
033 *           noSuchAttribute          (16), -- unrecognized attribute type in sort key<br>
034 *           inappropriateMatching    (18), -- unrecognized or inappropriate matching rule in sort key<br>
035 *           insufficientAccessRights (50), -- refused to return sorted results to this client<br>
036 *           busy                     (51), -- too busy to process<br>
037 *           unwillingToPerform       (53), -- unable to sort<br>
038 *           other                    (80)<br>
039 *           },<br>
040 *       attributeType [0] AttributeDescription OPTIONAL }<br><pre>
041 *
042 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
043 */
044public interface SortResponse extends Control
045{
046    /** the OID of the response control */
047    String OID = "1.2.840.113556.1.4.474";
048    
049    /**
050     * sets the sort result
051     * 
052     * @param result
053     */
054    void setSortResult( SortResultCode result );
055    
056    
057    /**
058     * @return the sort result
059     */
060    SortResultCode getSortResult();
061
062    
063    /**
064     * sets the name of the first offending attribute
065     *  
066     * @param attributeName
067     */
068    // didn't name the method setAttribute*Type*
069    // cause in our internal terminology AttributeType is a java type
070    void setAttributeName( String attributeName );
071    
072    
073    /**
074     * @return the name of the first offending attribute
075     */
076    String getAttributeName();
077}