1
17
18 package org.apache.tomcat.util.descriptor.web;
19
20 import java.util.EnumSet;
21
22 import javax.servlet.SessionTrackingMode;
23
24
29 public class SessionConfig {
30 private Integer sessionTimeout;
31 private String cookieName;
32 private String cookieDomain;
33 private String cookiePath;
34 private String cookieComment;
35 private Boolean cookieHttpOnly;
36 private Boolean cookieSecure;
37 private Integer cookieMaxAge;
38 private final EnumSet<SessionTrackingMode> sessionTrackingModes =
39 EnumSet.noneOf(SessionTrackingMode.class);
40
41 public Integer getSessionTimeout() {
42 return sessionTimeout;
43 }
44 public void setSessionTimeout(String sessionTimeout) {
45 this.sessionTimeout = Integer.valueOf(sessionTimeout);
46 }
47
48 public String getCookieName() {
49 return cookieName;
50 }
51 public void setCookieName(String cookieName) {
52 this.cookieName = cookieName;
53 }
54
55 public String getCookieDomain() {
56 return cookieDomain;
57 }
58 public void setCookieDomain(String cookieDomain) {
59 this.cookieDomain = cookieDomain;
60 }
61
62 public String getCookiePath() {
63 return cookiePath;
64 }
65 public void setCookiePath(String cookiePath) {
66 this.cookiePath = cookiePath;
67 }
68
69 public String getCookieComment() {
70 return cookieComment;
71 }
72 public void setCookieComment(String cookieComment) {
73 this.cookieComment = cookieComment;
74 }
75
76 public Boolean getCookieHttpOnly() {
77 return cookieHttpOnly;
78 }
79 public void setCookieHttpOnly(String cookieHttpOnly) {
80 this.cookieHttpOnly = Boolean.valueOf(cookieHttpOnly);
81 }
82
83 public Boolean getCookieSecure() {
84 return cookieSecure;
85 }
86 public void setCookieSecure(String cookieSecure) {
87 this.cookieSecure = Boolean.valueOf(cookieSecure);
88 }
89
90 public Integer getCookieMaxAge() {
91 return cookieMaxAge;
92 }
93 public void setCookieMaxAge(String cookieMaxAge) {
94 this.cookieMaxAge = Integer.valueOf(cookieMaxAge);
95 }
96
97 public EnumSet<SessionTrackingMode> getSessionTrackingModes() {
98 return sessionTrackingModes;
99 }
100 public void addSessionTrackingMode(String sessionTrackingMode) {
101 sessionTrackingModes.add(
102 SessionTrackingMode.valueOf(sessionTrackingMode));
103 }
104
105 }
106