Source Code Cross Referenced for SmtpConnector.java in  » ESB » mule » org » mule » transport » email » 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 » ESB » mule » org.mule.transport.email 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: SmtpConnector.java 11110 2008-02-28 13:55:36Z acooke $
003:         * --------------------------------------------------------------------------------------
004:         * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
005:         *
006:         * The software in this package is published under the terms of the CPAL v1.0
007:         * license, a copy of which has been included with this distribution in the
008:         * LICENSE.txt file.
009:         */
010:
011:        package org.mule.transport.email;
012:
013:        import org.mule.api.endpoint.InboundEndpoint;
014:        import org.mule.api.service.Service;
015:        import org.mule.api.transport.MessageReceiver;
016:
017:        import java.util.Properties;
018:
019:        /**
020:         * <code>SmtpConnector</code> is used to connect to and send data to an SMTP mail
021:         * server
022:         */
023:        public class SmtpConnector extends AbstractMailConnector {
024:
025:            public static final String SMTP = "smtp";
026:            public static final String DEFAULT_SMTP_HOST = "localhost";
027:            public static final int DEFAULT_SMTP_PORT = 25;
028:            public static final String DEFAULT_CONTENT_TYPE = "text/plain";
029:
030:            /**
031:             * Holds value of bcc addresses.
032:             */
033:            private String bcc;
034:
035:            /**
036:             * Holds value of cc addresses.
037:             */
038:            private String cc;
039:
040:            /**
041:             * Holds value of replyTo addresses.
042:             */
043:            private String replyTo;
044:
045:            /**
046:             * Holds value of default subject
047:             */
048:            private String defaultSubject = "[No Subject]";
049:
050:            /**
051:             * Holds value of the from address.
052:             */
053:            private String from;
054:
055:            /**
056:             * Any custom headers to be set on messages sent using this connector
057:             */
058:            private Properties customHeaders = new Properties();
059:
060:            private String contentType = DEFAULT_CONTENT_TYPE;
061:
062:            public SmtpConnector() {
063:                this (DEFAULT_SMTP_PORT);
064:            }
065:
066:            SmtpConnector(int defaultPort) {
067:                super (defaultPort, null);
068:            }
069:
070:            public String getProtocol() {
071:                return "smtp";
072:            }
073:
074:            /*
075:             * (non-Javadoc)
076:             * 
077:             * @see org.mule.transport.UMOConnector#registerListener(javax.jms.MessageListener,
078:             *      java.lang.String)
079:             */
080:            public MessageReceiver createReceiver(Service service,
081:                    InboundEndpoint endpoint) throws Exception {
082:                throw new UnsupportedOperationException(
083:                        "Listeners cannot be registered on a SMTP endpoint");
084:            }
085:
086:            /**
087:             * @return The default from address to use
088:             */
089:            public String getFromAddress() {
090:                return from;
091:            }
092:
093:            /**
094:             * @return the default comma separated list of BCC addresses to use
095:             */
096:            public String getBccAddresses() {
097:                return bcc;
098:            }
099:
100:            /**
101:             * @return the default comma separated list of CC addresses to use
102:             */
103:            public String getCcAddresses() {
104:                return cc;
105:            }
106:
107:            /**
108:             * @return the default message subject to use
109:             */
110:            public String getSubject() {
111:                return defaultSubject;
112:            }
113:
114:            public void setBccAddresses(String string) {
115:                bcc = string;
116:            }
117:
118:            public void setCcAddresses(String string) {
119:                cc = string;
120:            }
121:
122:            public void setSubject(String string) {
123:                defaultSubject = string;
124:            }
125:
126:            public void setFromAddress(String string) {
127:                from = string;
128:            }
129:
130:            public String getReplyToAddresses() {
131:                return replyTo;
132:            }
133:
134:            public void setReplyToAddresses(String replyTo) {
135:                this .replyTo = replyTo;
136:            }
137:
138:            public Properties getCustomHeaders() {
139:                return customHeaders;
140:            }
141:
142:            public void setCustomHeaders(Properties customHeaders) {
143:                this .customHeaders = customHeaders;
144:            }
145:
146:            public String getContentType() {
147:                return contentType;
148:            }
149:
150:            public void setContentType(String contentType) {
151:                this .contentType = contentType;
152:            }
153:
154:            public int getDefaultPort() {
155:                return DEFAULT_SMTP_PORT;
156:            }
157:
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.