KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > messenger > auth > AuthToken


1 /**
2  * $RCSfile: AuthToken.java,v $
3  * $Revision: 1.4 $
4  * $Date: 2004/12/13 18:06:53 $
5  *
6  * Copyright (C) 2004 Jive Software. All rights reserved.
7  *
8  * This software is published under the terms of the GNU Public License (GPL),
9  * a copy of which is included in this distribution.
10  */

11
12 package org.jivesoftware.messenger.auth;
13
14 /**
15  * A token that proves that a user has successfully authenticated.
16  *
17  * @author Matt Tucker
18  * @see AuthFactory
19  */

20 public class AuthToken {
21
22     private static final long serialVersionUID = 01L;
23     private String JavaDoc username;
24
25     /**
26      * Constucts a new AuthToken with the specified username.
27      *
28      * @param username the username to create an authToken token with.
29      */

30     public AuthToken(String JavaDoc username) {
31         this.username = username;
32     }
33
34     /**
35      * Returns the username associated with this AuthToken.
36      *
37      * @return the username associated with this AuthToken.
38      */

39     public String JavaDoc getUsername() {
40         return username;
41     }
42
43     /**
44      * Returns true if this AuthToken is the Anonymous auth token.
45      *
46      * @return true if this token is the anonymous AuthToken.
47      */

48     public boolean isAnonymous() {
49         return username == null;
50     }
51 }
Popular Tags