⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 accountlist.java

📁 java 写的一个新闻发布系统
💻 JAVA
字号:
// $Id: AccountList.java,v 1.2 2002/04/04 08:13:25 pmartin Exp $////                                   ____.//                       __/\ ______|    |__/\.     _______//            __   .____|    |       \   |    +----+       \//    _______|  /--|    |    |    -   \  _    |    :    -   \_________//   \\______: :---|    :    :           |    :    |         \________>//           |__\---\_____________:______:    :____|____:_____\//                                      /_____|////                 . . . i n   j a h i a   w e   t r u s t . . .//package org.jahia.security.accounts;import java.util.Vector;import org.jahia.security.accounts.AccountDBUtils;import org.jahia.exceptions.database.JahiaDatabaseException;/** * This class hold a list of Accounts. * * @author  Fulco Houkes * @version 1.0 */public class AccountList extends Vector{    //-------------------------------------------------------------------------    /**     * Default Constructor.     */    public AccountList () {        super();    }    //-------------------------------------------------------------------------    // Foux     17 Apr. 2001    /** Return a list of {@link Account Account} objects associated     *  with the specified site. These objects will not hold a reference to the     *  account owner. The users associated with an account can be obtained     *  through the User Manager Service (see     *  {@link JahiaUserManagerService JahiaUserManagerService} for more     *  information.     *     * @param   siteKey     *      Site unique identification key     *     * @return     *      Return a {@link java.util.Vector Vector} holding the requested     *      account objects. The returned {@link java.util.Vector Vector} is     *      always non <code>null</code>, and is empty if no account is defined     *      in the specified site.     *     * @exception   JahiaDatabaseException     *      Throws this exception on any database failure.     */    public static AccountList getAccountsList (String siteKey)        throws  JahiaDatabaseException    {        AccountList list = new AccountList ();        if (siteKey == null) {            return list;        }        AccountDBUtils dbUtils = AccountDBUtils.getInstance();        if (dbUtils != null) {            list = dbUtils.getAccountsList (siteKey, -1);        }        return list;    }    //-------------------------------------------------------------------------    // Foux     17 Apr. 2001    /** Return a list of enabled accounts associated with the specified site.     *  These accounts will not hold a reference to the account owner. The user     *  associated with an account can be obtained through the User Manager     *  Service (see {@link JahiaUserManagerService JahiaUserManagerService}     *  for more information.     *     * @param   siteKey     *      Site unique identification key     *     * @return     *      Return a {@link java.util.Vector Vector} holding the requested     *      {@link Account Account} account objects. The returned     *      {@link java.util.Vector Vector} is always non <code>null</code>, and     *      is empty if any enabled account could be found in the specified     *      site.     *     * @exception   JahiaDatabaseException     *      Throws this exception on any database failure.     */    static public AccountList getEnabledAccountsList (String siteKey)        throws  JahiaDatabaseException    {        AccountList list = new AccountList ();        if (siteKey == null) {            return list;        }        AccountDBUtils dbUtils = AccountDBUtils.getInstance();        if (dbUtils != null) {            list = dbUtils.getAccountsList (siteKey, 1);        }        return list;    }    //-------------------------------------------------------------------------    // Foux     17 Apr. 2001    /** Return a list of disabled accounts associated with the specified site.     *  These accounts will not hold a reference to the account owner. The user     *  associated with an account can be obtained through the User Manager     *  Service (see {@link JahiaUserManagerService JahiaUserManagerService}     *  for more information.     *     * @param   siteKey     *      Site unique identification key     *     * @return     *      Return a {@link AccountList AccountList} holding the requested     *      {@link Account Account} account objects. The returned     *      list is always non <code>null</code>, and is empty if any disabled     *      account could be found in the specified site.     *     * @exception   JahiaDatabaseException     *      Throws this exception on any database failure.     */    static public AccountList getDisabledAccountsList (String siteKey)        throws  JahiaDatabaseException    {        AccountList list = new AccountList ();        if (siteKey == null) {            return list;        }        AccountDBUtils dbUtils = AccountDBUtils.getInstance();        if (dbUtils != null) {            list = dbUtils.getAccountsList (siteKey, 0);        }        return list;    }    //-------------------------------------------------------------------------    /**     * Return the list of accounts related to this user.     *     * @param   userKey     *      The user unique identification key.     *     * @return     *      Return a list of accounts, which is always non-null. The list is     *      empty if no account was found for the specified user.     *     * @exception   JahiaDatabaseException     *      Throws this exception on any database failure.     */    static public AccountList getUserAccounts (String userKey)        throws  JahiaDatabaseException    {        AccountList list = new AccountList ();        if (userKey != null) {            AccountDBUtils dbUtils = AccountDBUtils.getInstance();            if (dbUtils != null) {                list = dbUtils.getUserAccounts (userKey);            }        }        return list;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -