Configuration
最終更新日時: $Date:: 2006-12-31 09:51:43 +0900#$
S2Directoryを動かすに必要なdiconファイルの詳細について説明します。事前にSetupに従い、必要なライブラリをあなたのプロジェクトに配置しておいてください。
S2Directoryを動かすのに必要なdiconファイル
S2Directoryのためのdiconファイルには次のものがあります。
ファイル名 | 説明 | 独自定義の必要性 |
---|---|---|
directory.dicon | ディレクトリサーバに接続するための各種設定情報を記載します。 | 必須 |
directorydao.dicon | S2Directoryの基本機能を提供するためのシステム設定を記載します。独自定義することでS2Direcotryを拡張することが出来ます。 | 機能拡張時に必要 |
* diconファイル(ダイコンファイル)とはS2Containerで使用する設定ファイルです。 * diconファイルの詳細については、S2Containerのドキュメントを見てください。
directory.dicon: ディレクトリサーバに接続するための各種設定
directory.diconは、ディレクトリサーバに接続するための各種設定情報を定義するdiconファイルです。
設定例
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN" "http://www.seasar.org/dtd/components21.dtd"> <components namespace="directory"> <component name="directoryControlProperty" class="org.seasar.directory.impl.DirectoryControlPropertyImpl" instance="prototype"> <property name="initialContextFactory"> "com.sun.jndi.ldap.LdapCtxFactory" </property> <property name="url"> "ldap://localhost:389" </property> <property name="baseDn">"dc=seasar,dc=org"</property> <property name="user">"cn=Manager"</property> <property name="password">"secret"</property> <!-- Other options and each default value. <property name="passwordAlgorithm">"SSHA"</property> <property name="userSuffix">"ou=Users"</property> <property name="userAttributeName">"uid"</property> <property name="groupSuffix">"ou=Groups"</property> <property name="groupAttributeName">"memberUid"</property> <property name="multipleValueDelimiter">","</property> --> </component> </components>
設定例の説明
設定項目 | 説明 | 必須設定 | 設定例の値 | デフォルトの値 |
---|---|---|---|---|
initialContextFactory | ディレクトリサーバ接続に使用するコンテキストファクトリ | 任意 | com.sun.jndi.ldap.LdapCtxFactory (Sun JDK標準付属) |
com.sun.jndi.ldap.LdapCtxFactory (Sun JDK標準付属) |
url | 接続先ディレクトリサーバのプロトコル://アドレス:ポート番号 | 必須 | ldap://localhost:389 | null |
baseDn | ディレクトリツリーのベースDN | 必須 | dc=seasar,dc=org | null |
user | 標準で使用するディレクトリツリーへの接続ユーザ | 必須 | cn=Manager (cn=Manager,dc=seasar,dc=orgと同意) |
null |
password | 標準で使用するディレクトリツリーへの接続ユーザのパスワード | 必須 | secret | null |
passwordAlgorithm | ユーザパスワードを管理するのに使用するの暗号化方式 対応している方式: MD5、SMD5、SHA、SSHA、PLAIN |
任意 | デフォルトの値 | SSHA |
userSuffix | ユーザエントリのルートとなるDN。baseDnを含まない場合、自動的に補完されます。 | 任意 | デフォルトの値 | ou=Users (ou=Users,dc=seasar,dc=orgと同意) |
userAttributeName | ユーザエントリを特定するための属性名 | 任意 | デフォルトの値 | uid |
groupSuffix | グループエントリのルートとなるDN。baseDnを含まない場合、自動的に補完されます。 | 任意 | デフォルトの値 | ou=Groups (ou=Groups,dc=seasar,dc=orgと同意) |
groupAttributeName | グループエントリを特定するための属性名 | 任意 | デフォルトの値 | memberUid |
multipleValueDelimiter | 複数値のための区切り文字 | 任意 | デフォルトの値 | , (カンマ) |
directorydao.dicon: S2Directoryの基本機能を提供するためのシステム設定
directorydao.diconは、S2Directoryの基本機能を提供するためのシステム設定を定義するdiconファイルです。独自定義することでS2Direcotryを拡張することが出来ます。S2Directoryの機能を拡張したい方以外はこの設定ファイルの詳細を知る必要はありません。
* S2Directoryの標準機能を使う場合はこのファイルを用意する必要はありません。 * 独自に用意されていない場合、s2-directory-X.X.X.jar ファイル内の標準設定が自動的に使われます。
標準設定
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE components PUBLIC "-//SEASAR2.1//DTD S2Container//EN" "http://www.seasar.org/dtd/components21.dtd"> <components namespace="directorydao"> <include path="directory.dicon"/> <!-- value type --> <component class="org.seasar.directory.impl.DirectoryValueTypeFactoryImpl"/> <!-- attribute handlers --> <component name="defaultHandler" class="org.seasar.directory.attribute.DefaultAttributeHandler"/> <component class="org.seasar.directory.attribute.DistinguishedNameAttributeHandler"> <property name="attributeNameList">{"dn"}</property> </component> <component class="org.seasar.directory.attribute.UserPasswordAttributeHandler"> <property name="attributeNameList">{"userPassword", "alternativeUserPassword"}</property> </component> <component class="org.seasar.directory.impl.DirectoryAttributeHandlerFactoryImpl"> <property name="ignoreCase">true</property> <property name="defaultAttributeHandler">defaultHandler</property> <property name="attributeHandlers"> container.findComponents(@org.seasar.directory.attribute.AttributeHandler@class) </property> </component> <component class="org.seasar.directory.dao.impl.DirectoryAnnotationReaderFactoryImpl"/> <component class="org.seasar.directory.dao.impl.DirectoryDaoMetaDataFactoryImpl"/> <component name="interceptor" class="org.seasar.directory.dao.interceptors.S2DirectoryDaoInterceptor"/> </components>
標準設定の説明
設定項目 | 説明 |
---|---|
<include path="directory.dicon"/> | ディレクトリサーバ接続情報が書かれた設定ファイルを読み込む |
org.seasar.directory.impl.DirectoryValueTypeFactoryImpl | 属性値を読み書きする際の型変換ファクトリ |
org.seasar.directory.attribute.DefaultAttributeHandler | 属性名に応じて属性値を比較、変換する際の標準属性ハンドラ |
org.seasar.directory.attribute.DistinguishedNameAttributeHandler | 属性DNのための属性値を比較、変換する際の属性ハンドラ |
org.seasar.directory.attribute.UserPasswordAttributeHandler | 属性userPasswordのための属性値を比較、変換する際の属性ハンドラ 暗号化されているパスワードの検証や、暗号化パスワードを生成します |
org.seasar.directory.impl.DirectoryAttributeHandlerFactoryImpl | 属性名に応じて属性値を比較、変換する際の属性ハンドラファクトリ |
org.seasar.directory.dao.impl.DirectoryAnnotationReaderFactoryImpl | アノテーションリーダファクトリ |
org.seasar.directory.dao.impl.DirectoryDaoMetaDataFactoryImpl | メタオブジェクトファクトリ |
org.seasar.directory.dao.interceptors.S2DirectoryDaoInterceptor | S2AOPのためのインタセプター |