AuthToken.java 1.41 KB
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/**
 * $RCSfile$
 * $Revision$
 * $Date$
 *
 * Copyright (C) 2002 CoolServlets, Inc. All rights reserved.
 *
 * This software is the proprietary information of CoolServlets, Inc.
 * Use is subject to license terms.
 */
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 {

    /**
     * Returns the userID associated with this AuthToken.
     *
     * @return the userID associated with this AuthToken.
     */
    public long getUserID();

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