/*******************************************************************************
 * Copyright (c), 2001, 2002 N2 Broadband, Inc.  All Rights Reserved.
 *
 * This module contains unpublished, confidential, proprietary
 * material.  The use and dissemination of this material are
 * governed by a license.  The above copyright notice does not
 * evidence any actual or intended publication of this material.
 *
 * Author:  Drake H. Henderson
 * Created:  11-12-01
 *
 ******************************************************************************/

package com.n2bb.security;

import com.n2bb.util.N2bbSettings;

/**
 * Value object for N2BB role (effective role containing
 * several J2EE roles).
 *
 * @author dhenderson
 * @author kmatsuoka
 * @version $Id: RoleBean.java,v 1.1 2006/06/17 00:48:49 rao Exp $
 */
public final class RoleBean {

    private String n2RoleName;
    private String description;
    /** Number of users in this role */
    private int userCount;

    /**
     * Tests if this role is the special admin role,
     * which contains all J2EE roles and which can't be deleted.
     *
     * @return true if this role the special admin role
     */
    public boolean isAdminRole() {
        return n2RoleName != null &&
                n2RoleName.equalsIgnoreCase(N2bbSettings.N2BB_ADMIN_ROLE);
    }

    public String getN2RoleName() {
        return n2RoleName == null ? "" : n2RoleName;
    }

    public String getDescription() {
        return description == null ? "" : description;
    }

    public void setN2RoleName(String n2RoleName) {
        this.n2RoleName = n2RoleName;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getUserCount() {
        return userCount;
    }

    public void setUserCount(int userCount) {
        this.userCount = userCount;
    }
}


