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 Tucker18 * @see AuthFactory19 */20 public class AuthToken {21 22 private static final long serialVersionUID = 01L;23 private String 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 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 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 }
Java API By Example, From Geeks To Geeks. | Our Blog | Conditions of Use | About Us_ |