ヘッダーをスキップ
Oracle® Fusion Middleware Oracle Internet Directory管理者ガイド
11g リリース1(11.1.1)
B55919-05
  目次へ移動
目次
索引へ移動
索引

前
 
次
 

17 計算属性の管理

この章では、計算属性を管理する方法について説明します。 内容は次のとおりです。

17.1 計算属性の概要

Oracle Internet Directoryサーバーでは、1つ以上のルールに基づいて構成可能な属性およびその値を動的に計算するためのメカニズムとしてOrclComputedAttribute属性を提供しています。したがって、ディレクトリ・ストア内で属性を永続化しなくても、実際に必要なときに属性を計算できます。計算属性は、テストから本番デプロイメントへの移行で役立ちます。

OrclComputedAttribute属性は、DSA構成エントリの構成属性です。

cn=dsaconfig,cn=configsets,cn=oracle internet directory.

OrclComputedAttributeは多値属性であるため、複数の属性とその値を動的に計算できます。

OrclComputedAttribute値は、ルールで定義される次の項目または次の項目の組合せから導出できます。

次に、OrclComputedAttributeを使用する場合の考慮事項をいくつか示します。

17.2 計算属性の構成

ldapmodify、Oracle Directory Services Manager、サード・パーティLDAPブラウザなどのLDAPツールを使用してOrclComputedAttributeを構成できます。

この項では、次の内容を説明します。

17.2.1 計算属性に使用されるルールおよび構文

この項では、属性値の計算に使用されるルールの構文について説明します。

値の計算でこうしたルールの組合せを使用できる場合は、表17-1の「特殊文字」を参照してください。

こうしたルールでは、次の構文を使用します。

OrclComputedAttribute;ComputedAttrName;dn;Filter: ldapURI 

OrclComputedAttribute;ComputedAttrName;dn;Filter: "anyString"

OrclComputedAttribute;ComputedAttrName;dn;Filter: AttributeName

OrclComputedAttribute;ComputedAttrName;dn;Filter: Func(attrName)

表17-1で、こうしたルールで使用される要素について説明します。

表17-1 計算属性のルールで使用される構文要素

要素 説明

ComputedAttrName

エントリで返される属性の名前。計算属性の名前は、スキーマで定義する必要があります。またこの属性は、値の計算後にACL評価の対象になります。

dn

識別名。属性は、このDNの子エントリについて計算されます。

Filter

フィルタ値。属性は、このフィルタ値に属するエントリについて計算されます。

ldapURI

RFC 4516に記載された構文に準拠する次のようなURI。

ldap:///baseDN?ReqdAttribute??scope?filter

ReqdAttributeは、必須属性の単一の属性名です。

ldapURI構成に空白文字が含まれる場合、RFC 4516に記載されているように、空白を%20としてエンコードする必要があります。

"anyString"

含める文字列。二重引用符で囲む必要があります。

AttributeName

属性値を示す属性名を使用する必要があります。

Func(attr)

値に対して実行する関数の名前。リリース11g(11.1.1.7.0)では、次の関数が使用可能です。

lower(attrName)

upper(attrName)

substr(attrName,pos,len)

replace(attrName,"str")

trunc(attrName, "c")

特殊文字

ルールとともに使用できる特殊文字は次のとおりです。

  • 複数のルールを指定する場合、各ルールを区切るために空白文字を使用する必要があります。

  • ルールまたは文字列を追加または連結するには、プラス記号(+)を使用します。

  • 第1のルール評価の結果により値を決定するには、OR演算子(|)を使用します。

  • アスタリスク(*)はワイルドカード文字であり、ldapURI内でのみ使用できます。この演算子がURIのDN部分で表示される場合、*はエントリのDNを評価する有効範囲から導出されたものです。


17.2.2 計算属性の使用例

この項では、計算属性の使用例を示します。

17.2.2.1 属性値の大文字での返却

次の例ではcn属性を大文字として計算し、upperattrとして属性を返します。

dn: cn=dsaconfig,cn=configsets,cn=oracle internet directory
changetype: modify
add: orclcomputedattribute;upperattr;dc=acme,dc=com;objectclass=person
orclcomputedattribute;upperattr;ou=EuroSInet Suite,o=IMC,c=US;objectclass=person: upper(cn)

