1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.apache.struts.apps.mailreader.dao.impl;
24
25 import org.apache.struts.apps.mailreader.dao.Subscription;
26 import org.apache.struts.apps.mailreader.dao.User;
27
28
29
30
31
32
33
34
35
36 public class AbstractSubscription implements Subscription {
37
38
39
40
41
42
43
44
45
46
47
48
49 public AbstractSubscription(User user, String host) {
50
51 super();
52 this.user = user;
53 this.host = host;
54
55 }
56
57
58
59
60
61
62
63
64 private String host = null;
65
66
67
68
69
70 private User user = null;
71
72
73
74
75
76
77
78
79 private boolean autoConnect = false;
80
81 public boolean getAutoConnect() {
82 return (this.autoConnect);
83 }
84
85 public void setAutoConnect(boolean autoConnect) {
86 this.autoConnect = autoConnect;
87 }
88
89
90
91
92
93 public String getHost() {
94 return (this.host);
95 }
96
97
98
99
100
101 private String password = null;
102
103 public String getPassword() {
104 return (this.password);
105 }
106
107 public void setPassword(String password) {
108 this.password = password;
109 }
110
111
112
113
114
115 private String type = "imap";
116
117 public String getType() {
118 return (this.type);
119 }
120
121 public void setType(String type) {
122 this.type = type;
123 }
124
125
126
127
128
129 public User getUser() {
130 return (this.user);
131 }
132
133
134
135
136
137 private String username = null;
138
139 public String getUsername() {
140 return (this.username);
141 }
142
143 public void setUsername(String username) {
144 this.username = username;
145 }
146
147
148
149
150
151
152
153
154 public String toString() {
155
156 StringBuilder sb = new StringBuilder("<subscription host=\"");
157 sb.append(host);
158 sb.append("\" autoConnect=\"");
159 sb.append(autoConnect);
160 sb.append("\"");
161 if (password != null) {
162 sb.append(" password=\"");
163 sb.append(password);
164 sb.append("\"");
165 }
166 if (type != null) {
167 sb.append(" type=\"");
168 sb.append(type);
169 sb.append("\"");
170 }
171 if (username != null) {
172 sb.append(" username=\"");
173 sb.append(username);
174 sb.append("\"");
175 }
176 sb.append(">");
177 return (sb.toString());
178
179 }
180
181
182 }