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

📄 activedirectorygroup.java

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

import com.sslexplorer.security.Role;

/**
 * Implementation of a {@link com.sslexplorer.security.Role} that is created
 * from an Active Directory Group.
 * 
 * @author Lee Painter <a href="mailto:lee@3sp.com">&lt;lee@3sp.com&gt;</a>
 * @author Brett Smith <a href="mailto:brett@3sp.com">&lt;brett@3sp.com&gt;</a>
 * @version $Revision: 1.11 $
 */

public class ActiveDirectoryGroup implements Role {

    // Private instance variables
    
    private String sAMAccountName;
    private String DN;
    private Long rid;
    //private ActiveDirectoryGroup[] children;
    private ActiveDirectoryGroup[] parents;

    /* (non-Javadoc)
     * @see com.sslexplorer.policyframework.Principal#getPrincipalName()
     */
    public String getPrincipalName() {
        return sAMAccountName;
    }
    
    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return getPrincipalName();
    }

    /**
     * Compare this user against another using the users name for comparison
     * 
     * @param o user to compare with
     * @return comparison
     */
    public int compareTo(Object o) {
        return getPrincipalName().compareTo(((Role)o).getPrincipalName());
    }

    /**
     * Set the SAM Account Name. This is used as the role's princiapal name.
     *  
     * @param sAMAccountName SAM Account Name
     */
    void setSAMAccountName(String sAMAccountName) {
        this.sAMAccountName = sAMAccountName;        
    }

    /**
     * Get the SAM Account Name. This is used as the role's princiapal name.
     * 
     * @return SAM Account Name
     */
    String getSAMAccountName() {
        return sAMAccountName;
    }
    
    /**
     * Set the DN.
     * 
     * @param dn DN
     */
    void setDN(String dn) {
        this.DN = dn;
    }

    /**
     * Get the DN
     * 
     * @return DN
     */
    String getDN() {
        return DN;
    }
    
    /**
     * Get the RID for this role. This is used to lookup a users primary group
     * 
     * @return RID
     */
    Long getRID() {
            return rid;
    }
   
    /**
     * Set the RID for this role. This is used to lookup the users primary group
     * 
     * @param rid rid
     */
    void setRID(Long rid) {
            this.rid = rid;
    }
    

    void setParents(ActiveDirectoryGroup[] parents) {
    	this.parents = parents;
    }
    
    ActiveDirectoryGroup[] getParents() {
    	return parents;
    }
    
    public int hashCode() {
        return sAMAccountName.hashCode();
    }
    
    public boolean equals(Object obj) {
        if(obj!=null && obj instanceof ActiveDirectoryGroup) {
            return((ActiveDirectoryGroup)obj).sAMAccountName.equals(sAMAccountName);
        }
        return false;
    }
}

⌨️ 快捷键说明

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