AuthToken.java 1.44 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5
/**
 * $RCSfile$
 * $Revision$
 * $Date$
 *
Matt Tucker's avatar
Matt Tucker committed
6
 * Copyright (C) 2004 Jive Software. All rights reserved.
Matt Tucker's avatar
Matt Tucker committed
7
 *
Matt Tucker's avatar
Matt Tucker committed
8 9
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
Matt Tucker's avatar
Matt Tucker committed
10
 */
Matt Tucker's avatar
Matt Tucker committed
11

Matt Tucker's avatar
Matt Tucker committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
package org.jivesoftware.messenger.auth;

/**
 * Proves that a user has successfully logged in. The existence of an AuthToken object indicates
 * that a person has logged in correctly and has authentication to act as the user associated with
 * the authentication. An instance of this object can be obtained from the AuthFactory and
 * must be passed in to to get an instance of KBFactory or ForumFactory.<p>
 * <p/>
 * In the case of using the core faq or forum services through a web interface, the expected
 * behavior is to have a user login and then store the AuthToken object in their session. In
 * some app servers, all objects put in the session must be serializable. The default AuthToken
 * implementation obeys this rule, but ensure that custom AuthToken classes do as well.
 *
 * @author Iain Shigeoka
 * @see AuthFactory
 */
public interface AuthToken {

    /**
31
     * Returns the username associated with this AuthToken.
Matt Tucker's avatar
Matt Tucker committed
32
     *
33
     * @return the username associated with this AuthToken.
Matt Tucker's avatar
Matt Tucker committed
34
     */
35
    public String getUsername();
Matt Tucker's avatar
Matt Tucker committed
36 37 38 39 40 41 42 43

    /**
     * Returns true if this AuthToken is the Anonymous auth token.
     *
     * @return true if this token is the anonymous AuthToken.
     */
    public boolean isAnonymous();
}