AuthTokenImpl.java 1 KB
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
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;

26
    private String username;
Matt Tucker's avatar
Matt Tucker committed
27 28

    /**
29
     * Constucts a new AuthTokenImpl with the specified username.
Matt Tucker's avatar
Matt Tucker committed
30
     *
31
     * @param username the username to create an authToken token with.
Matt Tucker's avatar
Matt Tucker committed
32
     */
33 34
    public AuthTokenImpl(String username) {
        this.username = username;
Matt Tucker's avatar
Matt Tucker committed
35 36 37 38
    }

    // AuthToken Interface

39 40
    public String getUsername() {
        return username;
Matt Tucker's avatar
Matt Tucker committed
41 42 43
    }

    public boolean isAnonymous() {
Matt Tucker's avatar
Matt Tucker committed
44
        return username == null;
Matt Tucker's avatar
Matt Tucker committed
45 46
    }
}