亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? forumfactoryproxy.java

?? 這是學習Java必須讀懂兩套源代碼
?? JAVA
字號:
/**
 * Copyright (C) 2001 Yasna.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        Yasna.com (http://www.yasna.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Yazd" and "Yasna.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact yazd@yasna.com.
 *
 * 5. Products derived from this software may not be called "Yazd",
 *    nor may "Yazd" appear in their name, without prior written
 *    permission of Yasna.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL YASNA.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of Yasna.com. For more information
 * on Yasna.com, please see <http://www.yasna.com>.
 */

/**
 * Copyright (C) 2000 CoolServlets.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        CoolServlets.com (http://www.coolservlets.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Jive" and "CoolServlets.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact webmaster@coolservlets.com.
 *
 * 5. Products derived from this software may not be called "Jive",
 *    nor may "Jive" appear in their name, without prior written
 *    permission of CoolServlets.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL COOLSERVLETS.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CoolServlets.com. For more information
 * on CoolServlets.com, please see <http://www.coolservlets.com>.
 */

package com.Yasna.forum;

import java.util.*;
//JDK1.1// import com.sun.java.util.collections.*;

/**
 * A protection proxy for ForumFactory. It ensures that only authorized users
 * are allowed to access restricted methods.
 */
public class ForumFactoryProxy extends ForumFactory {

    private ForumFactory factory;
    private Authorization authorization;
    private ForumPermissions permissions;

    public ForumFactoryProxy(ForumFactory factory, Authorization authorization,
            ForumPermissions permissions)
    {
        this.factory = factory;
        this.authorization = authorization;
        this.permissions = permissions;
    }

    public Forum createForum(String name, String description)
            throws UnauthorizedException, ForumAlreadyExistsException
    {
        if (permissions.get(ForumPermissions.SYSTEM_ADMIN)) {
            Forum newForum = factory.createForum(name, description);
            return new ForumProxy(newForum, authorization, permissions);
        }
        else {
            throw new UnauthorizedException();
        }
    }

    public void deleteForum(Forum forum) throws UnauthorizedException {
        if (permissions.get(ForumPermissions.SYSTEM_ADMIN)) {
            factory.deleteForum(forum);
        }
        else {
            throw new UnauthorizedException();
        }
    }

    public Forum getForum(int forumID) throws ForumNotFoundException,
            UnauthorizedException
    {
        Forum forum = factory.getForum(forumID);
        ForumPermissions forumPermissions = forum.getPermissions(authorization);
        //Create a new permissions object with the combination of the
        //permissions of this object and tempPermissions.
        ForumPermissions newPermissions =
                new ForumPermissions(permissions, forumPermissions);
        //Check and see if the user has READ permissions. If not, throw an
        //an UnauthorizedException.
        if (!(
            newPermissions.get(ForumPermissions.READ) ||
            newPermissions.get(ForumPermissions.FORUM_ADMIN) ||
            newPermissions.get(ForumPermissions.SYSTEM_ADMIN)
            ))
        {
            throw new UnauthorizedException();
        }
        return new ForumProxy(forum, authorization, newPermissions);
    }

    public Forum getForum(String name) throws ForumNotFoundException,
            UnauthorizedException
    {
        Forum forum = factory.getForum(name);
        ForumPermissions forumPermissions = forum.getPermissions(authorization);
        //Create a new permissions object with the combination of the
        //permissions of this object and tempPermissions.
        ForumPermissions newPermissions =
                new ForumPermissions(permissions, forumPermissions);
        //Check and see if the user has READ permissions. If not, throw an
        //an UnauthorizedException.
        if (!(
            newPermissions.get(ForumPermissions.READ) ||
            newPermissions.get(ForumPermissions.FORUM_ADMIN) ||
            newPermissions.get(ForumPermissions.SYSTEM_ADMIN)
            ))
        {
            throw new UnauthorizedException();
        }
        return new ForumProxy(forum, authorization, newPermissions);
    }

    public int getForumCount() {
        return factory.getForumCount();
    }

    public Iterator forums() {
        return new ForumIteratorProxy(factory.forums(), authorization, permissions);
    }
    public Iterator forumsModeration() {
        return new ForumModeratorIteratorProxy(factory.forums(), authorization, permissions);
    }

