Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
13   78   9   1.86
4   37   0.69   7
7     1.29  
1    
 
 
  SessionTracker       Line # 29 13 9 0% 0.0
 
No Tests
 
1    /*
2    * This software was designed and created by Jason Carroll.
3    * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4    * The author can be reached at jcarroll@cowsultants.com
5    * ITracker website: http://www.cowsultants.com
6    * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7    *
8    * This program is free software; you can redistribute it and/or modify
9    * it only under the terms of the GNU General Public License as published by
10    * the Free Software Foundation; either version 2 of the License, or
11    * (at your option) any later version.
12    *
13    * This program is distributed in the hope that it will be useful,
14    * but WITHOUT ANY WARRANTY; without even the implied warranty of
15    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16    * GNU General Public License for more details.
17    */
18   
19    package org.itracker.web.util;
20   
21    import java.io.Serializable;
22    import java.util.Date;
23   
24    /**
25    * What's this for? Please comment!
26    *
27    * @author ready
28    */
 
29    public class SessionTracker implements Serializable {
30   
31    /**
32    *
33    */
34    private static final long serialVersionUID = 1L;
35    // private static transient final Logger logger = Logger
36    // .getLogger(SessionTracker.class);
37    private Date now;
38    private String login;
39    private String sessionId;
40   
 
41  0 toggle public SessionTracker() {
42  0 now = new Date();
43    }
44   
 
45  0 toggle public SessionTracker(String login, String sessionId) {
46  0 this();
47  0 this.login = login;
48  0 this.sessionId = sessionId;
49    }
50   
 
51  0 toggle protected void finalize() throws Throwable {
52    // if (logger.isDebugEnabled()) {
53    // logger.debug("finalize: Invalidating SessionManager info for " + this.login);
54    // }
55  0 SessionManager.invalidateSession(this.login);
56    }
57   
 
58  0 toggle public String getSessionId() {
59  0 return sessionId;
60    }
61   
 
62  0 toggle public void setSessionId(String sessionId) {
63  0 this.sessionId = sessionId;
64    }
65   
 
66  0 toggle public Date getNow() {
67  0 if (null == now)
68  0 return null;
69  0 return new Date(now.getTime());
70    }
71   
 
72  0 toggle public void setNow(Date now) {
73  0 if (null == now)
74  0 this.now = null;
75    else
76  0 this.now = new Date(now.getTime());
77    }
78    }