KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > james > fetchmail > DynamicAccount


1 /***********************************************************************
2  * Copyright (c) 2003-2004 The Apache Software Foundation. *
3  * All rights reserved. *
4  * ------------------------------------------------------------------- *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you *
6  * may not use this file except in compliance with the License. You *
7  * may obtain a copy of the License at: *
8  * *
9  * http://www.apache.org/licenses/LICENSE-2.0 *
10  * *
11  * Unless required by applicable law or agreed to in writing, software *
12  * distributed under the License is distributed on an "AS IS" BASIS, *
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or *
14  * implied. See the License for the specific language governing *
15  * permissions and limitations under the License. *
16  ***********************************************************************/

17
18 package org.apache.james.fetchmail;
19
20 import javax.mail.Session JavaDoc;
21
22 import org.apache.avalon.framework.configuration.ConfigurationException;
23
24 public class DynamicAccount extends Account
25 {
26
27     /**
28      * Constructor for DynamicAccount.
29      * @param sequenceNumber
30      * @param parsedConfiguration
31      * @param user
32      * @param password
33      * @param recipient
34      * @param ignoreRecipientHeader
35      * @param session
36      * @throws ConfigurationException
37      */

38     private DynamicAccount(
39         int sequenceNumber,
40         ParsedConfiguration parsedConfiguration,
41         String JavaDoc user,
42         String JavaDoc password,
43         String JavaDoc recipient,
44         boolean ignoreRecipientHeader,
45         Session JavaDoc session)
46         throws ConfigurationException
47     {
48         super(
49             sequenceNumber,
50             parsedConfiguration,
51             user,
52             password,
53             recipient,
54             ignoreRecipientHeader,
55             session);
56     }
57
58     /**
59      * Constructor for DynamicAccount.
60      * @param sequenceNumber
61      * @param parsedConfiguration
62      * @param userName
63      * @param userPrefix
64      * @param userSuffix
65      * @param password
66      * @param recipientPrefix
67      * @param recipientSuffix
68      * @param ignoreRecipientHeader
69      * @param session
70      * @throws ConfigurationException
71      */

72     public DynamicAccount(
73         int sequenceNumber,
74         ParsedConfiguration parsedConfiguration,
75         String JavaDoc userName,
76         String JavaDoc userPrefix,
77         String JavaDoc userSuffix,
78         String JavaDoc password,
79         String JavaDoc recipientPrefix,
80         String JavaDoc recipientSuffix,
81         boolean ignoreRecipientHeader,
82         Session JavaDoc session)
83         throws ConfigurationException
84     {
85         this(
86             sequenceNumber,
87             parsedConfiguration,
88             null,
89             password,
90             null,
91             ignoreRecipientHeader,
92             session);
93
94         StringBuffer JavaDoc userBuffer = new StringBuffer JavaDoc(userPrefix);
95         userBuffer.append(userName);
96         userBuffer.append(userSuffix);
97         setUser(userBuffer.toString());
98
99         StringBuffer JavaDoc recipientBuffer = new StringBuffer JavaDoc(recipientPrefix);
100         recipientBuffer.append(userName);
101         recipientBuffer.append(recipientSuffix);
102         setRecipient(recipientBuffer.toString());
103     }
104 }
105
Popular Tags