1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.osoco.cowarp.impl;
17
18 import java.io.Serializable;
19
20 import org.osoco.cowarp.User;
21
22 /***
23 * This class keeps track of the number of applications a user is logged into
24 * using the same security handler.
25 *
26 * @author <a href="mailto:cziegeler.at.osoco.org">Carsten Ziegeler</a>
27 * @version CVS $Id: LoginInfo.java,v 1.5 2005/02/21 09:28:29 cziegeler Exp $
28 */
29 public class LoginInfo
30 implements Serializable {
31
32 protected int counter;
33 protected final User user;
34
35 public LoginInfo(final User user) {
36 this.user = user;
37 }
38
39 public void incUsageCounter() {
40 this.counter++;
41 }
42
43 public void decUsageCounter() {
44 this.counter--;
45 }
46
47 public boolean isUsed() {
48 return (this.counter > 0);
49 }
50
51 public User getUser() {
52 return this.user;
53 }
54 }