KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > resource > adapter > mail > inflow > MailActivationSpec


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.resource.adapter.mail.inflow;
23
24 import java.io.Serializable JavaDoc;
25 import javax.resource.spi.ActivationSpec JavaDoc;
26 import javax.resource.spi.InvalidPropertyException JavaDoc;
27 import javax.resource.spi.ResourceAdapter JavaDoc;
28 import javax.resource.ResourceException JavaDoc;
29
30 /** The encapsulation of the mail folder endpoint specification
31  *
32  * @author Scott.Stark@jboss.org
33  * @version $Revision: 37459 $
34  */

35 public class MailActivationSpec
36    implements ActivationSpec JavaDoc, Serializable JavaDoc
37 {
38    /** @since 1.0 */
39    private static final long serialVersionUID = -3034364895936568423L;
40
41    /** The resource adapter */
42    private transient ResourceAdapter JavaDoc ra;
43    /** The mail server hostname/address */
44    private String JavaDoc mailServer = "mailhost";
45    /** The mail store protocol */
46    private String JavaDoc storeProtocol = "imap";
47    /** The mail folder name */
48    private String JavaDoc mailFolder;
49    /** The message selector */
50    private String JavaDoc messageSelector;
51    /** The mail store user */
52    private String JavaDoc userName;
53    /** The mail store password */
54    private String JavaDoc password;
55    /** The new messages check delay in MS */
56    private long pollingInterval = 60000;
57    /** The maximum number of messages */
58    private int maxMessages = 1;
59
60    public String JavaDoc getMailServer()
61    {
62       return mailServer;
63    }
64    public void setMailServer(String JavaDoc mailServer)
65    {
66       this.mailServer = mailServer;
67    }
68
69    public String JavaDoc getStoreProtocol()
70    {
71       return storeProtocol;
72    }
73    public void setStoreProtocol(String JavaDoc storeProtocol)
74    {
75       this.storeProtocol = storeProtocol;
76    }
77
78    public String JavaDoc getMailFolder()
79    {
80       return mailFolder;
81    }
82    public void setMailFolder(String JavaDoc mailFolder)
83    {
84       this.mailFolder = mailFolder;
85    }
86
87    public String JavaDoc getMessageSelector()
88    {
89       return messageSelector;
90    }
91    public void setMessageSelector(String JavaDoc messageSelector)
92    {
93       this.messageSelector = messageSelector;
94    }
95
96    public String JavaDoc getUserName()
97    {
98       return userName;
99    }
100    public void setUserName(String JavaDoc userName)
101    {
102       this.userName = userName;
103    }
104
105    public String JavaDoc getPassword()
106    {
107       return password;
108    }
109    public void setPassword(String JavaDoc password)
110    {
111       this.password = password;
112    }
113
114    public long getPollingInterval()
115    {
116       return pollingInterval;
117    }
118    public void setPollingInterval(long pollingInterval)
119    {
120       this.pollingInterval = pollingInterval;
121    }
122
123    public int getMaxMessages()
124    {
125       return maxMessages;
126    }
127    public void setMaxMessages(int maxMessages)
128    {
129       this.maxMessages = maxMessages;
130    }
131
132    public ResourceAdapter JavaDoc getResourceAdapter()
133    {
134       return ra;
135    }
136
137    public void setResourceAdapter(ResourceAdapter JavaDoc ra) throws ResourceException JavaDoc
138    {
139       this.ra = ra;
140    }
141
142    public void validate() throws InvalidPropertyException JavaDoc
143    {
144       
145    }
146
147    public String JavaDoc toString()
148    {
149       StringBuffer JavaDoc tmp = new StringBuffer JavaDoc("MailActivationSpec(");
150       tmp.append("mailServer=");
151       tmp.append(mailServer);
152       tmp.append(", storeProtocol=");
153       tmp.append(storeProtocol);
154       tmp.append(", mailFolder=");
155       tmp.append(mailFolder);
156       tmp.append(", pollingInterval=");
157       tmp.append(pollingInterval);
158       tmp.append(", messageSelector=");
159       tmp.append(messageSelector);
160       tmp.append(", userName=");
161       tmp.append(userName);
162       tmp.append(", maxMessages=");
163       tmp.append(maxMessages);
164       tmp.append(")");
165       return tmp.toString();
166    }
167 }
168
Popular Tags