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    
021    package org.apache.directory.server.dns.messages;
022    
023    
024    import org.apache.directory.server.dns.util.EnumConverter;
025    import org.apache.directory.server.dns.util.ReverseEnumMap;
026    
027    
028    /**
029     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030     * @version $Rev: 547524 $, $Date: 2007-06-15 06:42:26 +0200 (Fri, 15 Jun 2007) $
031     */
032    public enum ServiceType implements EnumConverter<Byte>
033    {
034        /** Null */
035        NULL(0),
036    
037        /** Remote job entry */
038        RJE(5),
039    
040        /** Echo */
041        ECHO(7),
042    
043        /** Discard */
044        DISCARD(9),
045    
046        /** Active users */
047        USERS(11),
048    
049        /** Daytime */
050        DAYTIME(13),
051    
052        /** Quote of the day */
053        QUOTE(17),
054    
055        /** Character generator */
056        CHARGEN(19),
057    
058        /** File Transfer [Default Data] */
059        FTP_DATA(20),
060    
061        /** File Transfer [Control] */
062        FTP(21),
063    
064        /** Telnet */
065        TELNET(23),
066    
067        /** Simple Mail Transfer */
068        SMTP(25),
069    
070        /** NSW User System FE */
071        NSW_FE(27),
072    
073        /** MSG ICP */
074        MSG_ICP(29),
075    
076        /** MSG Authentication */
077        MSG_AUTH(31),
078    
079        /** Display Support Protocol */
080        DSP(33),
081    
082        /** Time */
083        TIME(37),
084    
085        /** Resource Location Protocol */
086        RLP(39),
087    
088        /** Graphics */
089        GRAPHICS(41),
090    
091        /** Host Name Server */
092        NAMESERVER(42),
093    
094        /** Who Is */
095        NICKNAME(43),
096    
097        /** MPM FLAGS Protocol */
098        MPM_FLAGS(44),
099    
100        /** Message Processing Module [recv] */
101        MPM(45),
102    
103        /** MPM [default send] */
104        MPM_SND(46),
105    
106        /** NI FTP */
107        NI_FTP(47),
108    
109        /** Login Host Protocol */
110        LOGIN(49),
111    
112        /** IMP Logical Address Maintenance */
113        LA_MAINT(51),
114    
115        /** Domain Name Server */
116        DOMAIN(53),
117    
118        /** ISI Graphics Language */
119        ISI_GL(55),
120    
121        /** NI MAIL */
122        NI_MAIL(61),
123    
124        /** VIA Systems - FTP */
125        VIA_FTP(63),
126    
127        /** TACACS-Database Service */
128        TACACS_DS(65),
129    
130        /** Bootstrap Protocol Server */
131        BOOTPS(67),
132    
133        /** Bootstrap Protocol Client */
134        BOOTPC(68),
135    
136        /** Trivial File Transfer */
137        TFTP(69),
138    
139        /** Remote Job Service */
140        NETRJS_1(71),
141    
142        /** Remote Job Service */
143        NETRJS_2(72),
144    
145        /** Remote Job Service */
146        NETRJS_3(73),
147    
148        /** Remote Job Service */
149        NETRJS_4(74),
150    
151        /** Finger */
152        FINGER(79),
153    
154        /** HOSTS2 Name Server */
155        HOSTS2_NS(81),
156    
157        /** SU/MIT Telnet Gateway */
158        SU_MIT_TG(89),
159    
160        /** MIT Dover Spooler */
161        MIT_DOV(91),
162    
163        /** Device Control Protocol */
164        DCP(93),
165    
166        /** SUPDUP */
167        SUPDUP(95),
168    
169        /** Swift Remote Virtual File Protocol */
170        SWIFT_RVF(97),
171    
172        /** TAC News */
173        TACNEWS(98),
174    
175        /** Metagram Relay */
176        METAGRAM(99),
177    
178        /** NIC Host Name Server */
179        HOSTNAME(101),
180    
181        /** ISO-TSAP */
182        ISO_TSAP(102),
183    
184        /** X400 */
185        X400(103),
186    
187        /** X400-SND */
188        X400_SND(104),
189    
190        /** Mailbox Name Nameserver */
191        CSNET_NS(105),
192    
193        /** Remote Telnet Service */
194        RTELNET(107),
195    
196        /** Post Office Protocol - Version 2 */
197        POP_2(109),
198    
199        /** SUN Remote Procedure Call */
200        SUNRPC(111),
201    
202        /** Authentication Service */
203        AUTH(113),
204    
205        /** Simple File Transfer Protocol */
206        SFTP(115),
207    
208        /** UUCP Path Service */
209        UUCP_PATH(117),
210    
211        /** Network News Transfer Protocol */
212        NNTP(119),
213    
214        /** HYDRA Expedited Remote Procedure */
215        ERPC(121),
216    
217        /** Network Time Protocol */
218        NTP(123),
219    
220        /** Locus PC-Interface Net Map Server */
221        LOCUS_MAP(125),
222    
223        /** Locus PC-Interface Conn Server */
224        LOCUS_CON(127),
225    
226        /** Password Generator Protocol */
227        PWDGEN(129),
228    
229        /** CISCO FNATIVE */
230        CISCO_FNA(130),
231    
232        /** CISCO TNATIVE */
233        CISCO_TNA(131),
234    
235        /** CISCO SYSMAINT */
236        CISCO_SYS(132),
237    
238        /** Statistics Service */
239        STATSRV(133),
240    
241        /** INGRES-NET Service */
242        INGRES_NET(134),
243    
244        /** Location Service */
245        LOC_SRV(135),
246    
247        /** PROFILE Naming System */
248        PROFILE(136),
249    
250        /** NETBIOS Name Service */
251        NETBIOS_NS(137),
252    
253        /** NETBIOS Datagram Service */
254        NETBIOS_DGM(138),
255    
256        /** NETBIOS Session Service */
257        NETBIOS_SSN(139),
258    
259        /** EMFIS Data Service */
260        EMFIS_DATA(140),
261    
262        /** EMFIS Control Service */
263        EMFIS_CNTL(141),
264    
265        /** Britton-Lee IDM */
266        BL_IDM(142),
267    
268        /** Survey Measurement */
269        SUR_MEAS(243),
270    
271        /** LINK */
272        LINK(245);
273    
274        private static ReverseEnumMap<Byte, ServiceType> map = new ReverseEnumMap<Byte, ServiceType>( ServiceType.class );
275    
276        private final byte value;
277    
278    
279        private ServiceType( int value )
280        {
281            this.value = ( byte ) value;
282        }
283    
284    
285        public Byte convert()
286        {
287            return this.value;
288        }
289    
290    
291        /**
292         * Converts an ordinal value into a {@link ServiceType}.
293         *
294         * @param value
295         * @return The {@link ServiceType}.
296         */
297        public static ServiceType convert( byte value )
298        {
299            return map.get( value );
300        }
301    }