LDAP操作カプセル化クラス
ターゲット:ユーザーは、LDAP操作をカプセル化するためにリストデータ構造とマップを使用するだけです。
クラス:3つの主要なカテゴリがあります
1 ENVクラスには、LDAP接続情報が含まれています
2 LDAPConnectionFactoryクラスLDAP接続工場、LDAP接続の初期化と取得方法を提供する
3 LDAPOPERUTILS LDAP処理ツールクラスは、LDAPを操作するためのさまざまな方法を提供します。
LDAPの接続属性クラス
コードコピーは次のとおりです。
パッケージcom.common.ldapconnection;
org.apache.log4j.loggerをインポートします。
/**
* <p>関数説明:LDAPの接続プロパティ</p>
* @author liaowufeng
* @version 1.0
*/
パブリッククラスenv {
// log4jを呼び出すログは、出力に使用されます
プライベートロガーlog = logger.getLogger(env.class.getName());
// LDAPサーバーの固定書き込み方法が使用されていても、JNDIサービスプロバイダーの工場クラスが指定されています
パブリックストリングファクトリー。
//サービス接続アドレス
パブリック文字列URL;
// LDAPにログインするためのユーザー名とパスワード
パブリックストリングadminuid;
// LDAPユーザーパスワードにログインします
public string adminpwd;
//安全なアクセスに必要な証明書ライブラリ
public string ssltruststore;
//セキュアチャネルアクセス
Public String SecurityProtocol;
//タイムアウトを接続します
パブリックストリングタイムアウト;
/**
*コンストラクター
*/
public env(){
}
/**
*コンストラクター
* @Param Factory LDAP Factoryクラス
* @param url ldap url
* @param adminuid ldapユーザー
* @param adminpwd ldapパスワード
*/
public env(String Factory、String url、String adminuid、String adminpwd){
this.Factory = Factory;
this.url = url;
this.adminuid = adminuid;
this.adminpwd = adminpwd;
}
/**
*コンストラクター
* @Param Factory LDAP Factoryクラス名
* @param url ldap url
* @param adminuid ldapユーザー
* @param adminpwd ldapパスワード
* @Param SSLTrustStore証明書をセキュアアクセスに必要な証明書
* @param SecurityProtocolセキュアチャネルアクセス
*/
public env(String Factory、String URL、String Adminuid、String Adminpwd、
string ssltruststore、
string securityprotocol){
this.Factory = Factory;
this.url = url;
this.adminuid = adminuid;
this.adminpwd = adminpwd;
this.ssltruststore = ssltruststore;
this.securityprotocol = securityprotocol;
}
/**
*コンストラクター
* @Param Factory LDAP Factoryクラス名
* @param url ldap url
* @param adminuid ldapユーザー
* @param adminpwd ldapパスワード
* @Param SSLTrustStore証明書をセキュアアクセスに必要な証明書
* @param SecurityProtocolセキュアチャネルアクセス
*/
public env(String Factory、String URL、String Adminuid、String Adminpwd、
文字列タイムアウト、
string ssltruststore、
string securityprotocol){
this.Factory = Factory;
this.url = url;
this.adminuid = adminuid;
this.adminpwd = adminpwd;
this.timeout = timeout;
this.ssltruststore = ssltruststore;
this.securityprotocol = securityprotocol;
}
}