Source Code Cross Referenced for SMTPReply.java in  » Net » Apache-commons-net-1.4.1 » org » apache » commons » net » smtp » 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.smtp 
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.smtp;
017:
018:        /***
019:         * SMTPReply stores a set of constants for SMTP reply codes.  To interpret
020:         * the meaning of the codes, familiarity with RFC 821 is assumed.
021:         * The mnemonic constant names are transcriptions from the code descriptions
022:         * of RFC 821.  For those who think in terms of the actual reply code values,
023:         * a set of CODE_NUM constants are provided where NUM is the numerical value
024:         * of the code.
025:         * <p>
026:         * <p>
027:         * @author Daniel F. Savarese
028:         ***/
029:
030:        public final class SMTPReply {
031:
032:            public static final int CODE_211 = 211;
033:            public static final int CODE_214 = 214;
034:            public static final int CODE_215 = 215;
035:            public static final int CODE_220 = 220;
036:            public static final int CODE_221 = 221;
037:            public static final int CODE_250 = 250;
038:            public static final int CODE_251 = 251;
039:            public static final int CODE_354 = 354;
040:            public static final int CODE_421 = 421;
041:            public static final int CODE_450 = 450;
042:            public static final int CODE_451 = 451;
043:            public static final int CODE_452 = 452;
044:            public static final int CODE_500 = 500;
045:            public static final int CODE_501 = 501;
046:            public static final int CODE_502 = 502;
047:            public static final int CODE_503 = 503;
048:            public static final int CODE_504 = 504;
049:            public static final int CODE_550 = 550;
050:            public static final int CODE_551 = 551;
051:            public static final int CODE_552 = 552;
052:            public static final int CODE_553 = 553;
053:            public static final int CODE_554 = 554;
054:
055:            public static final int SYSTEM_STATUS = CODE_211;
056:            public static final int HELP_MESSAGE = CODE_214;
057:            public static final int SERVICE_READY = CODE_220;
058:            public static final int SERVICE_CLOSING_TRANSMISSION_CHANNEL = CODE_221;
059:            public static final int ACTION_OK = CODE_250;
060:            public static final int USER_NOT_LOCAL_WILL_FORWARD = CODE_251;
061:            public static final int START_MAIL_INPUT = CODE_354;
062:            public static final int SERVICE_NOT_AVAILABLE = CODE_421;
063:            public static final int ACTION_NOT_TAKEN = CODE_450;
064:            public static final int ACTION_ABORTED = CODE_451;
065:            public static final int INSUFFICIENT_STORAGE = CODE_452;
066:            public static final int UNRECOGNIZED_COMMAND = CODE_500;
067:            public static final int SYNTAX_ERROR_IN_ARGUMENTS = CODE_501;
068:            public static final int COMMAND_NOT_IMPLEMENTED = CODE_502;
069:            public static final int BAD_COMMAND_SEQUENCE = CODE_503;
070:            public static final int COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER = CODE_504;
071:            public static final int MAILBOX_UNAVAILABLE = CODE_550;
072:            public static final int USER_NOT_LOCAL = CODE_551;
073:            public static final int STORAGE_ALLOCATION_EXCEEDED = CODE_552;
074:            public static final int MAILBOX_NAME_NOT_ALLOWED = CODE_553;
075:            public static final int TRANSACTION_FAILED = CODE_554;
076:
077:            // Cannot be instantiated
078:            private SMTPReply() {
079:            }
080:
081:            /***
082:             * Determine if a reply code is a positive preliminary response.  All
083:             * codes beginning with a 1 are positive preliminary responses.
084:             * Postitive preliminary responses are used to indicate tentative success.
085:             * No further commands can be issued to the SMTP server after a positive
086:             * preliminary response until a follow up response is received from the
087:             * server.
088:             * <p>
089:             * <b> Note: </b> <em> No SMTP commands defined in RFC 822 provide this
090:             * type of reply. </em>
091:             * <p>
092:             * @param reply  The reply code to test.
093:             * @return True if a reply code is a postive preliminary response, false
094:             *         if not.
095:             ***/
096:            public static boolean isPositivePreliminary(int reply) {
097:                return (reply >= 100 && reply < 200);
098:            }
099:
100:            /***
101:             * Determine if a reply code is a positive completion response.  All
102:             * codes beginning with a 2 are positive completion responses.
103:             * The SMTP server will send a positive completion response on the final
104:             * successful completion of a command.
105:             * <p>
106:             * @param reply  The reply code to test.
107:             * @return True if a reply code is a postive completion response, false
108:             *         if not.
109:             ***/
110:            public static boolean isPositiveCompletion(int reply) {
111:                return (reply >= 200 && reply < 300);
112:            }
113:
114:            /***
115:             * Determine if a reply code is a positive intermediate response.  All
116:             * codes beginning with a 3 are positive intermediate responses.
117:             * The SMTP server will send a positive intermediate response on the
118:             * successful completion of one part of a multi-part sequence of
119:             * commands.  For example, after a successful DATA command, a positive
120:             * intermediate response will be sent to indicate that the server is
121:             * ready to receive the message data.
122:             * <p>
123:             * @param reply  The reply code to test.
124:             * @return True if a reply code is a postive intermediate response, false
125:             *         if not.
126:             ***/
127:            public static boolean isPositiveIntermediate(int reply) {
128:                return (reply >= 300 && reply < 400);
129:            }
130:
131:            /***
132:             * Determine if a reply code is a negative transient response.  All
133:             * codes beginning with a 4 are negative transient responses.
134:             * The SMTP server will send a negative transient response on the
135:             * failure of a command that can be reattempted with success.
136:             * <p>
137:             * @param reply  The reply code to test.
138:             * @return True if a reply code is a negative transient response, false
139:             *         if not.
140:             ***/
141:            public static boolean isNegativeTransient(int reply) {
142:                return (reply >= 400 && reply < 500);
143:            }
144:
145:            /***
146:             * Determine if a reply code is a negative permanent response.  All
147:             * codes beginning with a 5 are negative permanent responses.
148:             * The SMTP server will send a negative permanent response on the
149:             * failure of a command that cannot be reattempted with success.
150:             * <p>
151:             * @param reply  The reply code to test.
152:             * @return True if a reply code is a negative permanent response, false
153:             *         if not.
154:             ***/
155:            public static boolean isNegativePermanent(int reply) {
156:                return (reply >= 500 && reply < 600);
157:            }
158:
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.