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

📄 authenticationschemeresourcetype.java

📁 这是linux下ssl vpn的实现程序
💻 JAVA
字号:
package com.sslexplorer.security;

import java.util.Iterator;

import com.sslexplorer.boot.PropertyList;
import com.sslexplorer.core.CoreAttributeConstants;
import com.sslexplorer.core.CoreEvent;
import com.sslexplorer.core.CoreEventConstants;
import com.sslexplorer.core.CoreServlet;
import com.sslexplorer.policyframework.DefaultResourceType;
import com.sslexplorer.policyframework.PolicyConstants;
import com.sslexplorer.policyframework.Resource;
import com.sslexplorer.policyframework.ResourceChangeEvent;
import com.sslexplorer.policyframework.ResourceDeleteEvent;
import com.sslexplorer.policyframework.ResourceUtil;

/**
 * Implementation of a {@link com.sslexplorer.policyframework.ResourceType} that
 * is used for configured <i>Authentication Schemes</i>.
 * 
 * @author Brett Smith <a href="mailto:brett@3sp.com">&lt;brett@3sp.com&gt;</a>
 * @version $Revision: 1.2 $
 */
public class AuthenticationSchemeResourceType extends DefaultResourceType {

    /**
     * Constructor
     */
    public AuthenticationSchemeResourceType() {
        super(PolicyConstants.AUTHENTICATION_SCHEMES_RESOURCE_TYPE_ID, "policyframework", PolicyConstants.SYSTEM_CLASS);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.navigation.FavoriteResourceType#getResourceById(int)
     */
    public Resource getResourceById(int resourceId) throws Exception {
        return CoreServlet.getServlet().getSystemDatabase().getAuthenticationSchemeSequence(resourceId);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.navigation.FavoriteResourceType#getResourceByName(java.lang.String)
     */
    public Resource getResourceByName(String resourceName) throws Exception {
        return ResourceUtil.getResourceByName(resourceName, CoreServlet.getServlet().getSystemDatabase()
                        .getAuthenticationSchemeSequences());
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.policyframework.ResourceType#removeResource(int,
     *      com.sslexplorer.security.SessionInfo)
     */
    public Resource removeResource(int resourceId, SessionInfo session) throws Exception {
        try {
            AuthenticationSchemeSequence resource = CoreServlet.getServlet().getSystemDatabase().getAuthenticationSchemeSequence(
                            resourceId);
            CoreServlet.getServlet().getSystemDatabase().deleteAuthenticationSchemeSequence(resourceId);
            return resource;
        } catch (Exception e) {
            throw e;
        }
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.boot.policyframework.ResourceType#updateResource(com.sslexplorer.boot.policyframework.Resource,
     *      com.sslexplorer.security.SessionInfo)
     */
    public void updateResource(Resource resource, SessionInfo session) throws Exception {
        try {
            CoreServlet.getServlet().getSystemDatabase()
                            .updateAuthenticationSchemeSequence((AuthenticationSchemeSequence) resource);
        } catch (Exception e) {
            throw e;
        }
    }
    
    public static void addAuthenticationModule(CoreEvent evt, String authenticationModule, int position){
        evt.addAttribute(CoreAttributeConstants.EVENT_ATTR_AUTHENTICATION_MODULE+position, authenticationModule);
    }
    
}

⌨️ 快捷键说明

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