1 18 19 package org.apache.struts.examples.mailreader.memory; 20 21 import org.apache.struts.examples.mailreader.Subscription; 22 import org.apache.struts.examples.mailreader.User; 23 24 31 32 public final class MemorySubscription implements Subscription { 33 34 35 37 38 45 public MemorySubscription(MemoryUser user, String host) { 46 47 super(); 48 this.user = user; 49 this.host = host; 50 51 } 52 53 54 56 57 60 private String host = null; 61 62 63 66 private MemoryUser user = null; 67 68 69 71 72 75 private boolean autoConnect = false; 76 77 public boolean getAutoConnect() { 78 return (this.autoConnect); 79 } 80 81 public void setAutoConnect(boolean autoConnect) { 82 this.autoConnect = autoConnect; 83 } 84 85 86 89 public String getHost() { 90 return (this.host); 91 } 92 93 94 97 private String password = null; 98 99 public String getPassword() { 100 return (this.password); 101 } 102 103 public void setPassword(String password) { 104 this.password = password; 105 } 106 107 108 111 private String type = "imap"; 112 113 public String getType() { 114 return (this.type); 115 } 116 117 public void setType(String type) { 118 this.type = type; 119 } 120 121 122 125 public User getUser() { 126 return (this.user); 127 } 128 129 130 133 private String username = null; 134 135 public String getUsername() { 136 return (this.username); 137 } 138 139 public void setUsername(String username) { 140 this.username = username; 141 } 142 143 144 146 147 150 public String toString() { 151 152 StringBuffer sb = new StringBuffer ("<subscription host=\""); 153 sb.append(host); 154 sb.append("\" autoConnect=\""); 155 sb.append(autoConnect); 156 sb.append("\""); 157 if (password != null) { 158 sb.append(" password=\""); 159 sb.append(password); 160 sb.append("\""); 161 } 162 if (type != null) { 163 sb.append(" type=\""); 164 sb.append(type); 165 sb.append("\""); 166 } 167 if (username != null) { 168 sb.append(" username=\""); 169 sb.append(username); 170 sb.append("\""); 171 } 172 sb.append(">"); 173 return (sb.toString()); 174 175 } 176 177 178 } 179 | Popular Tags |