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     */
020    package org.apache.directory.shared.ldap.message.control;
021    
022    import org.apache.directory.shared.ldap.util.StringTools;
023    
024    
025    /**
026     * Control which allows for the management of referrals and other DSA specific
027     * entities without processing them: meaning the referrals are treated as
028     * regular entries using this control. More information is available in <a
029     * href="">RFC 3296</a>. Below we have included section 3 of the RFC describing
030     * this control:
031     * 
032     * <pre>
033     *  3.  The ManageDsaIT Control
034     * 
035     *   The client may provide the ManageDsaIT control with an operation to
036     *   indicate that the operation is intended to manage objects within the
037     *   DSA (server) Information Tree.  The control causes Directory-specific
038     *   entries (DSEs), regardless of type, to be treated as normal entries
039     *   allowing clients to interrogate and update these entries using LDAP
040     *   operations.
041     * 
042     *   A client MAY specify the following control when issuing an add,
043     *   compare, delete, modify, modifyDN, search request or an extended
044     *   operation for which the control is defined.
045     * 
046     *   The control type is 2.16.840.1.113730.3.4.2.  The control criticality
047     *   may be TRUE or, if FALSE, absent.  The control value is absent.
048     * 
049     *   When the control is present in the request, the server SHALL NOT
050     *   generate a referral or continuation reference based upon information
051     *   held in referral objects and instead SHALL treat the referral object
052     *   as a normal entry.  The server, however, is still free to return
053     *   referrals for other reasons.  When not present, referral objects
054     *   SHALL be handled as described above.
055     * 
056     *   The control MAY cause other objects to be treated as normal entries
057     *   as defined by subsequent documents.
058     * </pre>
059     * 
060     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
061     * @version $Rev: 764131 $
062     */
063    public class ManageDsaITControl extends InternalAbstractControl
064    {
065        public static final String CONTROL_OID = "2.16.840.1.113730.3.4.2";
066    
067        private static final long serialVersionUID = -8844249964346248321L;
068    
069        /**
070         * Returns an empty byte[] every time.
071         */
072        public byte[] getEncodedValue()
073        {
074            return StringTools.EMPTY_BYTES;
075        }
076    
077    
078        /**
079         * Returns an empty byte[] every time.
080         */
081        public byte[] getValue()
082        {
083            return StringTools.EMPTY_BYTES;
084        }
085    
086    
087        /**
088         * Returns "2.16.840.1.113730.3.4.2" every time.
089         */
090        public String getType()
091        {
092            return CONTROL_OID;
093        }
094    
095    
096        /**
097         * Returns "2.16.840.1.113730.3.4.2" every time.
098         */
099        public String getID()
100        {
101            return CONTROL_OID;
102        }
103    }