001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.resource.adapter.mail.inflow;
023:
024: import java.io.Serializable;
025: import javax.resource.spi.ActivationSpec;
026: import javax.resource.spi.InvalidPropertyException;
027: import javax.resource.spi.ResourceAdapter;
028: import javax.resource.ResourceException;
029:
030: /** The encapsulation of the mail folder endpoint specification
031: *
032: * @author Scott.Stark@jboss.org
033: * @version $Revision: 57189 $
034: */
035: public class MailActivationSpec implements ActivationSpec, Serializable {
036: /** @since 1.0 */
037: private static final long serialVersionUID = -3034364895936568423L;
038:
039: /** The resource adapter */
040: private transient ResourceAdapter ra;
041: /** The mail server hostname/address */
042: private String mailServer = "mailhost";
043: /** The mail store protocol */
044: private String storeProtocol = "imap";
045: /** The mail folder name */
046: private String mailFolder;
047: /** The message selector */
048: private String messageSelector;
049: /** The mail store user */
050: private String userName;
051: /** The mail store password */
052: private String password;
053: /** The new messages check delay in MS */
054: private long pollingInterval = 60000;
055: /** The maximum number of messages */
056: private int maxMessages = 1;
057:
058: public String getMailServer() {
059: return mailServer;
060: }
061:
062: public void setMailServer(String mailServer) {
063: this .mailServer = mailServer;
064: }
065:
066: public String getStoreProtocol() {
067: return storeProtocol;
068: }
069:
070: public void setStoreProtocol(String storeProtocol) {
071: this .storeProtocol = storeProtocol;
072: }
073:
074: public String getMailFolder() {
075: return mailFolder;
076: }
077:
078: public void setMailFolder(String mailFolder) {
079: this .mailFolder = mailFolder;
080: }
081:
082: public String getMessageSelector() {
083: return messageSelector;
084: }
085:
086: public void setMessageSelector(String messageSelector) {
087: this .messageSelector = messageSelector;
088: }
089:
090: public String getUserName() {
091: return userName;
092: }
093:
094: public void setUserName(String userName) {
095: this .userName = userName;
096: }
097:
098: public String getPassword() {
099: return password;
100: }
101:
102: public void setPassword(String password) {
103: this .password = password;
104: }
105:
106: public long getPollingInterval() {
107: return pollingInterval;
108: }
109:
110: public void setPollingInterval(long pollingInterval) {
111: this .pollingInterval = pollingInterval;
112: }
113:
114: public int getMaxMessages() {
115: return maxMessages;
116: }
117:
118: public void setMaxMessages(int maxMessages) {
119: this .maxMessages = maxMessages;
120: }
121:
122: public ResourceAdapter getResourceAdapter() {
123: return ra;
124: }
125:
126: public void setResourceAdapter(ResourceAdapter ra)
127: throws ResourceException {
128: this .ra = ra;
129: }
130:
131: public void validate() throws InvalidPropertyException {
132:
133: }
134:
135: public String toString() {
136: StringBuffer tmp = new StringBuffer("MailActivationSpec(");
137: tmp.append("mailServer=");
138: tmp.append(mailServer);
139: tmp.append(", storeProtocol=");
140: tmp.append(storeProtocol);
141: tmp.append(", mailFolder=");
142: tmp.append(mailFolder);
143: tmp.append(", pollingInterval=");
144: tmp.append(pollingInterval);
145: tmp.append(", messageSelector=");
146: tmp.append(messageSelector);
147: tmp.append(", userName=");
148: tmp.append(userName);
149: tmp.append(", maxMessages=");
150: tmp.append(maxMessages);
151: tmp.append(")");
152: return tmp.toString();
153: }
154: }
|