upperattrのスキーマ定義を定義する必要があります。

17.2.2.2 属性値の部分文字列の返却

次の例では、属性値の部分文字列を計算し、位置1から次の3文字のdescription値としての値を含む属性substrattrを返します。

dn: cn=dsaconfig,cn=configsets,cn=oracle internet directory
changetype: modify
add: orclcomputedattribute;substrattr;dc=acme,dc=com;objectclass=person
orclcomputedattribute;substrattr;dc=acme,dc=com;objectclass=person: substr(description, 1,3)

17.2.2.3 属性値の置換

次の例では、newTitleの属性値を計算して置換します。

dn: cn=dsaconfig,cn=configsets,cn=oracle internet directory
changetype: modify
add: orclcomputedattribute;newTitle;cn=john doe,dc=acme,dc=com;objectclass=person
orclcomputedattribute;newTitle;ou=EuroSInet Suite,o=IMC,c=US;objectclass=person:  replace(title, "Clerk", "Manager")

17.2.2.4 URIベースの構成の指定

次の例では、dc=acme,dc=comの下にある各エントリにcommonTelephoneNumberを追加します。

dn: cn=dsaconfig,cn=configsets,cn=oracle internet directory
changetype: modify
add: orclcomputedattribute;commonTelephoneNumber;dc=acme,dc=com;objectclass=person
orclcomputedattribute;commonTelephoneNumber;dc=acme,dc=com,c=US;objectclass=person: "Common PhoneNumber is " +  
ldap:///cn=common%20attributes,dc=com?telephonenumber??base?objectclass=*

17.2.2.5 様々なルールの組合せの使用

空白文字によって区切られた様々なルールを+(プラス記号)を使用して連結します。

dn: cn=dsaconfig,cn=configsets,cn=oracle internet directory
changetype: modify
add: orclcomputedattribute;combinationAttribute;ou=EuroSInet Suite,o=IMC,c=US;objectclass=person
orclcomputedattribute;combinationAttribute;dc=acme,dc=com;objectclass=person: "telephone number from common entry:" +  ldap:///cn=common Entry,?telephonenumber??base?objectclass=* + 
" appending replace of title attr with clerk/manager " + 
replace(title, "Clerk", "Manager")
dn: cn=dsaconfig,cn=configsets,cn=oracle internet directory
changetype: modify
add: orclcomputedattribute;combinationAttr2;dc=acme,dc=com;objectclass=person
orclcomputedattribute;combinationAttr2;dc=acme,dc=com;objectclass=person: "Telephone number  from common entry " +  
ldap:///cn=commonEntry,dc=acme,dc=com?telephonenumber??base?objectclass=* + 
" appending truncate of description for space char " + trunc(description, " ")

17.2.2.6 OR(|)演算子の使用

エントリにtelephoneNumber属性がある場合はcontactNumber属性をtelephoneNumberとして追加し、それ以外の場合は値6505067000をコピーします。

dn: cn=dsaconfig,cn=configsets,cn=oracle internet directory
changetype: modify
add: orclcomputedattribute;contactNumber;cn=employees,dc=acme,dc=com;
   (objectclass=person)
orclcomputedattribute;contactNumber;cn=employees,dc=acme,dc=com;
   (objectclass=person): telephonenumber | 6505067000

注意:

OR演算子(|)については、計算属性定義では次の構文がサポートされます。

definition-1 | definition-2 | ... definition-n

各項目の意味は次のとおりです。

  • definition-1は複合的なルールでもかまいません。

  • definition-2からdefinition-nは、ハードコード化された文字列や属性値などの簡単なルールのみであることが必要です。これらの定義で、関数式または式ルールの組合せを使用することはできません。

たとえば、次のルールでは、エントリに対するuidが存在しない場合に、その結果はエントリ内の属性cnの発生数にかかわりなく、計算値"cn="になります。

orclcomputedattr;myattr;cn=employees;(objectclass=inetorgperson): "uid=" + uid | "cn=" + cn