    public ProfileManager getProfileManager() {
        ProfileManager profileManager = factory.getProfileManager();
        return new ProfileManagerProxy(profileManager, authorization, permissions);
    }

    public SearchIndexer getSearchIndexer() throws UnauthorizedException {
        if (permissions.get(ForumPermissions.SYSTEM_ADMIN)) {
            return factory.getSearchIndexer();
        }
        else {
            throw new UnauthorizedException();
        }
    }

    public int [] usersWithPermission(int permissionType)
            throws UnauthorizedException
    {
        if (permissions.get(ForumPermissions.SYSTEM_ADMIN)) {
            return factory.usersWithPermission(permissionType);
        }
        else {
            throw new UnauthorizedException();
        }
    }

    public int[] groupsWithPermission(int permissionType)
            throws UnauthorizedException
    {
        if (permissions.get(ForumPermissions.SYSTEM_ADMIN)) {
            return factory.groupsWithPermission(permissionType);
        }
        else {
            throw new UnauthorizedException();
        }
    }

    public ForumPermissions getPermissions(Authorization authorization) {
        return factory.getPermissions(authorization);
    }

    public boolean hasPermission(int type) {
        return permissions.get(type);
    }

    /**
     * Returns the forum factory class that the proxy wraps. In some cases,
     * this is necessary so that an outside class can get at methods that only
     * a particular forum factory sublclass contains. Because this is
     * potentially a dangerours operation, access to the underlying class is
     * restricted to those with SYSTEM_ADMIN permissions.
     *
     * @throws UnauthorizedException if does not have ADMIN permissions.
     */
    public ForumFactory getUnderlyingForumFactory()
            throws UnauthorizedException
    {
        if (permissions.get(ForumPermissions.SYSTEM_ADMIN)) {
            return factory;
        }
        else {
            throw new UnauthorizedException();
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
九九国产精品视频| 日韩成人一级片| 精品在线一区二区| 色婷婷亚洲综合| 国产日产欧美一区二区三区| 偷拍一区二区三区四区| 91美女福利视频| 国产免费成人在线视频| 裸体歌舞表演一区二区| 欧美体内she精高潮| 中文字幕日韩精品一区| 国产黄色精品视频| 精品三级av在线| 日韩精品一级中文字幕精品视频免费观看 | 久久久久久夜精品精品免费| 五月天久久比比资源色| 色女孩综合影院| 中文字幕在线播放不卡一区| 国产曰批免费观看久久久| 欧美日韩国产天堂| 亚洲综合色视频| 色妞www精品视频| 亚洲欧美日韩国产另类专区| av一区二区不卡| 中文字幕av资源一区| 国产精品99久久久久久久vr| 欧美videos大乳护士334| 午夜国产精品一区| 欧美日韩在线免费视频| 一区二区激情视频| 日本道在线观看一区二区| 亚洲欧美国产毛片在线| 色呦呦国产精品| 136国产福利精品导航| 不卡的av在线| 亚洲欧洲无码一区二区三区| 99久久综合狠狠综合久久| 亚洲国产成人在线| 国产91丝袜在线18| 国产人成亚洲第一网站在线播放 | 亚洲成年人网站在线观看| 91国偷自产一区二区使用方法| 中文字幕一区二区5566日韩| 成人av在线一区二区| 国产精品色呦呦| 91免费看视频| 一区2区3区在线看| 欧美日韩一级二级| 日韩电影在线观看网站| 欧美不卡激情三级在线观看| 九九精品视频在线看| 久久精品欧美日韩| 91在线观看视频| 亚洲综合男人的天堂| 欧美日韩免费视频| 美女诱惑一区二区| 久久久精品黄色| 成人自拍视频在线观看| 中文字幕中文字幕在线一区 | 成人动漫视频在线| 中文字幕一区日韩精品欧美| 色综合咪咪久久| 亚洲国产综合色| 日韩视频在线你懂得| 久久国产精品一区二区| 国产午夜精品一区二区三区嫩草 | 国产一区二区三区免费| 中文字幕二三区不卡| 色综合av在线| 日本最新不卡在线| 国产欧美日韩在线视频| 99v久久综合狠狠综合久久| 亚洲综合色成人| 日韩欧美中文字幕公布| 国产精品99久久不卡二区| ...xxx性欧美| 在线播放日韩导航| 国产乱一区二区| 亚洲欧美日本韩国| 欧美电影免费观看高清完整版在线| 国产成人在线视频免费播放| 亚洲精品高清视频在线观看| 91精品国产综合久久精品 | 亚洲影院久久精品| 欧美videos中文字幕| 91视频一区二区| 青青草国产精品97视觉盛宴| 久久久久久99精品| 欧美日韩精品免费| 国产盗摄一区二区三区| 亚洲一区在线看| 国产拍揄自揄精品视频麻豆| 在线观看一区日韩| 国产福利91精品一区二区三区| 亚洲综合一区二区精品导航| 久久亚洲二区三区| 欧美日韩专区在线| 国产99久久精品| 午夜国产精品一区| 亚洲欧洲在线观看av| 日韩欧美成人激情| 欧美制服丝袜第一页| 国产成人免费视频精品含羞草妖精| 亚洲久本草在线中文字幕| 精品国产在天天线2019| 欧美中文字幕不卡| 成人黄色a**站在线观看| 欧美a级一区二区| 亚洲另类春色国产| 国产色91在线| 日韩三区在线观看| 在线这里只有精品| 国产成人鲁色资源国产91色综| 午夜精品久久久久久久久久| 中文字幕精品一区二区三区精品| 91麻豆精品久久久久蜜臀| 99精品欧美一区二区三区小说 | 国产成人丝袜美腿| 免播放器亚洲一区| 亚洲亚洲精品在线观看| 亚洲国产高清在线| 久久久久久免费| 欧美一级免费观看| 欧美午夜精品久久久久久超碰| 高清久久久久久| 韩国精品主播一区二区在线观看| 亚洲超碰97人人做人人爱| 综合激情网...| 日本一区二区三区在线观看| 欧美一级久久久久久久大片| 欧美视频三区在线播放| 91污在线观看| voyeur盗摄精品| 国产成人综合亚洲网站| 国内成人免费视频| 蜜桃久久精品一区二区| 调教+趴+乳夹+国产+精品| 有坂深雪av一区二区精品| 亚洲视频资源在线| 国产精品成人免费精品自在线观看| 久久青草国产手机看片福利盒子| 日韩欧美国产精品| 日韩视频免费观看高清在线视频| 欧美福利视频一区| 欧美色网一区二区| 欧美色涩在线第一页| 欧美在线999| 欧美专区在线观看一区| 在线亚洲免费视频| 欧洲激情一区二区| 91成人在线精品| 欧美亚洲一区三区| 欧美午夜精品理论片a级按摩| 欧美色网一区二区| 7777精品伊人久久久大香线蕉最新版| 欧美性一区二区| 欧美日韩一区高清| 欧美美女一区二区在线观看| 欧美日韩精品一区视频| 欧美巨大另类极品videosbest| 欧美老年两性高潮| 精品少妇一区二区三区| ww亚洲ww在线观看国产| 久久精品亚洲麻豆av一区二区| 国产色91在线| 中文字幕一区三区| 亚洲一区二区五区| 午夜电影网一区| 免费日本视频一区| 国产一区二区不卡在线| 国产成人综合自拍| 色综合天天综合网天天狠天天| 91激情五月电影| 91精品国产高清一区二区三区| 欧美一二区视频| 久久夜色精品一区| 国产精品美女久久久久aⅴ国产馆| 国产精品进线69影院| 夜夜精品浪潮av一区二区三区| 性做久久久久久免费观看| 日韩不卡一区二区| 经典三级在线一区| 成人亚洲一区二区一| 色哟哟国产精品免费观看| 欧美日韩三级一区二区| 精品少妇一区二区三区视频免付费 | 成人妖精视频yjsp地址| 日本久久精品电影| 91精品麻豆日日躁夜夜躁| 久久这里只有精品6| 日韩伦理免费电影| 日本不卡的三区四区五区| 国产一区二区三区电影在线观看 | 成人在线一区二区三区| 97精品超碰一区二区三区| 欧美日本在线观看| 久久久三级国产网站| 亚洲男女一区二区三区| 免费成人在线观看| 成人动漫av在线|