AuthTokenImpl.java 999 Bytes
Newer Older
Matt Tucker's avatar
Matt Tucker committed
1
/**
2 3 4
 * $RCSfile$
 * $Revision$
 * $Date$
Matt Tucker's avatar
Matt Tucker committed
5
 *
6
 * Copyright (C) 2004 Jive Software. All rights reserved.
Matt Tucker's avatar
Matt Tucker committed
7
 *
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
 */
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
package org.jivesoftware.messenger.auth.spi;

import org.jivesoftware.messenger.auth.AuthToken;
import java.io.Serializable;

/**
 * Database implementation of the AuthToken interface.
 *
 * @author Iain Shigeoka
 */
public final class AuthTokenImpl implements AuthToken, Serializable {

    private static final long serialVersionUID = 01L;

    private long userID;

    /**
     * Constucts a new DbAuthToken with the specified userID.
     *
     * @param userID the userID to create an authToken token with.
     */
    public AuthTokenImpl(long userID) {
        this.userID = userID;
    }

    // AuthToken Interface

    public long getUserID() {
        return userID;
    }

    public boolean isAnonymous() {
        return userID == -1;
    }
}