1 23 24 package com.sun.enterprise.web.session; 25 26 import java.net.URLEncoder ; 27 import org.apache.catalina.Globals; 28 29 30 38 39 public final class SessionCookieConfig { 40 41 43 46 public static final String SESSION_COOKIE_DEFAULT_COMMENT = 47 URLEncoder.encode("Sun ONE Application Server Session Tracking Cookie"); 48 49 51 54 public SessionCookieConfig() { 55 super(); 56 } 57 58 60 65 private String _name = Globals.SESSION_COOKIE_NAME; 66 67 75 private String _path = null; 76 77 83 private int _maxAge = -1; 84 85 88 private String _domain = null; 89 90 95 private String _comment = SESSION_COOKIE_DEFAULT_COMMENT; 96 97 108 public SessionCookieConfig(String name, String path, int maxAge, 109 String domain, String comment) { 110 super(); 111 setName(name); 112 setPath(path); 113 setMaxAge(maxAge); 114 setDomain(domain); 115 setComment(comment); 116 } 117 118 120 123 public void setName(String name) { 124 _name = name; 125 } 126 127 130 public String getName() { 131 return _name; 132 } 133 134 137 public void setPath(String path) { 138 _path = path; 139 } 140 141 145 public String getPath() { 146 return _path; 147 } 148 149 152 public void setMaxAge(int maxAge) { 153 _maxAge = maxAge; 154 } 155 156 159 public int getMaxAge() { 160 return _maxAge; 161 } 162 163 166 public void setDomain(String domain) { 167 _domain = domain; 168 } 169 170 173 public String getDomain() { 174 return _domain; 175 } 176 177 180 public void setComment(String comment) { 181 _comment = URLEncoder.encode(comment); 182 } 183 184 188 public String getComment() { 189 return _comment; 190 } 191 192 194 197 public String toString() { 198 199 StringBuffer sb = new StringBuffer ("SessionCookieConfig["); 200 sb.append("name="); 201 sb.append(_name); 202 if (_path != null) { 203 sb.append(", path="); 204 sb.append(_path); 205 } 206 sb.append(", maxAge="); 207 sb.append(_maxAge); 208 if (_domain != null) { 209 sb.append(", domain="); 210 sb.append(_domain); 211 } 212 if (_comment != null) { 213 sb.append(", comment="); 214 sb.append(_comment); 215 } 216 sb.append("]"); 217 return (sb.toString()); 218 219 } 220 } 221 | Popular Tags |