1 18 19 20 package org.apache.struts.webapp.example.memory; 21 22 23 import org.apache.struts.webapp.example.Subscription; 24 import org.apache.struts.webapp.example.User; 25 26 27 34 35 public final class MemorySubscription implements Subscription { 36 37 38 40 41 48 public MemorySubscription(MemoryUser user, String host) { 49 50 super(); 51 this.user = user; 52 this.host = host; 53 54 } 55 56 57 59 60 63 private String host = null; 64 65 66 69 private MemoryUser user = null; 70 71 72 74 75 78 private boolean autoConnect = false; 79 80 public boolean getAutoConnect() { 81 return (this.autoConnect); 82 } 83 84 public void setAutoConnect(boolean autoConnect) { 85 this.autoConnect = autoConnect; 86 } 87 88 89 92 public String getHost() { 93 return (this.host); 94 } 95 96 97 100 private String password = null; 101 102 public String getPassword() { 103 return (this.password); 104 } 105 106 public void setPassword(String password) { 107 this.password = password; 108 } 109 110 111 114 private String type = "imap"; 115 116 public String getType() { 117 return (this.type); 118 } 119 120 public void setType(String type) { 121 this.type = type; 122 } 123 124 125 128 public User getUser() { 129 return (this.user); 130 } 131 132 133 136 private String username = null; 137 138 public String getUsername() { 139 return (this.username); 140 } 141 142 public void setUsername(String username) { 143 this.username = username; 144 } 145 146 147 149 150 153 public String toString() { 154 155 StringBuffer sb = new StringBuffer ("<subscription host=\""); 156 sb.append(host); 157 sb.append("\" autoConnect=\""); 158 sb.append(autoConnect); 159 sb.append("\""); 160 if (password != null) { 161 sb.append(" password=\""); 162 sb.append(password); 163 sb.append("\""); 164 } 165 if (type != null) { 166 sb.append(" type=\""); 167 sb.append(type); 168 sb.append("\""); 169 } 170 if (username != null) { 171 sb.append(" username=\""); 172 sb.append(username); 173 sb.append("\""); 174 } 175 sb.append(">"); 176 return (sb.toString()); 177 178 } 179 180 181 } 182 | Popular Tags |