Source Code Cross Referenced for JwmaConfiguration.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.*;
013:        import java.io.Serializable;
014:
015:        /**
016:         * Class implementing a wrapper for jwma's settings.
017:         *
018:         * @author Dieter Wimberger
019:         * @version 0.9.7 07/02/2003
020:         */
021:        public class JwmaConfiguration implements  Serializable {
022:
023:            //logging
024:            private static Logger log = Logger
025:                    .getLogger(JwmaConfiguration.class);
026:
027:            //instance attributes
028:            private boolean m_POAllowOverride = false;
029:            private List m_PostOffices;
030:            private MailTransportAgent m_MTA;
031:            private Administration m_Administration;
032:            private Internationalization m_I18N;
033:            private Security m_Security;
034:            private boolean m_AutoAccount = true;
035:            private String m_DefaultMessageProcessor;
036:            private String m_PreferencePersistencePlugin;
037:            private String m_ContactManagementPlugin;
038:            private String m_RandomAppendPlugin;
039:            private String m_DefaultPostOffice;
040:
041:            /**
042:             * Constructs a new <tt>JwmaConfiguration</tt> instance.
043:             */
044:            public JwmaConfiguration() {
045:                m_PostOffices = Collections.synchronizedList(new ArrayList(5));
046:            }//constructor
047:
048:            public Security getSecurity() {
049:                return m_Security;
050:            }//getSecurity
051:
052:            public void setSecurity(Security security) {
053:                m_Security = security;
054:            }//setSecurity
055:
056:            /*** Postoffice related **********************************************/
057:
058:            public Iterator getPostOffices() {
059:                return m_PostOffices.iterator();
060:            }//getPostOffices
061:
062:            public Collection getPostOfficeCollection() {
063:                return m_PostOffices;
064:            }//getPostOffices
065:
066:            public void setPostOfficeCollection(Collection collection) {
067:                m_PostOffices = Collections.synchronizedList(new ArrayList(
068:                        collection));
069:            }//setPostOffices
070:
071:            public void addPostOffice(PostOffice po) {
072:                if (!existsPostOfficeByName(po.getName())) {
073:                    m_PostOffices.add(po);
074:                }
075:            }//addPostOffice
076:
077:            public void removePostOffice(PostOffice po) {
078:                m_PostOffices.remove(po);
079:            }//removePostOffice
080:
081:            public boolean existsPostOfficeByName(String name) {
082:                for (Iterator iterator = m_PostOffices.iterator(); iterator
083:                        .hasNext();) {
084:                    if (((PostOffice) iterator.next()).getName().equals(name)) {
085:                        return true;
086:                    }
087:                }
088:                return false;
089:            }//existsPostOfficeByName
090:
091:            public PostOffice getPostOfficeByName(String name) {
092:                for (Iterator iterator = m_PostOffices.iterator(); iterator
093:                        .hasNext();) {
094:                    PostOffice office = (PostOffice) iterator.next();
095:                    if (office.getName().equals(name)) {
096:                        return office;
097:                    }
098:                }
099:                return null;
100:            }//getPostOfficeByName
101:
102:            /**
103:             * Tests if overriding the system's set postoffice is allowed.
104:             *
105:             * @return true if overriding is allowed, false otherwise.
106:             */
107:            public boolean getPostOfficeAllowOverride() {
108:                return m_POAllowOverride;
109:            }//getPostOfficeAllowOverride
110:
111:            /**
112:             * Sets the flag that controls if overriding the
113:             * system's set postoffice is allowed or not.
114:             *
115:             * @param b true if the overriding is to be allowed,
116:             *        false otherwise.
117:             */
118:            public void setPostOfficeAllowOverride(boolean b) {
119:                m_POAllowOverride = b;
120:            }//setPostOfficeAllowOverride
121:
122:            public PostOffice getDefaultPostOffice() {
123:                for (Iterator iterator = m_PostOffices.iterator(); iterator
124:                        .hasNext();) {
125:                    PostOffice office = (PostOffice) iterator.next();
126:                    if (office.isDefault()) {
127:                        return office;
128:                    }
129:                }
130:                return null;
131:            }//getDefaultPostOffice
132:
133:            public void setDefaultPostOffice(PostOffice ndpo) {
134:
135:                PostOffice odpo = getDefaultPostOffice();
136:                odpo.setDefault(false);
137:                ndpo.setDefault(true);
138:            }//setDefaultPostOffice
139:
140:            /*** END Postoffice related ******************************************/
141:
142:            /*** Mail transport related ******************************************/
143:
144:            public MailTransportAgent getMTA() {
145:                return m_MTA;
146:            }//getMTA
147:
148:            public void setMTA(MailTransportAgent mta) {
149:                m_MTA = mta;
150:            }//setMTA
151:
152:            /*** END Mail transport related **************************************/
153:
154:            public boolean isSSLSetupRequired() {
155:                if (m_MTA.isSecure()) {
156:                    return true;
157:                }
158:                for (Iterator iterator = m_PostOffices.iterator(); iterator
159:                        .hasNext();) {
160:                    if (((PostOffice) iterator.next()).isSecure()) {
161:                        return true;
162:                    }
163:                }
164:                return false;
165:            }//isSSLSetupRequired
166:
167:            /*** Admin related ***************************************************/
168:
169:            public Administration getAdministration() {
170:                return m_Administration;
171:            }//getAdministration
172:
173:            public void setAdministration(Administration administration) {
174:                m_Administration = administration;
175:            }//setAdministration
176:
177:            /*** End admin related ***********************************************/
178:
179:            /*** Account related *************************************************/
180:
181:            /**
182:             * Tests if creation of accounts is enabled.
183:             *
184:             * @return true if account creation is enabled, false otherwise.
185:             */
186:            public boolean isAccountCreationEnabled() {
187:                return m_AutoAccount;
188:            }//isAccountCreationEnabled
189:
190:            /**
191:             * Sets the flag that controls if the automatic creation of
192:             * jwma accounts is enabled.
193:             * This will cause jwma to create user specific data, if
194:             * the user can be authenticated against the IMAP server.
195:             *
196:             * @param b true if account creation is enabled, false otherwise.
197:             */
198:            public void setAccountCreationEnabled(boolean b) {
199:                m_AutoAccount = b;
200:            }//setAccountCreationEnabled
201:
202:            /*** End Account related *********************************************/
203:
204:            /*** Processing related **********************************************/
205:
206:            /**
207:             * Returns a <tt>String</tt> representing the name of the default
208:             * message processor.
209:             *
210:             * @return the name of the default message processor as
211:             *         <tt>String</tt>.
212:             */
213:            public String getDefaultMessageProcessor() {
214:                return m_DefaultMessageProcessor;
215:            }//getDefaultMessageProcessor
216:
217:            /**
218:             * Returns a <tt>String</tt> representing the name of the default
219:             * message processor.
220:             *
221:             * @return the name of the default message processor as
222:             *         <tt>String</tt>.
223:             */
224:            public void setDefaultMessageProcessor(String name) {
225:                m_DefaultMessageProcessor = name;
226:            }//setDefaultMessageProcessor
227:
228:            /*** END Processing related ******************************************/
229:
230:            /*** i18n related ****************************************************/
231:
232:            public Internationalization getI18N() {
233:                return m_I18N;
234:            }//getI18N
235:
236:            public void setI18N(Internationalization i18N) {
237:                m_I18N = i18N;
238:            }//setI18N
239:
240:            /*** END i18n related ************************************************/
241:
242:            public String getPreferencePersistencePlugin() {
243:                return m_PreferencePersistencePlugin;
244:            }//getPreferencePersistencePlugin
245:
246:            public void setPreferencePersistencePlugin(String classname) {
247:                m_PreferencePersistencePlugin = classname;
248:            }//setPreferencePersistencePlugin
249:
250:            public String getContactManagementPlugin() {
251:                return m_ContactManagementPlugin;
252:            }//getContactManagementPlugin
253:
254:            public void setContactManagementPlugin(String classname) {
255:                m_ContactManagementPlugin = classname;
256:            }//setContactManagementPlugin
257:
258:            public String getRandomAppendPlugin() {
259:                return m_RandomAppendPlugin;
260:            }//getRandomAppendPlugin
261:
262:            public void setRandomAppendPlugin(String classname) {
263:                m_RandomAppendPlugin = classname;
264:            }//setRandomApendPlugin
265:
266:            /**
267:             * Defines a name of the static jwma direcory architecture.
268:             */
269:            public static final String LOG_DIR = "logs";
270:            public static final String ETC_DIR = "etc";
271:            public static final String DATA_DIR = "data";
272:            public static final String I18N_DIR = "i18n";
273:            public static final String CONFIG_FILENAME = "configuration.xml";
274:            public static final String LOG4J_CONFIG = "log4j.properties";
275:            public static final String JTEXTPROC_CONFIG = "textproc.properties";
276:            public static final String TEMPLATE_FILENAME = "site_template.xml";
277:
278:        }//class JwmaConfiguration
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.