Source Code Cross Referenced for TelnetCommand.java in  » Net » Apache-commons-net-1.4.1 » org » apache » commons » net » telnet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Apache commons net 1.4.1 » org.apache.commons.net.telnet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2005 The Apache Software Foundation
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.apache.commons.net.telnet;
017:
018:        /**
019:         * The TelnetCommand class cannot be instantiated and only serves as a
020:         * storehouse for telnet command constants.
021:         * @author Daniel F. Savarese
022:         * @see org.apache.commons.net.telnet.Telnet
023:         * @see org.apache.commons.net.telnet.TelnetClient
024:         */
025:
026:        public final class TelnetCommand {
027:            /*** The maximum value a command code can have.  This value is 255. ***/
028:            public static final int MAX_COMMAND_VALUE = 255;
029:
030:            /*** Interpret As Command code.  Value is 255 according to RFC 854. ***/
031:            public static final int IAC = 255;
032:
033:            /*** Don't use option code.  Value is 254 according to RFC 854. ***/
034:            public static final int DONT = 254;
035:
036:            /*** Request to use option code.  Value is 253 according to RFC 854. ***/
037:            public static final int DO = 253;
038:
039:            /*** Refuse to use option code.  Value is 252 according to RFC 854. ***/
040:            public static final int WONT = 252;
041:
042:            /*** Agree to use option code.  Value is 251 according to RFC 854. ***/
043:            public static final int WILL = 251;
044:
045:            /*** Start subnegotiation code.  Value is 250 according to RFC 854. ***/
046:            public static final int SB = 250;
047:
048:            /*** Go Ahead code.  Value is 249 according to RFC 854. ***/
049:            public static final int GA = 249;
050:
051:            /*** Erase Line code.  Value is 248 according to RFC 854. ***/
052:            public static final int EL = 248;
053:
054:            /*** Erase Character code.  Value is 247 according to RFC 854. ***/
055:            public static final int EC = 247;
056:
057:            /*** Are You There code.  Value is 246 according to RFC 854. ***/
058:            public static final int AYT = 246;
059:
060:            /*** Abort Output code.  Value is 245 according to RFC 854. ***/
061:            public static final int AO = 245;
062:
063:            /*** Interrupt Process code.  Value is 244 according to RFC 854. ***/
064:            public static final int IP = 244;
065:
066:            /*** Break code.  Value is 243 according to RFC 854. ***/
067:            public static final int BREAK = 243;
068:
069:            /*** Data mark code.  Value is 242 according to RFC 854. ***/
070:            public static final int DM = 242;
071:
072:            /*** No Operation code.  Value is 241 according to RFC 854. ***/
073:            public static final int NOP = 241;
074:
075:            /*** End subnegotiation code.  Value is 240 according to RFC 854. ***/
076:            public static final int SE = 240;
077:
078:            /*** End of record code.  Value is 239. ***/
079:            public static final int EOR = 239;
080:
081:            /*** Abort code.  Value is 238. ***/
082:            public static final int ABORT = 238;
083:
084:            /*** Suspend process code.  Value is 237. ***/
085:            public static final int SUSP = 237;
086:
087:            /*** End of file code.  Value is 236. ***/
088:            public static final int EOF = 236;
089:
090:            /*** Synchronize code.  Value is 242. ***/
091:            public static final int SYNCH = 242;
092:
093:            /*** String representations of commands. ***/
094:            private static final String __commandString[] = { "IAC", "DONT",
095:                    "DO", "WONT", "WILL", "SB", "GA", "EL", "EC", "AYT", "AO",
096:                    "IP", "BRK", "DMARK", "NOP", "SE", "EOR", "ABORT", "SUSP",
097:                    "EOF" };
098:
099:            private static final int __FIRST_COMMAND = IAC;
100:            private static final int __LAST_COMMAND = EOF;
101:
102:            /***
103:             * Returns the string representation of the telnet protocol command
104:             * corresponding to the given command code.
105:             * <p>
106:             * @param code The command code of the telnet protocol command.
107:             * @return The string representation of the telnet protocol command.
108:             ***/
109:            public static final String getCommand(int code) {
110:                return __commandString[__FIRST_COMMAND - code];
111:            }
112:
113:            /***
114:             * Determines if a given command code is valid.  Returns true if valid,
115:             * false if not.
116:             * <p>
117:             * @param code  The command code to test.
118:             * @return True if the command code is valid, false if not.
119:             **/
120:            public static final boolean isValidCommand(int code) {
121:                return (code <= __FIRST_COMMAND && code >= __LAST_COMMAND);
122:            }
123:
124:            // Cannot be instantiated
125:            private TelnetCommand() {
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.