[1240] | 1 | package gov.va.med.edp.vo;
|
---|
| 2 |
|
---|
| 3 | public class SessionVO {
|
---|
| 4 |
|
---|
| 5 | static final int DEFAULT_TIMEOUT_MS = 300000; // 5 minutes
|
---|
| 6 | static final int DEFAULT_COUNTDOWN_MS = 10000; // 10 seconds
|
---|
| 7 |
|
---|
| 8 | private String serverPackageVersion;
|
---|
| 9 | private int timeOutMillis = DEFAULT_TIMEOUT_MS;
|
---|
| 10 | private int countDownMillis = DEFAULT_COUNTDOWN_MS;
|
---|
| 11 |
|
---|
| 12 | public String getServerPackageVersion() {
|
---|
| 13 | return serverPackageVersion;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | public void setServerPackageVersion(String serverPackageVersion) {
|
---|
| 17 | this.serverPackageVersion = serverPackageVersion;
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | public int getTimeOutMillis() {
|
---|
| 21 | return timeOutMillis;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | public void setTimeOutMillis(int timeOutMillis) {
|
---|
| 25 | this.timeOutMillis = timeOutMillis;
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | public int getCountDownMillis() {
|
---|
| 29 | return countDownMillis;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public void setCountDownMillis(int countDownMillis) {
|
---|
| 33 | this.countDownMillis = countDownMillis;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | /**
|
---|
| 37 | * Calculates the time, in seconds, between client requests before the servlet container will invalidate this session.
|
---|
| 38 | *
|
---|
| 39 | * @return
|
---|
| 40 | */
|
---|
| 41 | public int getMaxInactiveInterval() {
|
---|
| 42 | return (getTimeOutMillis() + getCountDownMillis()) / 1000 + 60;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public String toString() {
|
---|
| 46 | return "SessionVO{" +
|
---|
| 47 | "serverPackageVersion='" + serverPackageVersion + '\'' +
|
---|
| 48 | ", timeOutMillis=" + timeOutMillis +
|
---|
| 49 | ", countDownMillis=" + countDownMillis +
|
---|
| 50 | '}';
|
---|
| 51 | }
|
---|
| 52 | }
|
---|