Source Code Cross Referenced for PostOffice.java in  » Web-Mail » Jwma » dtw » webmail » util » config » 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 » Web Mail » Jwma » dtw.webmail.util.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /***
002:         * jwma Java WebMail
003:         * Copyright (c) 2000-2003 jwma team
004:         *
005:         * jwma is free software; you can distribute and use this source
006:         * under the terms of the BSD-style license received along with
007:         * the distribution.
008:         ***/package dtw.webmail.util.config;
009:
010:        import org.apache.log4j.Logger;
011:
012:        import java.util.Properties;
013:        import java.net.InetAddress;
014:        import java.io.Serializable;
015:
016:        /** 
017:         * This class...
018:         * <p>
019:         * @author Dieter Wimberger (wimpi)
020:         * @version (created Feb 13, 2003)
021:         */
022:        public class PostOffice implements  Serializable {
023:
024:            //class attributes
025:            private static Logger log = Logger.getLogger(PostOffice.class);
026:
027:            //instance attributes
028:            private String m_Name = "Default";
029:            private String m_Address = "localhost";
030:            private int m_Port = -1; //protocol default
031:            private String m_RootFolder = "";
032:            private boolean m_Secure = false;
033:            private String m_Type = "mixed";
034:            private String m_Protocol = "imap";
035:            private boolean m_Default = false;
036:            private String m_ReplyToDomain;
037:
038:            /**
039:             * Constructs a new <tt>PostOffice</tt> instance.
040:             */
041:            public PostOffice() {
042:            }//constructor
043:
044:            /**
045:             * Returns a common name for this <tt>PostOffice</tt>.
046:             * Naming for different post offices should be kept unique.
047:             *
048:             * @return the name as <tt>String</tt>.
049:             */
050:            public String getName() {
051:                return m_Name;
052:            }//getName
053:
054:            /**
055:             * Sets the common name for this <tt>PostOffice</tt>.
056:             *
057:             * @param name the name as <tt>String</tt>.
058:             */
059:            public void setName(String name) {
060:                m_Name = name;
061:            }//setName
062:
063:            /**
064:             * Returns the protocol required for
065:             * this <tt>PostOffice</tt>.
066:             *
067:             * @return the protocol as <tt>String</tt>.
068:             */
069:            public String getProtocol() {
070:                return m_Protocol;
071:            }//getProtocol
072:
073:            /**
074:             * Sets the protocol required for
075:             * this <tt>PostOffice</tt>.
076:             *
077:             * @param protocol the protocol as <tt>String</tt>.
078:             */
079:            public void setProtocol(String protocol) {
080:                m_Protocol = protocol;
081:            }//setProtocol
082:
083:            /**
084:             * Returns the type of this <tt>PostOffice</tt>.
085:             *
086:             * @return the type as <tt>String</tt>.
087:             * @see #TYPE_MIXED
088:             * @see #TYPE_PLAIN
089:             */
090:            public String getType() {
091:                return m_Type;
092:            }//getType
093:
094:            /**
095:             * Sets the type of this <tt>PostOffice</tt>.
096:             *
097:             * @param type the type as <tt>String</tt>.
098:             * @see #TYPE_MIXED
099:             * @see #TYPE_PLAIN
100:             */
101:            public void setType(String type) {
102:                m_Type = type;
103:            }//setType
104:
105:            /**
106:             * Tests if this <tt>PostOffice</tt> is of a
107:             * given type.
108:             *
109:             * @return true if of the given type, false otherwise.
110:             * @see #TYPE_MIXED
111:             * @see #TYPE_PLAIN
112:             */
113:            public boolean isType(String type) {
114:                return m_Type.equals(type);
115:            }//isType
116:
117:            /**
118:             * Returns the internet address of this <tt>PostOffice</tt>.
119:             *
120:             * @return the address as <tt>String</tt>.
121:             */
122:            public String getAddress() {
123:                return m_Address;
124:            }//getAddress
125:
126:            /**
127:             * Sets the internet address of this <tt>PostOffice</tt>.
128:             *
129:             * @param address the address as <tt>String</tt>.
130:             */
131:            public void setAddress(String address) {
132:                try {
133:                    if (address == null || address.equals("")
134:                            || address.equals("localhost")) {
135:                        m_Address = InetAddress.getLocalHost().getHostName();
136:                    }
137:                } catch (Exception ex) {
138:                    log.error("setAddress()", ex);
139:                }
140:                m_Address = address;
141:            }//setAddress
142:
143:            /**
144:             * Returns the port of this <tt>PostOffice</tt>.
145:             *
146:             * @param the port as <tt>int</tt>.
147:             */
148:            public int getPort() {
149:                return m_Port;
150:            }//getPort
151:
152:            /**
153:             * Sets the port of this this <tt>PostOffice</tt>.
154:             *
155:             * @param port the port as <tt>int</tt>
156:             */
157:            public void setPort(int port) {
158:                m_Port = port;
159:            }//setPort
160:
161:            /**
162:             * Tests if the communication with this <tt>PostOffice</tt>
163:             * should be secure.
164:             *
165:             * @return true if secure, false otherwise.
166:             * @see #getSecureSocketFactory()
167:             */
168:            public boolean isSecure() {
169:                return m_Secure;
170:            }//isSecure
171:
172:            /**
173:             * Sets the communication with this <tt>PostOffice</tt>
174:             * to be secure.
175:             *
176:             * @param secure true if secure, false otherwise.
177:             * @see #setSecureSocketFactory(String factory)
178:             */
179:            public void setSecure(boolean secure) {
180:                m_Secure = secure;
181:            }//setSecure
182:
183:            /**
184:             * Returns the default root folder
185:             * this <tt>PostOffice</tt>.
186:             *
187:             * @return the folder as <tt>String</tt>.
188:             */
189:            public String getRootFolder() {
190:                return m_RootFolder;
191:            }//getRootFolder
192:
193:            /**
194:             * Sets the default root folder for
195:             * this <tt>PostOffice</tt>.
196:             *
197:             * @param folder the folder as <tt>String</tt>.
198:             */
199:            public void setRootFolder(String folder) {
200:                m_RootFolder = folder;
201:            }//setRootFolder
202:
203:            /**
204:             * Returns the reply-to domain setting for
205:             * this <tt>PostOffice</tt>.
206:             *
207:             * @return the reply-to domain as <tt>String</tt>.
208:             */
209:            public String getReplyToDomain() {
210:                return m_ReplyToDomain;
211:            }//getReplyToDomain
212:
213:            /**
214:             * Sets the reply-to domain for
215:             * this <tt>PostOffice</tt>.
216:             *
217:             * @param domain the reply-to domain as <tt>String</tt>.
218:             */
219:            public void setReplyToDomain(String domain) {
220:                m_ReplyToDomain = domain;
221:            }//setReplyToDomain
222:
223:            /**
224:             * Tests if this <tt>PostOffice</tt> is
225:             * the default.
226:             *
227:             * @return true if default, false otherwise.
228:             */
229:            public boolean isDefault() {
230:                return m_Default;
231:            }//isDefault
232:
233:            /**
234:             * Sets the default flag for this <tt>PostOffice</tt>.
235:             */
236:            public void setDefault(boolean aDefault) {
237:                m_Default = aDefault;
238:            }//setDefault
239:
240:            /**
241:             * Defines a mixed type post office, were
242:             * folders in the store can have subfolders and messages
243:             * at the same time.
244:             */
245:            public static final String TYPE_MIXED = "mixed";
246:
247:            /**
248:             * Defines a plain type post office, were
249:             * folders in the store cannot have subfolders and messages
250:             * at the same time.
251:             */
252:            public static final String TYPE_PLAIN = "plain";
253:
254:        }//class PostOffice
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.