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;
021    
022    /**
023     * Type safe enumeration over the various LDAPv3 message types.
024     * 
025     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
026     * @version $Revision: 476948 $
027     */
028    public enum MessageTypeEnum
029    {
030        /** Bind request protocol message type value */
031        BIND_REQUEST( 0x40000000 ),
032    
033        /** Bind response protocol message type value */
034        BIND_RESPONSE( 0x40000001 ),
035    
036        /** Unbind request protocol message type value */
037        UNBIND_REQUEST( 0x40000002 ),
038    
039        /** Search request protocol message type value */
040        SEARCH_REQUEST( 0x40000003 ),
041    
042        /** Search entry response protocol message type value */
043        SEARCH_RES_ENTRY( 0x40000004 ),
044    
045        /** Search done response protocol message type value */
046        SEARCH_RES_DONE( 0x40000005 ),
047    
048        /** Search reference response protocol message type value */
049        SEARCH_RES_REF( 0x40000013 ),
050    
051        /** Modify request protocol message type value */
052        MODIFY_REQUEST( 0x40000006 ),
053    
054        /** Modify response protocol message type value */
055        MODIFY_RESPONSE( 0x40000007 ),
056    
057        /** Add request protocol message type value */
058        ADD_REQUEST( 0x40000008 ),
059    
060        /** Add response protocol message type value */
061        ADD_RESPONSE( 0x40000009 ),
062    
063        /** Delete request protocol message type value */
064        DEL_REQUEST( 0x4000000 ),
065    
066        /** Delete response protocol message type value */
067        DEL_RESPONSE( 0x4000000b ),
068    
069        /** Modify DN request protocol message type value */
070        MOD_DN_REQUEST( 0x4000000c ),
071    
072        /** Modify DN response protocol message type value */
073        MOD_DN_RESPONSE( 0x4000000d ),
074    
075        /** Compare request protocol message type value */
076        COMPARE_REQUEST( 0x4000000e ),
077    
078        /** Compare response protocol message type value */
079        COMPARE_RESPONSE( 0x4000000f ),
080    
081        /** Abandon request protocol message type value */
082        ABANDON_REQUEST( 0x40000010 ),
083    
084        /** Extended request protocol message type value */
085        EXTENDED_REQ( 0x40000017 ),
086    
087        /** Extended response protocol message type value */
088        EXTENDED_RESP( 0x40000018 );
089        
090        private int messageType;
091    
092        /**
093         * Private construct so no other instances can be created other than the
094         * public static constants in this class.
095         * 
096         * @param messageType
097         *            the integer value of the enumeration.
098         */
099        private MessageTypeEnum( int messageType )
100        {
101            this.messageType = messageType;
102        }
103        
104        /**
105         * @return The integer associated with the result code
106         */
107        public int getMessageType()
108        {
109            return messageType;
110        }
111    }