Integerated first part of the Fix for Issue# 262:Plugin for Collation/Internationalization
4 files deleted
49 files added
66 files modified
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Auth Password Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.AuthPasswordEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.AuthPasswordEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Auth Password Exact Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Auth Password Exact Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.AuthPasswordExactEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.AuthPasswordExactEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Bit String Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Bit String Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.BitStringEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.BitStringEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Boolean Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Boolean Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.BooleanEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.BooleanEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Exact Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Case Exact Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Exact Ordering Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | cn: Case Exact Ordering Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Exact Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Case Exact Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactSubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactSubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Exact IA5 Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Case Exact IA5 Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactIA5EqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactIA5EqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Exact IA5 Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Case Exact IA5 Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactIA5SubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseExactIA5SubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Ignore Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Case Ignore Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Ignore Ordering Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | cn: Case Ignore Ordering Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Ignore Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Case Ignore Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreSubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreSubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Ignore IA5 Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Case Ignore IA5 Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreIA5EqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreIA5EqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Ignore IA5 Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Case Ignore IA5 Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreIA5SubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreIA5SubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Ignore List Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Case Ignore List Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreListEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreListEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Case Ignore List Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Case Ignore List Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreListSubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.CaseIgnoreListSubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Collation Matching Rule,cn=Matching Rules,cn=config |
| | | objectClass: top |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-collation-matching-rule |
| | | cn: Collation Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.CollationMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | ds-cfg-matching-rule-type: equality |
| | | ds-cfg-matching-rule-type: less-than |
| | | ds-cfg-matching-rule-type: less-than-or-equal-to |
| | | ds-cfg-matching-rule-type: greater-than |
| | | ds-cfg-matching-rule-type: greater-than-or-equal-to |
| | | ds-cfg-matching-rule-type: substring |
| | | #ds-cfg-collation: af:1.3.6.1.4.1.42.2.27.9.4.1.1 |
| | | #ds-cfg-collation: am:1.3.6.1.4.1.42.2.27.9.4.2.1 |
| | | ds-cfg-collation: ar:1.3.6.1.4.1.42.2.27.9.4.3.1 |
| | | ds-cfg-collation: ar-AE:1.3.6.1.4.1.42.2.27.9.4.4.1 |
| | | ds-cfg-collation: ar-BH:1.3.6.1.4.1.42.2.27.9.4.5.1 |
| | | ds-cfg-collation: ar-DZ:1.3.6.1.4.1.42.2.27.9.4.6.1 |
| | | ds-cfg-collation: ar-EG:1.3.6.1.4.1.42.2.27.9.4.7.1 |
| | | #ds-cfg-collation: ar-IN:1.3.6.1.4.1.42.2.27.9.4.8.1 |
| | | ds-cfg-collation: ar-IQ:1.3.6.1.4.1.42.2.27.9.4.9.1 |
| | | ds-cfg-collation: ar-JO:1.3.6.1.4.1.42.2.27.9.4.10.1 |
| | | ds-cfg-collation: ar-KW:1.3.6.1.4.1.42.2.27.9.4.11.1 |
| | | ds-cfg-collation: ar-LB:1.3.6.1.4.1.42.2.27.9.4.12.1 |
| | | ds-cfg-collation: ar-LY:1.3.6.1.4.1.42.2.27.9.4.13.1 |
| | | ds-cfg-collation: ar-MA:1.3.6.1.4.1.42.2.27.9.4.14.1 |
| | | ds-cfg-collation: ar-OM:1.3.6.1.4.1.42.2.27.9.4.15.1 |
| | | ds-cfg-collation: ar-QA:1.3.6.1.4.1.42.2.27.9.4.16.1 |
| | | ds-cfg-collation: ar-SA:1.3.6.1.4.1.42.2.27.9.4.17.1 |
| | | ds-cfg-collation: ar-SD:1.3.6.1.4.1.42.2.27.9.4.18.1 |
| | | ds-cfg-collation: ar-SY:1.3.6.1.4.1.42.2.27.9.4.19.1 |
| | | ds-cfg-collation: ar-TN:1.3.6.1.4.1.42.2.27.9.4.20.1 |
| | | ds-cfg-collation: ar-YE:1.3.6.1.4.1.42.2.27.9.4.21.1 |
| | | ds-cfg-collation: be:1.3.6.1.4.1.42.2.27.9.4.22.1 |
| | | ds-cfg-collation: bg:1.3.6.1.4.1.42.2.27.9.4.23.1 |
| | | #ds-cfg-collation: bn:1.3.6.1.4.1.42.2.27.9.4.24.1 |
| | | ds-cfg-collation: ca:1.3.6.1.4.1.42.2.27.9.4.25.1 |
| | | ds-cfg-collation: cs:1.3.6.1.4.1.42.2.27.9.4.26.1 |
| | | ds-cfg-collation: da:1.3.6.1.4.1.42.2.27.9.4.27.1 |
| | | ds-cfg-collation: de:1.3.6.1.4.1.142.2.27.9.4.28.1 |
| | | ds-cfg-collation: de-DE:1.3.6.1.4.1.142.2.27.9.4.28.1 |
| | | ds-cfg-collation: de-AT:1.3.6.1.4.1.42.2.27.9.4.29.1 |
| | | #ds-cfg-collation: de-BE:1.3.6.1.4.1.42.2.27.9.4.30.1 |
| | | ds-cfg-collation: de-CH:1.3.6.1.4.1.42.2.27.9.4.31.1 |
| | | ds-cfg-collation: de-LU:1.3.6.1.4.1.42.2.27.9.4.32.1 |
| | | ds-cfg-collation: el:1.3.6.1.4.1.42.2.27.9.4.33.1 |
| | | ds-cfg-collation: en:1.3.6.1.4.1.42.2.27.9.4.34.1 |
| | | ds-cfg-collation: en-US:1.3.6.1.4.1.42.2.27.9.4.34.1 |
| | | ds-cfg-collation: en-AU:1.3.6.1.4.1.42.2.27.9.4.35.1 |
| | | ds-cfg-collation: en-CA:1.3.6.1.4.1.42.2.27.9.4.36.1 |
| | | ds-cfg-collation: en-GB:1.3.6.1.4.1.42.2.27.9.4.37.1 |
| | | #ds-cfg-collation: en-HK:1.3.6.1.4.1.42.2.27.9.4.38.1 |
| | | ds-cfg-collation: en-IE:1.3.6.1.4.1.42.2.27.9.4.39.1 |
| | | ds-cfg-collation: en-IN:1.3.6.1.4.1.42.2.27.9.4.40.1 |
| | | #ds-cfg-collation: en-MT:1.3.6.1.4.1.42.2.27.9.4.41.1 |
| | | ds-cfg-collation: en-NZ:1.3.6.1.4.1.42.2.27.9.4.42.1 |
| | | #ds-cfg-collation: en-PH:1.3.6.1.4.1.42.2.27.9.4.43.1 |
| | | #ds-cfg-collation: en-SG:1.3.6.1.4.1.42.2.27.9.4.44.1 |
| | | #ds-cfg-collation: en-VI:1.3.6.1.4.1.42.2.27.9.4.45.1 |
| | | ds-cfg-collation: en-ZA:1.3.6.1.4.1.42.2.27.9.4.46.1 |
| | | #ds-cfg-collation: en-ZW:1.3.6.1.4.1.42.2.27.9.4.47.1 |
| | | #ds-cfg-collation: eo:1.3.6.1.4.1.42.2.27.9.4.48.1 |
| | | ds-cfg-collation: es:1.3.6.1.4.1.42.2.27.9.4.49.1 |
| | | ds-cfg-collation: es-ES:1.3.6.1.4.1.42.2.27.9.4.49.1 |
| | | ds-cfg-collation: es-AR:1.3.6.1.4.1.42.2.27.9.4.50.1 |
| | | ds-cfg-collation: es-BO:1.3.6.1.4.1.42.2.27.9.4.51.1 |
| | | ds-cfg-collation: es-CL:1.3.6.1.4.1.42.2.27.9.4.52.1 |
| | | ds-cfg-collation: es-CO:1.3.6.1.4.1.42.2.27.9.4.53.1 |
| | | ds-cfg-collation: es-CR:1.3.6.1.4.1.42.2.27.9.4.54.1 |
| | | ds-cfg-collation: es-DO:1.3.6.1.4.1.42.2.27.9.4.55.1 |
| | | ds-cfg-collation: es-EC:1.3.6.1.4.1.42.2.27.9.4.56.1 |
| | | ds-cfg-collation: es-GT:1.3.6.1.4.1.42.2.27.9.4.57.1 |
| | | ds-cfg-collation: es-HN:1.3.6.1.4.1.42.2.27.9.4.58.1 |
| | | ds-cfg-collation: es-MX:1.3.6.1.4.1.42.2.27.9.4.59.1 |
| | | ds-cfg-collation: es-NI:1.3.6.1.4.1.42.2.27.9.4.60.1 |
| | | ds-cfg-collation: es-PA:1.3.6.1.4.1.42.2.27.9.4.61.1 |
| | | ds-cfg-collation: es-PE:1.3.6.1.4.1.42.2.27.9.4.62.1 |
| | | ds-cfg-collation: es-PR:1.3.6.1.4.1.42.2.27.9.4.63.1 |
| | | ds-cfg-collation: es-PY:1.3.6.1.4.1.42.2.27.9.4.64.1 |
| | | ds-cfg-collation: es-SV:1.3.6.1.4.1.42.2.27.9.4.65.1 |
| | | #ds-cfg-collation: es-US:1.3.6.1.4.1.42.2.27.9.4.66.1 |
| | | ds-cfg-collation: es-UY:1.3.6.1.4.1.42.2.27.9.4.67.1 |
| | | ds-cfg-collation: es-VE:1.3.6.1.4.1.42.2.27.9.4.68.1 |
| | | ds-cfg-collation: et:1.3.6.1.4.1.42.2.27.9.4.69.1 |
| | | #ds-cfg-collation: eu:1.3.6.1.4.1.42.2.27.9.4.70.1 |
| | | #ds-cfg-collation: fa:1.3.6.1.4.1.42.2.27.9.4.71.1 |
| | | #ds-cfg-collation: fa-IN:1.3.6.1.4.1.42.2.27.9.4.72.1 |
| | | #ds-cfg-collation: fa-IR:1.3.6.1.4.1.42.2.27.9.4.73.1 |
| | | ds-cfg-collation: fi:1.3.6.1.4.1.42.2.27.9.4.74.1 |
| | | #ds-cfg-collation: fo:1.3.6.1.4.1.42.2.27.9.4.75.1 |
| | | ds-cfg-collation: fr:1.3.6.1.4.1.42.2.27.9.4.76.1 |
| | | ds-cfg-collation: fr-FR:1.3.6.1.4.1.42.2.27.9.4.76.1 |
| | | ds-cfg-collation: fr-BE:1.3.6.1.4.1.42.2.27.9.4.77.1 |
| | | ds-cfg-collation: fr-CA:1.3.6.1.4.1.42.2.27.9.4.78.1 |
| | | ds-cfg-collation: fr-CH:1.3.6.1.4.1.42.2.27.9.4.79.1 |
| | | ds-cfg-collation: fr-LU:1.3.6.1.4.1.42.2.27.9.4.80.1 |
| | | #ds-cfg-collation: ga:1.3.6.1.4.1.42.2.27.9.4.81.1 |
| | | #ds-cfg-collation: gl:1.3.6.1.4.1.42.2.27.9.4.82.1 |
| | | #ds-cfg-collation: gu:1.3.6.1.4.1.42.2.27.9.4.83.1 |
| | | #ds-cfg-collation: gv:1.3.6.1.4.1.42.2.27.9.4.84.1 |
| | | ds-cfg-collation: he:1.3.6.1.4.1.42.2.27.9.4.85.1 |
| | | #ds-cfg-collation: hi:1.3.6.1.4.1.42.2.27.9.4.86.1 |
| | | ds-cfg-collation: hr:1.3.6.1.4.1.42.2.27.9.4.87.1 |
| | | ds-cfg-collation: hu:1.3.6.1.4.1.42.2.27.9.4.88.1 |
| | | #ds-cfg-collation: hy:1.3.6.1.4.1.42.2.27.9.4.89.1 |
| | | #ds-cfg-collation: id:1.3.6.1.4.1.42.2.27.9.4.90.1 |
| | | ds-cfg-collation: is:1.3.6.1.4.1.42.2.27.9.4.91.1 |
| | | ds-cfg-collation: it:1.3.6.1.4.1.42.2.27.9.4.92.1 |
| | | ds-cfg-collation: it-CH:1.3.6.1.4.1.42.2.27.9.4.93.1 |
| | | ds-cfg-collation: ja:1.3.6.1.4.1.42.2.27.9.4.94.1 |
| | | #ds-cfg-collation: kl:1.3.6.1.4.1.42.2.27.9.4.95.1 |
| | | #ds-cfg-collation: kn:1.3.6.1.4.1.42.2.27.9.4.96.1 |
| | | ds-cfg-collation: ko:1.3.6.1.4.1.42.2.27.9.4.97.1 |
| | | #ds-cfg-collation: kok:1.3.6.1.4.1.42.2.27.9.4.98.1 |
| | | #ds-cfg-collation: kw:1.3.6.1.4.1.42.2.27.9.4.99.1 |
| | | ds-cfg-collation: lt:1.3.6.1.4.1.42.2.27.9.4.100.1 |
| | | ds-cfg-collation: lv:1.3.6.1.4.1.42.2.27.9.4.101.1 |
| | | ds-cfg-collation: mk:1.3.6.1.4.1.42.2.27.9.4.102.1 |
| | | #ds-cfg-collation: mr:1.3.6.1.4.1.42.2.27.9.4.103.1 |
| | | #ds-cfg-collation: mt:1.3.6.1.4.1.42.2.27.9.4.104.1 |
| | | ds-cfg-collation: nl:1.3.6.1.4.1.42.2.27.9.4.105.1 |
| | | ds-cfg-collation: nl-NL:1.3.6.1.4.1.42.2.27.9.4.105.1 |
| | | ds-cfg-collation: nl-BE:1.3.6.1.4.1.42.2.27.9.4.106.1 |
| | | ds-cfg-collation: no:1.3.6.1.4.1.42.2.27.9.4.107.1 |
| | | ds-cfg-collation: no-NO:1.3.6.1.4.1.42.2.27.9.4.107.1 |
| | | ds-cfg-collation: no-NO-NY:1.3.6.1.4.1.42.2.27.9.4.108.1 |
| | | #ds-cfg-collation: nn:1.3.6.1.4.1.42.2.27.9.4.109.1 |
| | | #ds-cfg-collation: nb:1.3.6.1.4.1.42.2.27.9.4.110.1 |
| | | #ds-cfg-collation: no-NO-B:1.3.6.1.4.1.42.2.27.9.4.110.1 |
| | | #ds-cfg-collation: om:1.3.6.1.4.1.42.2.27.9.4.111.1 |
| | | #ds-cfg-collation: om-ET:1.3.6.1.4.1.42.2.27.9.4.112.1 |
| | | #ds-cfg-collation: om-KE:1.3.6.1.4.1.42.2.27.9.4.113.1 |
| | | ds-cfg-collation: pl:1.3.6.1.4.1.42.2.27.9.4.114.1 |
| | | ds-cfg-collation: pt:1.3.6.1.4.1.42.2.27.9.4.115.1 |
| | | ds-cfg-collation: pt-PT:1.3.6.1.4.1.42.2.27.9.4.115.1 |
| | | ds-cfg-collation: pt-BR:1.3.6.1.4.1.42.2.27.9.4.116.1 |
| | | ds-cfg-collation: ro:1.3.6.1.4.1.42.2.27.9.4.117.1 |
| | | ds-cfg-collation: ru:1.3.6.1.4.1.42.2.27.9.4.118.1 |
| | | ds-cfg-collation: ru-RU:1.3.6.1.4.1.42.2.27.9.4.118.1 |
| | | #ds-cfg-collation: ru-UA:1.3.6.1.4.1.42.2.27.9.4.119.1 |
| | | #ds-cfg-collation: sh:1.3.6.1.4.1.42.2.27.9.4.120.1 |
| | | ds-cfg-collation: sk:1.3.6.1.4.1.42.2.27.9.4.121.1 |
| | | ds-cfg-collation: sl:1.3.6.1.4.1.42.2.27.9.4.122.1 |
| | | #ds-cfg-collation: so:1.3.6.1.4.1.42.2.27.9.4.123.1 |
| | | #ds-cfg-collation: so-SO:1.3.6.1.4.1.42.2.27.9.4.123.1 |
| | | #ds-cfg-collation: so-DJ:1.3.6.1.4.1.42.2.27.9.4.124.1 |
| | | #ds-cfg-collation: so-ET:1.3.6.1.4.1.42.2.27.9.4.125.1 |
| | | #ds-cfg-collation: so-KE:1.3.6.1.4.1.42.2.27.9.4.126.1 |
| | | ds-cfg-collation: sq:1.3.6.1.4.1.42.2.27.9.4.127.1 |
| | | ds-cfg-collation: sr:1.3.6.1.4.1.42.2.27.9.4.128.1 |
| | | ds-cfg-collation: sv:1.3.6.1.4.1.42.2.27.9.4.129.1 |
| | | ds-cfg-collation: sv-SE:1.3.6.1.4.1.42.2.27.9.4.129.1 |
| | | #ds-cfg-collation: sv-FI:1.3.6.1.4.1.42.2.27.9.4.130.1 |
| | | #ds-cfg-collation: sw:1.3.6.1.4.1.42.2.27.9.4.131.1 |
| | | #ds-cfg-collation: sw-KE:1.3.6.1.4.1.42.2.27.9.4.132.1 |
| | | #ds-cfg-collation: sw-TZ:1.3.6.1.4.1.42.2.27.9.4.133.1 |
| | | #ds-cfg-collation: ta:1 3 1.3.6.1.4.1.42.2.27.9.4.134.1 |
| | | #ds-cfg-collation: te:1.3.6.1.4.1.42.2.27.9.4.135.1 |
| | | ds-cfg-collation: th:1.3.6.1.4.1.42.2.27.9.4.136.1 |
| | | #ds-cfg-collation: ti:1.3.6.1.4.1.42.2.27.9.4.137.1 |
| | | #ds-cfg-collation: ti-ER:1.3.6.1.4.1.42.2.27.9.4.138.1 |
| | | #ds-cfg-collation: ti-ET:1.3.6.1.4.1.42.2.27.9.4.139.1 |
| | | ds-cfg-collation: tr:1.3.6.1.4.1.42.2.27.9.4.140.1 |
| | | ds-cfg-collation: uk:1.3.6.1.4.1.42.2.27.9.4.141.1 |
| | | ds-cfg-collation: vi:1.3.6.1.4.1.42.2.27.9.4.142.1 |
| | | ds-cfg-collation: zh:1.3.6.1.4.1.42.2.27.9.4.143.1 |
| | | ds-cfg-collation: zh-CN:1.3.6.1.4.1.42.2.27.9.4.144.1 |
| | | ds-cfg-collation: zh-HK:1.3.6.1.4.1.42.2.27.9.4.145.1 |
| | | #ds-cfg-collation: zh-MO:1.3.6.1.4.1.42.2.27.9.4.146.1 |
| | | #ds-cfg-collation: zh-SG:1.3.6.1.4.1.42.2.27.9.4.147.1 |
| | | ds-cfg-collation: zh-TW:1.3.6.1.4.1.42.2.27.9.4.148.1 |
| | | |
| | | dn: cn=Directory String First Component Equality Matching Rule,cn=Matching Rules,cn=config |
| | | objectClass: top |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Directory String First Component Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.DirectoryStringFirstComponentEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.DirectoryStringFirstComponentEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Distinguished Name Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Distinguished Name Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.DistinguishedNameEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.DistinguishedNameEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Double Metaphone Approximate Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-approximate-matching-rule |
| | | cn: Double Metaphone Approximate Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.DoubleMetaphoneApproximateMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.DoubleMetaphoneApproximateMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Generalized Time Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Generalized Time Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.GeneralizedTimeEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.GeneralizedTimeEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Generalized Time Ordering Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | cn: Generalized Time Ordering Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.GeneralizedTimeOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.GeneralizedTimeOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Historical CSN Ordering Matching Rule,cn=Matching Rules,cn=config |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | objectClass: top |
| | | objectClass: ds-cfg-matching-rule |
| | | ds-cfg-java-class: org.opends.server.replication.plugin.HistoricalCsnOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.replication.plugin.HistoricalCsnOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | cn: Historical CSN Ordering Matching Rule |
| | | |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Integer Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.IntegerEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.IntegerEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Integer Ordering Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | cn: Integer Ordering Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.IntegerOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.IntegerOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Integer First Component Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Integer First Component Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.IntegerFirstComponentEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.IntegerFirstComponentEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Keyword Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Keyword Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.KeywordEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.KeywordEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Numeric String Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Numeric String Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.NumericStringEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.NumericStringEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Numeric String Ordering Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | cn: Numeric String Ordering Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.NumericStringOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.NumericStringOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Numeric String Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Numeric String Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.NumericStringSubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.NumericStringSubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Object Identifier Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Object Identifier Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.ObjectIdentifierEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.ObjectIdentifierEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Object Identifier First Component Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Object Identifier First Component Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.ObjectIdentifierFirstComponentEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.ObjectIdentifierFirstComponentEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Octet String Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Octet String Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.OctetStringEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.OctetStringEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Octet String Ordering Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | cn: Octet String Ordering Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.OctetStringOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.OctetStringOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Octet String Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Octet String Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.OctetStringSubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.OctetStringSubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Presentation Address Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Presentation Address Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.PresentationAddressEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.PresentationAddressEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Protocol Information Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Protocol Information Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.ProtocolInformationEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.ProtocolInformationEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Telephone Number Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Telephone Number Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.TelephoneNumberEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.TelephoneNumberEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Telephone Number Substring Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-substring-matching-rule |
| | | cn: Telephone Number Substring Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.TelephoneNumberSubstringMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.TelephoneNumberSubstringMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Unique Member Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Unique Member Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.UniqueMemberEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.UniqueMemberEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=User Password Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: User Password Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.UserPasswordEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.UserPasswordEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=User Password Exact Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: User Password Exact Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.UserPasswordExactEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.UserPasswordExactEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=UUID Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: UUID Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.UUIDEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.UUIDEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=UUID Ordering Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-ordering-matching-rule |
| | | cn: UUID Ordering Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.UUIDOrderingMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.UUIDOrderingMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Word Equality Matching Rule,cn=Matching Rules,cn=config |
| | |
| | | objectClass: ds-cfg-matching-rule |
| | | objectClass: ds-cfg-equality-matching-rule |
| | | cn: Word Equality Matching Rule |
| | | ds-cfg-java-class: org.opends.server.schema.WordEqualityMatchingRule |
| | | ds-cfg-java-class: org.opends.server.schema.WordEqualityMatchingRuleFactory |
| | | ds-cfg-enabled: true |
| | | |
| | | dn: cn=Monitor Providers,cn=config |
| | |
| | | NAME 'ds-cfg-prohibited-subtrees' |
| | | SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 |
| | | X-ORIGIN 'OpenDS Directory Server' ) |
| | | attributeTypes: ( 1.3.6.1.4.1.26027.1.1.499 |
| | | NAME 'ds-cfg-matching-rule-type' |
| | | SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 |
| | | X-ORIGIN 'OpenDS Directory Server' ) |
| | | attributeTypes: ( 1.3.6.1.4.1.26027.1.1.500 |
| | | NAME 'ds-cfg-collation' |
| | | SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 |
| | | X-ORIGIN 'OpenDS Directory Server' ) |
| | | attributeTypes: ( 1.3.6.1.4.1.26027.1.1.511 |
| | | NAME 'ds-cfg-quality-of-protection' |
| | | SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 |
| | |
| | | ds-cfg-allowed-subtrees $ |
| | | ds-cfg-prohibited-subtrees ) |
| | | X-ORIGIN 'OpenDS Directory Server' ) |
| | | objectClasses: ( 1.3.6.1.4.1.26027.1.2.195 |
| | | NAME 'ds-cfg-collation-matching-rule' |
| | | SUP ds-cfg-matching-rule |
| | | STRUCTURAL |
| | | MUST ( ds-cfg-matching-rule-type $ |
| | | ds-cfg-collation ) |
| | | X-ORIGIN 'OpenDS Directory Server' ) |
| | | objectClasses: ( 1.3.6.1.4.1.26027.1.2.950 |
| | | NAME 'ds-mon-branch' |
| | | SUP top |
| New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <!-- |
| | | ! CDDL HEADER START |
| | | ! |
| | | ! The contents of this file are subject to the terms of the |
| | | ! Common Development and Distribution License, Version 1.0 only |
| | | ! (the "License"). You may not use this file except in compliance |
| | | ! with the License. |
| | | ! |
| | | ! You can obtain a copy of the license at |
| | | ! trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | ! or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | ! See the License for the specific language governing permissions |
| | | ! and limitations under the License. |
| | | ! |
| | | ! When distributing Covered Code, include this CDDL HEADER in each |
| | | ! file and include the License file at |
| | | ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | ! add the following below this CDDL HEADER, with the fields enclosed |
| | | ! by brackets "[]" replaced with your own identifying information: |
| | | ! Portions Copyright [yyyy] [name of copyright owner] |
| | | ! |
| | | ! CDDL HEADER END |
| | | ! |
| | | ! |
| | | ! Copyright 2008 Sun Microsystems, Inc. |
| | | ! --> |
| | | <adm:managed-object name="collation-matching-rule" |
| | | plural-name="collation-matching-rules" |
| | | package="org.opends.server.admin.std" extends="matching-rule" |
| | | xmlns:adm="http://www.opends.org/admin" |
| | | xmlns:ldap="http://www.opends.org/admin-ldap"> |
| | | <adm:synopsis> |
| | | <adm:user-friendly-plural-name /> |
| | | provide support for locale-specific filtering and indexing. |
| | | </adm:synopsis> |
| | | <adm:profile name="ldap"> |
| | | <ldap:object-class> |
| | | <ldap:name>ds-cfg-collation-matching-rule</ldap:name> |
| | | <ldap:superior>ds-cfg-matching-rule</ldap:superior> |
| | | </ldap:object-class> |
| | | </adm:profile> |
| | | <adm:property name="matching-rule-type" multi-valued="true" mandatory="true"> |
| | | <adm:synopsis> |
| | | the types of matching rules that should be supported for each locale |
| | | </adm:synopsis> |
| | | <adm:syntax> |
| | | <adm:enumeration> |
| | | <adm:value name="equality"> |
| | | <adm:synopsis> |
| | | Specifies if equality type collation matching rule needs to |
| | | be created for each locale. |
| | | </adm:synopsis> |
| | | </adm:value> |
| | | <adm:value name="less-than"> |
| | | <adm:synopsis> |
| | | Specifies if less-than type collation matching rule needs to |
| | | be created for each locale. |
| | | </adm:synopsis> |
| | | </adm:value> |
| | | <adm:value name="less-than-or-equal-to"> |
| | | <adm:synopsis> |
| | | Specifies if less-than-or-equal-to type collation matching rule |
| | | needs to be created for each locale. |
| | | </adm:synopsis> |
| | | </adm:value> |
| | | <adm:value name="greater-than"> |
| | | <adm:synopsis> |
| | | Specifies if greater-than type collation matching rule needs |
| | | to be created for each locale. |
| | | </adm:synopsis> |
| | | </adm:value> |
| | | <adm:value name="greater-than-or-equal-to"> |
| | | <adm:synopsis> |
| | | Specifies if greater-than-or-equal-to type collation matching rule |
| | | needs to be created for each locale. |
| | | </adm:synopsis> |
| | | </adm:value> |
| | | <adm:value name="substring"> |
| | | <adm:synopsis> |
| | | Specifies if substring type collation matching rule needs to be |
| | | created for each locale. |
| | | </adm:synopsis> |
| | | </adm:value> |
| | | </adm:enumeration> |
| | | </adm:syntax> |
| | | <adm:profile name="ldap"> |
| | | <ldap:attribute> |
| | | <ldap:name>ds-cfg-matching-rule-type</ldap:name> |
| | | </ldap:attribute> |
| | | </adm:profile> |
| | | </adm:property> |
| | | <adm:property name="collation" multi-valued="true" mandatory="true"> |
| | | <adm:synopsis> |
| | | the set of supported locales |
| | | </adm:synopsis> |
| | | <adm:description> |
| | | Collation must be specified using the syntax: LOCALE:OID |
| | | </adm:description> |
| | | <adm:syntax> |
| | | <adm:string> |
| | | <adm:pattern> |
| | | <adm:regex>^[a-z-A-Z]+:[0-9.]+\\d$</adm:regex> |
| | | <adm:usage>LOCALE:OID</adm:usage> |
| | | <adm:synopsis> |
| | | A Locale followed by a ":" and an OID. |
| | | </adm:synopsis> |
| | | </adm:pattern> |
| | | </adm:string> |
| | | </adm:syntax> |
| | | <adm:profile name="ldap"> |
| | | <ldap:attribute> |
| | | <ldap:name>ds-cfg-collation</ldap:name> |
| | | </ldap:attribute> |
| | | </adm:profile> |
| | | </adm:property> |
| | | <adm:property-override name="java-class" advanced="true"> |
| | | <adm:default-behavior> |
| | | <adm:defined> |
| | | <adm:value> |
| | | org.opends.server.schema.CollationMatchingRuleFactory |
| | | </adm:value> |
| | | </adm:defined> |
| | | </adm:default-behavior> |
| | | </adm:property-override> |
| | | </adm:managed-object> |
| | |
| | | ! Copyright 2007-2008 Sun Microsystems, Inc. |
| | | ! --> |
| | | <adm:managed-object name="matching-rule" plural-name="matching-rules" |
| | | package="org.opends.server.admin.std" abstract="true" |
| | | package="org.opends.server.admin.std" |
| | | xmlns:adm="http://www.opends.org/admin" |
| | | xmlns:ldap="http://www.opends.org/admin-ldap"> |
| | | <adm:synopsis> |
| | |
| | | <adm:syntax> |
| | | <adm:java-class> |
| | | <adm:instance-of> |
| | | org.opends.server.api.MatchingRule |
| | | org.opends.server.api.MatchingRuleFactory |
| | | </adm:instance-of> |
| | | </adm:java-class> |
| | | </adm:syntax> |
| | |
| | | %s is not a valid generalized time value because it represents an invalid \ |
| | | time (e.g., a date that does not exist): %s |
| | | NOTICE_SCHEMA_IMPORT_FAILED_279=A schema element could not be imported: %s, %s |
| | | MILD_WARN_ATTR_INVALID_COLLATION_MATCHING_RULE_LOCALE_280=The collation \ |
| | | rule %s under matching rule entry %s is invalid as the locale %s is not supported \ |
| | | by JVM |
| | | MILD_WARN_ATTR_INVALID_COLLATION_MATCHING_RULE_FORMAT_281=The provided \ |
| | | collation rule %s does not contain a valid format of OID:LOCALE |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.ApproximateMatchingRuleCfg; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | |
| | |
| | | mayExtend=true, |
| | | mayInvoke=false) |
| | | public abstract class ApproximateMatchingRule |
| | | extends MatchingRule<ApproximateMatchingRuleCfg> |
| | | extends MatchingRule |
| | | { |
| | | /** |
| | | * Indicates whether the two provided normalized values are |
| | |
| | | * {@code false} if not. |
| | | */ |
| | | public boolean isIndexed(AttributeType attributeType, |
| | | MatchingRule<?> matchingRule) |
| | | MatchingRule matchingRule) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | MatchingRule<?> matchingRule; |
| | | MatchingRule matchingRule; |
| | | String matchingRuleID = filter.getMatchingRuleID(); |
| | | if (matchingRuleID != null) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | mayInstantiate=false, |
| | | mayExtend=true, |
| | | mayInvoke=false) |
| | | public abstract class EqualityMatchingRule |
| | | extends MatchingRule<EqualityMatchingRuleCfg> |
| | | public abstract class EqualityMatchingRule extends MatchingRule |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines the set of methods and structures that must be |
| | | * implemented by a Directory Server module that implements an |
| | | * Extensible matching rule. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.VOLATILE, |
| | | mayInstantiate=false, |
| | | mayExtend=true, |
| | | mayInvoke=false) |
| | | public abstract class ExtensibleMatchingRule extends MatchingRule |
| | | { |
| | | |
| | | //TODO: Index Implementation. |
| | | |
| | | } |
| | |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import java.util.Collection; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | |
| | | |
| | |
| | | * This class defines the set of methods and structures that must be |
| | | * implemented by a Directory Server module that implements a matching |
| | | * rule. |
| | | * |
| | | * @param <T> The type of configuration handled by this matching |
| | | * rule. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.VOLATILE, |
| | | mayInstantiate=false, |
| | | mayExtend=true, |
| | | mayInvoke=false) |
| | | public abstract class MatchingRule<T extends MatchingRuleCfg> |
| | | public abstract class MatchingRule |
| | | { |
| | | /** |
| | | * Initializes this matching rule based on the information in the |
| | | * provided configuration entry. |
| | | * |
| | | * @param configuration The configuration to use to intialize this |
| | | * matching rule. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in |
| | | * the process of performing the |
| | | * initialization. |
| | | * |
| | | * @throws InitializationException If a problem that is not |
| | | * configuration-related occurs |
| | | * during initialization. |
| | | */ |
| | | public abstract void initializeMatchingRule(T configuration) |
| | | throws ConfigException, InitializationException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this matching rule. It should be possible to call this method on |
| | | * an uninitialized matching rule instance in order to determine |
| | | * whether the matching rule would be able to use the provided |
| | | * configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The matching rule configuration for |
| | | * which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this matching rule, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | MatchingRuleCfg configuration, |
| | | List<Message> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by matching rule |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be needed whenever this |
| | | * matching rule is taken out of service. |
| | | */ |
| | | public void finalizeMatchingRule() |
| | | { |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the common name for this matching rule. |
| | | * |
| | | * @return The common name for this matching rule, or {@code null} |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves all names for this matching rule. |
| | | * |
| | | * @return All names for this matching rule. |
| | | */ |
| | | public abstract Collection<String> getAllNames(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the OID for this matching rule. |
| | | * |
| | | * @return The OID for this matching rule. |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the normalized form of the provided assertion value, |
| | | * which is best suite for efficiently performing matching |
| | | * operations on that value. |
| | | * |
| | | * @param value The assertion value to be normalized. |
| | | * |
| | | * @return The normalized version of the provided value. |
| | | * |
| | | * @throws DirectoryException If the provided value is invalid |
| | | * according to the associated |
| | | * attribute syntax. |
| | | */ |
| | | public ByteString normalizeAssertionValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | // Default implementation is to use attribute value normalization. |
| | | return normalizeValue(value); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the name or OID for this matching rule. If it has a |
| | | * name, then it will be returned. Otherwise, the OID will be |
| | |
| | | buffer.append("( "); |
| | | buffer.append(getOID()); |
| | | buffer.append(" NAME '"); |
| | | buffer.append(getName()); |
| | | buffer.append(getName()); |
| | | |
| | | String description = getDescription(); |
| | | if ((description != null) && (description.length() > 0)) |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class defines the set of methods and structures that must be |
| | | * implemented by a Directory Server module that implements a matching |
| | | * rule factory. |
| | | * |
| | | * @param <T> The type of configuration handled by this matching |
| | | * rule. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.VOLATILE, |
| | | mayInstantiate=false, |
| | | mayExtend=true, |
| | | mayInvoke=false) |
| | | public abstract class MatchingRuleFactory<T extends MatchingRuleCfg> |
| | | { |
| | | |
| | | /** |
| | | * Initializes the matching rule(s) based on the information in the |
| | | * provided configuration entry. |
| | | * |
| | | * @param configuration The configuration to use to intialize this |
| | | * matching rule. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in |
| | | * the process of performing the |
| | | * initialization. |
| | | * |
| | | * @throws InitializationException If a problem that is not |
| | | * configuration-related occurs |
| | | * during initialization. |
| | | */ |
| | | public abstract void initializeMatchingRule(T configuration) |
| | | throws ConfigException, InitializationException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be needed whenever this |
| | | * matching rule factory is taken out of service. |
| | | */ |
| | | public void finalizeMatchingRule() |
| | | { |
| | | //No implementation is required by default. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the provided configuration is acceptable for |
| | | * this matching rule. It should be possible to call this method on |
| | | * an uninitialized matching rule instance in order to determine |
| | | * whether the matching rule would be able to use the provided |
| | | * configuration. |
| | | * <BR><BR> |
| | | * Note that implementations which use a subclass of the provided |
| | | * configuration class will likely need to cast the configuration |
| | | * to the appropriate subclass type. |
| | | * |
| | | * @param configuration The matching rule configuration for |
| | | * which to make the determination. |
| | | * @param unacceptableReasons A list that may be used to hold the |
| | | * reasons that the provided |
| | | * configuration is not acceptable. |
| | | * |
| | | * @return {@code true} if the provided configuration is acceptable |
| | | * for this matching rule, or {@code false} if not. |
| | | */ |
| | | public boolean isConfigurationAcceptable( |
| | | T configuration, |
| | | List<Message> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by matching rule |
| | | // implementations that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns an umodifiable view of Collection of associated |
| | | * MatchingRules. |
| | | * |
| | | * @return An unmodifiable view of Collection of |
| | | * MatchingRule instances. |
| | | */ |
| | | public abstract Collection<MatchingRule> getMatchingRules(); |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.util.Comparator; |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | |
| | |
| | | mayExtend=true, |
| | | mayInvoke=false) |
| | | public abstract class OrderingMatchingRule |
| | | extends MatchingRule<OrderingMatchingRuleCfg> |
| | | extends MatchingRule |
| | | implements Comparator<byte[]>, Serializable |
| | | { |
| | | /** |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.DirectoryException; |
| | |
| | | mayInstantiate=false, |
| | | mayExtend=true, |
| | | mayInvoke=false) |
| | | public abstract class SubstringMatchingRule |
| | | extends MatchingRule<SubstringMatchingRuleCfg> |
| | | public abstract class SubstringMatchingRule extends MatchingRule |
| | | { |
| | | /** |
| | | * Normalizes the provided value fragment into a form that can be |
| | |
| | | |
| | | |
| | | // Make sure that none of the associated matching rules are marked OBSOLETE. |
| | | MatchingRule<?> mr = attributeType.getEqualityMatchingRule(); |
| | | MatchingRule mr = attributeType.getEqualityMatchingRule(); |
| | | if ((mr != null) && mr.isObsolete()) |
| | | { |
| | | Message message = ERR_SCHEMA_MODIFY_ATTRTYPE_OBSOLETE_MR.get( |
| | |
| | | // matching rule. If there is, then it will only be acceptable if it's the |
| | | // matching rule use that we are replacing (in which case we really do want |
| | | // to use the "!=" operator). |
| | | MatchingRule<?> matchingRule = matchingRuleUse.getMatchingRule(); |
| | | MatchingRule matchingRule = matchingRuleUse.getMatchingRule(); |
| | | MatchingRuleUse existingMRUForRule = |
| | | schema.getMatchingRuleUse(matchingRule); |
| | | if ((existingMRUForRule != null) && (existingMRUForRule != existingMRU)) |
| | |
| | | import org.opends.server.monitors.ConnectionHandlerMonitor; |
| | | import org.opends.server.schema.AttributeTypeSyntax; |
| | | import org.opends.server.schema.BinarySyntax; |
| | | import org.opends.server.schema.BooleanEqualityMatchingRule; |
| | | import org.opends.server.schema.BooleanEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.BooleanSyntax; |
| | | import org.opends.server.schema.CaseExactEqualityMatchingRule; |
| | | import org.opends.server.schema.CaseExactIA5EqualityMatchingRule; |
| | | import org.opends.server.schema.CaseExactIA5SubstringMatchingRule; |
| | | import org.opends.server.schema.CaseExactOrderingMatchingRule; |
| | | import org.opends.server.schema.CaseExactSubstringMatchingRule; |
| | | import org.opends.server.schema.CaseIgnoreEqualityMatchingRule; |
| | | import org.opends.server.schema.CaseIgnoreIA5EqualityMatchingRule; |
| | | import org.opends.server.schema.CaseIgnoreIA5SubstringMatchingRule; |
| | | import org.opends.server.schema.CaseIgnoreOrderingMatchingRule; |
| | | import org.opends.server.schema.CaseIgnoreSubstringMatchingRule; |
| | | import org.opends.server.schema.CaseExactEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseExactIA5EqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseExactIA5SubstringMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseExactOrderingMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseExactSubstringMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseIgnoreEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseIgnoreIA5EqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseIgnoreIA5SubstringMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseIgnoreOrderingMatchingRuleFactory; |
| | | import org.opends.server.schema.CaseIgnoreSubstringMatchingRuleFactory; |
| | | import org.opends.server.schema.DirectoryStringSyntax; |
| | | import org.opends.server.schema.DistinguishedNameEqualityMatchingRule; |
| | | import org.opends.server.schema.DistinguishedNameEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.DistinguishedNameSyntax; |
| | | import org.opends.server.schema.DoubleMetaphoneApproximateMatchingRule; |
| | | import org.opends.server.schema.GeneralizedTimeEqualityMatchingRule; |
| | | import org.opends.server.schema.GeneralizedTimeOrderingMatchingRule; |
| | | import org.opends.server.schema.DoubleMetaphoneApproximateMatchingRuleFactory; |
| | | import org.opends.server.schema.GeneralizedTimeEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.GeneralizedTimeOrderingMatchingRuleFactory; |
| | | import org.opends.server.schema.GeneralizedTimeSyntax; |
| | | import org.opends.server.schema.IA5StringSyntax; |
| | | import org.opends.server.schema.IntegerEqualityMatchingRule; |
| | | import org.opends.server.schema.IntegerOrderingMatchingRule; |
| | | import org.opends.server.schema.IntegerEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.IntegerOrderingMatchingRuleFactory; |
| | | import org.opends.server.schema.IntegerSyntax; |
| | | import org.opends.server.schema.OIDSyntax; |
| | | import org.opends.server.schema.ObjectClassSyntax; |
| | | import org.opends.server.schema.ObjectIdentifierEqualityMatchingRule; |
| | | import org.opends.server.schema.OctetStringEqualityMatchingRule; |
| | | import org.opends.server.schema.OctetStringOrderingMatchingRule; |
| | | import org.opends.server.schema.OctetStringSubstringMatchingRule; |
| | | import org.opends.server.schema.ObjectIdentifierEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.OctetStringEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.OctetStringOrderingMatchingRuleFactory; |
| | | import org.opends.server.schema.OctetStringSubstringMatchingRuleFactory; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import org.opends.server.schema.TelephoneNumberEqualityMatchingRule; |
| | | import org.opends.server.schema.TelephoneNumberSubstringMatchingRule; |
| | | import org.opends.server.schema.TelephoneNumberEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.TelephoneNumberSubstringMatchingRuleFactory; |
| | | import org.opends.server.schema.TelephoneNumberSyntax; |
| | | import org.opends.server.tools.ConfigureWindowsService; |
| | | import org.opends.server.types.AbstractOperation; |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.CopyOnWriteArraySet; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | private void bootstrapMatchingRules() |
| | | { |
| | | MatchingRuleFactory<?>[] factories = |
| | | new MatchingRuleFactory<?>[] { |
| | | new DoubleMetaphoneApproximateMatchingRuleFactory(), |
| | | new BooleanEqualityMatchingRuleFactory(), |
| | | new CaseExactEqualityMatchingRuleFactory(), |
| | | new CaseExactIA5EqualityMatchingRuleFactory(), |
| | | new CaseIgnoreEqualityMatchingRuleFactory(), |
| | | new CaseIgnoreIA5EqualityMatchingRuleFactory(), |
| | | new DistinguishedNameEqualityMatchingRuleFactory(), |
| | | new GeneralizedTimeEqualityMatchingRuleFactory(), |
| | | new IntegerEqualityMatchingRuleFactory(), |
| | | new OctetStringEqualityMatchingRuleFactory(), |
| | | new ObjectIdentifierEqualityMatchingRuleFactory(), |
| | | new TelephoneNumberEqualityMatchingRuleFactory(), |
| | | new CaseExactOrderingMatchingRuleFactory(), |
| | | new CaseIgnoreOrderingMatchingRuleFactory(), |
| | | new GeneralizedTimeOrderingMatchingRuleFactory(), |
| | | new IntegerOrderingMatchingRuleFactory(), |
| | | new OctetStringOrderingMatchingRuleFactory(), |
| | | new CaseExactSubstringMatchingRuleFactory(), |
| | | new CaseExactIA5SubstringMatchingRuleFactory(), |
| | | new CaseIgnoreSubstringMatchingRuleFactory(), |
| | | new CaseIgnoreIA5SubstringMatchingRuleFactory(), |
| | | new OctetStringSubstringMatchingRuleFactory(), |
| | | new TelephoneNumberSubstringMatchingRuleFactory()}; |
| | | |
| | | MatchingRuleFactory<?> currentFactory = null; |
| | | try |
| | | { |
| | | ApproximateMatchingRule matchingRule = |
| | | new DoubleMetaphoneApproximateMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerApproximateMatchingRule(matchingRule, true); |
| | | for(MatchingRuleFactory<?> factory: factories) |
| | | { |
| | | currentFactory = factory; |
| | | currentFactory.initializeMatchingRule(null); |
| | | for(MatchingRule matchingRule: currentFactory.getMatchingRules()) |
| | | { |
| | | registerMatchingRule(matchingRule, true); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(DoubleMetaphoneApproximateMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = new BooleanEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(BooleanEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = new CaseExactEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseExactEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = |
| | | new CaseExactIA5EqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseExactIA5EqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = new CaseIgnoreEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseIgnoreEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = |
| | | new CaseIgnoreIA5EqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseIgnoreIA5EqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = |
| | | new DistinguishedNameEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(DistinguishedNameEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = |
| | | new GeneralizedTimeEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(GeneralizedTimeEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = new IntegerEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(IntegerEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = new OctetStringEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(OctetStringEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = |
| | | new ObjectIdentifierEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(ObjectIdentifierEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | EqualityMatchingRule matchingRule = |
| | | new TelephoneNumberEqualityMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerEqualityMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(TelephoneNumberEqualityMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | OrderingMatchingRule matchingRule = new CaseExactOrderingMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerOrderingMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseExactOrderingMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | OrderingMatchingRule matchingRule = new CaseIgnoreOrderingMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerOrderingMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseIgnoreOrderingMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | OrderingMatchingRule matchingRule = |
| | | new GeneralizedTimeOrderingMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerOrderingMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(GeneralizedTimeOrderingMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | OrderingMatchingRule matchingRule = new IntegerOrderingMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerOrderingMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(IntegerOrderingMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | OrderingMatchingRule matchingRule = new OctetStringOrderingMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerOrderingMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(OctetStringOrderingMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | SubstringMatchingRule matchingRule = new CaseExactSubstringMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerSubstringMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseExactSubstringMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | SubstringMatchingRule matchingRule = |
| | | new CaseExactIA5SubstringMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerSubstringMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseExactIA5SubstringMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | SubstringMatchingRule matchingRule = |
| | | new CaseIgnoreSubstringMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerSubstringMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseIgnoreSubstringMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | SubstringMatchingRule matchingRule = |
| | | new CaseIgnoreIA5SubstringMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerSubstringMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(CaseIgnoreIA5SubstringMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | SubstringMatchingRule matchingRule = |
| | | new OctetStringSubstringMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerSubstringMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(OctetStringSubstringMatchingRule.class.getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | try |
| | | { |
| | | SubstringMatchingRule matchingRule = |
| | | new TelephoneNumberSubstringMatchingRule(); |
| | | matchingRule.initializeMatchingRule(null); |
| | | registerSubstringMatchingRule(matchingRule, true); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | Message message = ERR_CANNOT_BOOTSTRAP_MATCHING_RULE. |
| | | get(TelephoneNumberSubstringMatchingRule.class.getName(), |
| | | get(currentFactory.getClass().getName(), |
| | | stackTraceToSingleLineString(e)); |
| | | logError(message); |
| | | } |
| | |
| | | import org.opends.server.admin.server.ConfigurationAddListener; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.server.ConfigurationDeleteListener; |
| | | import org.opends.server.admin.std.meta.ApproximateMatchingRuleCfgDefn; |
| | | import org.opends.server.admin.std.meta.EqualityMatchingRuleCfgDefn; |
| | | import org.opends.server.admin.std.meta.OrderingMatchingRuleCfgDefn; |
| | | import org.opends.server.admin.std.meta.SubstringMatchingRuleCfgDefn; |
| | | import org.opends.server.admin.std.server.ApproximateMatchingRuleCfg; |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.admin.std.server.RootCfg; |
| | | import org.opends.server.admin.server.ServerManagementContext; |
| | | import org.opends.server.admin.std.meta.MatchingRuleCfgDefn; |
| | | import org.opends.server.api.ApproximateMatchingRule; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | |
| | | |
| | | { |
| | | // A mapping between the DNs of the config entries and the associated matching |
| | | // rules. |
| | | private ConcurrentHashMap<DN,MatchingRule> matchingRules; |
| | | // rule Factories. |
| | | private ConcurrentHashMap<DN,MatchingRuleFactory> matchingRuleFactories; |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | public MatchingRuleConfigManager() |
| | | { |
| | | matchingRules = new ConcurrentHashMap<DN,MatchingRule>(); |
| | | matchingRuleFactories = new ConcurrentHashMap<DN,MatchingRuleFactory>(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Initializes all matching rules currently defined in the Directory Server |
| | | * configuration. This should only be called at Directory Server startup. |
| | | * Initializes all matching rules after reading all the Matching Rule |
| | | * factories currently defined in the Directory Server configuration. |
| | | * This should only be called at Directory Server startup. |
| | | * |
| | | * @throws ConfigException If a configuration problem causes the matching |
| | | * rule initialization process to fail. |
| | |
| | | String className = mrConfiguration.getJavaClass(); |
| | | try |
| | | { |
| | | MatchingRule matchingRule = |
| | | loadMatchingRule(className, mrConfiguration, true); |
| | | MatchingRuleFactory<?> factory = |
| | | loadMatchingRuleFactory(className, mrConfiguration, true); |
| | | |
| | | try |
| | | { |
| | | DirectoryServer.registerMatchingRule(matchingRule, false); |
| | | matchingRules.put(mrConfiguration.dn(), matchingRule); |
| | | for(MatchingRule matchingRule: factory.getMatchingRules()) |
| | | { |
| | | DirectoryServer.registerMatchingRule(matchingRule, false); |
| | | } |
| | | matchingRuleFactories.put(mrConfiguration.dn(), factory); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | |
| | | if (configuration.isEnabled()) |
| | | { |
| | | // Get the name of the class and make sure we can instantiate it as a |
| | | // matching rule. |
| | | // matching rule Factory. |
| | | String className = configuration.getJavaClass(); |
| | | try |
| | | { |
| | | loadMatchingRule(className, configuration, false); |
| | | loadMatchingRuleFactory(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | |
| | | MatchingRule matchingRule = null; |
| | | MatchingRuleFactory<?> factory = null; |
| | | |
| | | // Get the name of the class and make sure we can instantiate it as a |
| | | // matching rule. |
| | | // matching rule Factory. |
| | | String className = configuration.getJavaClass(); |
| | | try |
| | | { |
| | | matchingRule = loadMatchingRule(className, configuration, true); |
| | | factory = loadMatchingRuleFactory(className, configuration, true); |
| | | |
| | | try |
| | | { |
| | | DirectoryServer.registerMatchingRule(matchingRule, false); |
| | | matchingRules.put(configuration.dn(), matchingRule); |
| | | for(MatchingRule matchingRule: factory.getMatchingRules()) |
| | | { |
| | | DirectoryServer.registerMatchingRule(matchingRule, false); |
| | | } |
| | | matchingRuleFactories.put(configuration.dn(),factory); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | |
| | | // defined attribute types or matching rule uses that use the matching rule. |
| | | // If so, then don't allow it to be deleted. |
| | | boolean configAcceptable = true; |
| | | MatchingRule matchingRule = matchingRules.get(configuration.dn()); |
| | | if (matchingRule != null) |
| | | MatchingRuleFactory<?> factory = |
| | | matchingRuleFactories.get(configuration.dn()); |
| | | for(MatchingRule matchingRule: factory.getMatchingRules()) |
| | | { |
| | | String oid = matchingRule.getOID(); |
| | | for (AttributeType at : DirectoryServer.getAttributeTypes().values()) |
| | | if (matchingRule != null) |
| | | { |
| | | ApproximateMatchingRule amr = at.getApproximateMatchingRule(); |
| | | if ((amr != null) && oid.equals(amr.getOID())) |
| | | String oid = matchingRule.getOID(); |
| | | for (AttributeType at : DirectoryServer.getAttributeTypes().values()) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | ApproximateMatchingRule amr = at.getApproximateMatchingRule(); |
| | | if ((amr != null) && oid.equals(amr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | EqualityMatchingRule emr = at.getEqualityMatchingRule(); |
| | | if ((emr != null) && oid.equals(emr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | OrderingMatchingRule omr = at.getOrderingMatchingRule(); |
| | | if ((omr != null) && oid.equals(omr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | SubstringMatchingRule smr = at.getSubstringMatchingRule(); |
| | | if ((smr != null) && oid.equals(smr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | EqualityMatchingRule emr = at.getEqualityMatchingRule(); |
| | | if ((emr != null) && oid.equals(emr.getOID())) |
| | | for (MatchingRuleUse mru : |
| | | DirectoryServer.getMatchingRuleUses().values()) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | if (oid.equals(mru.getMatchingRule().getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_MRU.get( |
| | | matchingRule.getName(), |
| | | mru.getName()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | OrderingMatchingRule omr = at.getOrderingMatchingRule(); |
| | | if ((omr != null) && oid.equals(omr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | SubstringMatchingRule smr = at.getSubstringMatchingRule(); |
| | | if ((smr != null) && oid.equals(smr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | for (MatchingRuleUse mru : DirectoryServer.getMatchingRuleUses().values()) |
| | | { |
| | | if (oid.equals(mru.getMatchingRule().getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DELETE_MR_IN_USE_BY_MRU.get( |
| | | matchingRule.getName(), |
| | | mru.getName()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | boolean adminActionRequired = false; |
| | | ArrayList<Message> messages = new ArrayList<Message>(); |
| | | |
| | | MatchingRule matchingRule = matchingRules.remove(configuration.dn()); |
| | | if (matchingRule != null) |
| | | MatchingRuleFactory<?> factory = |
| | | matchingRuleFactories.remove(configuration.dn()); |
| | | if (factory != null) |
| | | { |
| | | DirectoryServer.deregisterMatchingRule(matchingRule); |
| | | matchingRule.finalizeMatchingRule(); |
| | | for(MatchingRule matchingRule: factory.getMatchingRules()) |
| | | { |
| | | DirectoryServer.deregisterMatchingRule(matchingRule); |
| | | } |
| | | factory.finalizeMatchingRule(); |
| | | } |
| | | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | |
| | | if (configuration.isEnabled()) |
| | | { |
| | | // Get the name of the class and make sure we can instantiate it as a |
| | | // matching rule. |
| | | // matching rule Factory. |
| | | String className = configuration.getJavaClass(); |
| | | try |
| | | { |
| | | loadMatchingRule(className, configuration, false); |
| | | loadMatchingRuleFactory(className, configuration, false); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | { |
| | | // If the matching rule is currently enabled and the change would make it |
| | | // disabled, then only allow it if the matching rule isn't already in use. |
| | | MatchingRule matchingRule = matchingRules.get(configuration.dn()); |
| | | if (matchingRule != null) |
| | | MatchingRuleFactory<?> factory = |
| | | matchingRuleFactories.get(configuration.dn()); |
| | | if(factory == null) |
| | | { |
| | | String oid = matchingRule.getOID(); |
| | | for (AttributeType at : DirectoryServer.getAttributeTypes().values()) |
| | | //Factory was disabled again. |
| | | return configAcceptable; |
| | | } |
| | | for(MatchingRule matchingRule: factory.getMatchingRules()) |
| | | { |
| | | if (matchingRule != null) |
| | | { |
| | | ApproximateMatchingRule amr = at.getApproximateMatchingRule(); |
| | | if ((amr != null) && oid.equals(amr.getOID())) |
| | | String oid = matchingRule.getOID(); |
| | | for (AttributeType at : DirectoryServer.getAttributeTypes().values()) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | ApproximateMatchingRule amr = at.getApproximateMatchingRule(); |
| | | if ((amr != null) && oid.equals(amr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | EqualityMatchingRule emr = at.getEqualityMatchingRule(); |
| | | if ((emr != null) && oid.equals(emr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | OrderingMatchingRule omr = at.getOrderingMatchingRule(); |
| | | if ((omr != null) && oid.equals(omr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | SubstringMatchingRule smr = at.getSubstringMatchingRule(); |
| | | if ((smr != null) && oid.equals(smr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT |
| | | .get(matchingRule.getName(), at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | EqualityMatchingRule emr = at.getEqualityMatchingRule(); |
| | | if ((emr != null) && oid.equals(emr.getOID())) |
| | | for (MatchingRuleUse mru : |
| | | DirectoryServer.getMatchingRuleUses().values()) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | if (oid.equals(mru.getMatchingRule().getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_MRU.get( |
| | | matchingRule.getName(), mru.getName()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | OrderingMatchingRule omr = at.getOrderingMatchingRule(); |
| | | if ((omr != null) && oid.equals(omr.getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT.get( |
| | | matchingRule.getName(), |
| | | at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | |
| | | SubstringMatchingRule smr = at.getSubstringMatchingRule(); |
| | | if ((smr != null) && oid.equals(smr.getOID())) |
| | | { |
| | | Message message = WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_AT |
| | | .get(matchingRule.getName(), at.getNameOrOID()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | } |
| | | |
| | | for (MatchingRuleUse mru : |
| | | DirectoryServer.getMatchingRuleUses().values()) |
| | | { |
| | | if (oid.equals(mru.getMatchingRule().getOID())) |
| | | { |
| | | Message message = |
| | | WARN_CONFIG_SCHEMA_CANNOT_DISABLE_MR_IN_USE_BY_MRU.get( |
| | | matchingRule.getName(), mru.getName()); |
| | | unacceptableReasons.add(message); |
| | | |
| | | configAcceptable = false; |
| | | continue; |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return configAcceptable; |
| | | } |
| | | |
| | |
| | | ArrayList<Message> messages = new ArrayList<Message>(); |
| | | |
| | | |
| | | // Get the existing matching rule if it's already enabled. |
| | | MatchingRule existingRule = matchingRules.get(configuration.dn()); |
| | | // Get the existing matching rule factory if it's already enabled. |
| | | MatchingRuleFactory<?> existingFactory = |
| | | matchingRuleFactories.get(configuration.dn()); |
| | | |
| | | |
| | | // If the new configuration has the matching rule disabled, then disable it |
| | | // if it is enabled, or do nothing if it's already disabled. |
| | | if (! configuration.isEnabled()) |
| | | { |
| | | if (existingRule != null) |
| | | if (existingFactory != null) |
| | | { |
| | | DirectoryServer.deregisterMatchingRule(existingRule); |
| | | |
| | | MatchingRule rule = matchingRules.remove(configuration.dn()); |
| | | if (rule != null) |
| | | for(MatchingRule existingRule: existingFactory.getMatchingRules()) |
| | | { |
| | | rule.finalizeMatchingRule(); |
| | | DirectoryServer.deregisterMatchingRule(existingRule); |
| | | } |
| | | matchingRuleFactories.remove(configuration.dn()); |
| | | existingFactory.finalizeMatchingRule(); |
| | | } |
| | | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | |
| | |
| | | // is required. If the matching rule is disabled, then instantiate the |
| | | // class and initialize and register it as a matching rule. |
| | | String className = configuration.getJavaClass(); |
| | | if (existingRule != null) |
| | | if (existingFactory != null) |
| | | { |
| | | if (! className.equals(existingRule.getClass().getName())) |
| | | if (! className.equals(existingFactory.getClass().getName())) |
| | | { |
| | | adminActionRequired = true; |
| | | } |
| | |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | |
| | | MatchingRule matchingRule = null; |
| | | MatchingRuleFactory<?> factory = null; |
| | | try |
| | | { |
| | | matchingRule = loadMatchingRule(className, configuration, true); |
| | | factory = loadMatchingRuleFactory(className, configuration, true); |
| | | |
| | | try |
| | | { |
| | | DirectoryServer.registerMatchingRule(matchingRule, false); |
| | | matchingRules.put(configuration.dn(), matchingRule); |
| | | for(MatchingRule matchingRule: factory.getMatchingRules()) |
| | | { |
| | | DirectoryServer.registerMatchingRule(matchingRule, false); |
| | | } |
| | | matchingRuleFactories.put(configuration.dn(), factory); |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | |
| | | * @throws InitializationException If a problem occurred while attempting to |
| | | * initialize the attribute syntax. |
| | | */ |
| | | private MatchingRule loadMatchingRule(String className, |
| | | private MatchingRuleFactory loadMatchingRuleFactory(String className, |
| | | MatchingRuleCfg configuration, |
| | | boolean initialize) |
| | | throws InitializationException |
| | | { |
| | | try |
| | | { |
| | | MatchingRule matchingRule = null; |
| | | if (configuration instanceof ApproximateMatchingRuleCfg) |
| | | { |
| | | ApproximateMatchingRuleCfgDefn definition = |
| | | ApproximateMatchingRuleCfgDefn.getInstance(); |
| | | ClassPropertyDefinition propertyDefinition = |
| | | definition.getJavaClassPropertyDefinition(); |
| | | Class<? extends ApproximateMatchingRule> approximateMatchingRuleClass = |
| | | propertyDefinition.loadClass(className, |
| | | ApproximateMatchingRule.class); |
| | | matchingRule = approximateMatchingRuleClass.newInstance(); |
| | | } |
| | | else if (configuration instanceof EqualityMatchingRuleCfg) |
| | | { |
| | | EqualityMatchingRuleCfgDefn definition = |
| | | EqualityMatchingRuleCfgDefn.getInstance(); |
| | | ClassPropertyDefinition propertyDefinition = |
| | | definition.getJavaClassPropertyDefinition(); |
| | | Class<? extends EqualityMatchingRule> equalityMatchingRuleClass = |
| | | propertyDefinition.loadClass(className, |
| | | EqualityMatchingRule.class); |
| | | matchingRule = equalityMatchingRuleClass.newInstance(); |
| | | } |
| | | else if (configuration instanceof OrderingMatchingRuleCfg) |
| | | { |
| | | OrderingMatchingRuleCfgDefn definition = |
| | | OrderingMatchingRuleCfgDefn.getInstance(); |
| | | ClassPropertyDefinition propertyDefinition = |
| | | definition.getJavaClassPropertyDefinition(); |
| | | Class<? extends OrderingMatchingRule> orderingMatchingRuleClass = |
| | | propertyDefinition.loadClass(className, |
| | | OrderingMatchingRule.class); |
| | | matchingRule = orderingMatchingRuleClass.newInstance(); |
| | | } |
| | | else if (configuration instanceof SubstringMatchingRuleCfg) |
| | | { |
| | | SubstringMatchingRuleCfgDefn definition = |
| | | SubstringMatchingRuleCfgDefn.getInstance(); |
| | | ClassPropertyDefinition propertyDefinition = |
| | | definition.getJavaClassPropertyDefinition(); |
| | | Class<? extends SubstringMatchingRule> substringMatchingRuleClass = |
| | | propertyDefinition.loadClass(className, |
| | | SubstringMatchingRule.class); |
| | | matchingRule = substringMatchingRuleClass.newInstance(); |
| | | } |
| | | else |
| | | { |
| | | throw new AssertionError("Unsupported matching rule type: " + |
| | | className + " with config type " + |
| | | configuration.getClass().getName()); |
| | | } |
| | | MatchingRuleFactory factory = null; |
| | | MatchingRuleCfgDefn definition = |
| | | MatchingRuleCfgDefn.getInstance(); |
| | | ClassPropertyDefinition propertyDefinition = |
| | | definition.getJavaClassPropertyDefinition(); |
| | | Class<? extends MatchingRuleFactory> matchingRuleFactoryClass = |
| | | propertyDefinition.loadClass(className, |
| | | MatchingRuleFactory.class); |
| | | factory = matchingRuleFactoryClass.newInstance(); |
| | | |
| | | if (initialize) |
| | | { |
| | | Method method = matchingRule.getClass().getMethod( |
| | | Method method = factory.getClass().getMethod( |
| | | "initializeMatchingRule", configuration.configurationClass()); |
| | | method.invoke(matchingRule, configuration); |
| | | method.invoke(factory, configuration); |
| | | } |
| | | else |
| | | { |
| | | Method method = |
| | | matchingRule.getClass().getMethod("isConfigurationAcceptable", |
| | | factory.getClass().getMethod("isConfigurationAcceptable", |
| | | MatchingRuleCfg.class, |
| | | List.class); |
| | | |
| | | List<Message> unacceptableReasons = new ArrayList<Message>(); |
| | | Boolean acceptable = (Boolean) method.invoke(matchingRule, |
| | | configuration, |
| | | unacceptableReasons); |
| | | Boolean acceptable = (Boolean) method.invoke(factory, |
| | | configuration, |
| | | unacceptableReasons); |
| | | if (! acceptable) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | |
| | | } |
| | | } |
| | | |
| | | return matchingRule; |
| | | return factory; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | MatchingRule<?> mr = |
| | | MatchingRule mr = |
| | | DirectoryServer.getMatchingRule(toLowerCase(matchingRuleID)); |
| | | if (mr == null) |
| | | { |
| | |
| | | */ |
| | | package org.opends.server.replication.plugin; |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | return token1[1].compareTo(token2[1]); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No implementation needed here. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Get the name of this class. |
| | | * @return name of the class in String form |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.replication.plugin; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link HistoricalCsnOrderingMatchingRule}. |
| | | */ |
| | | public final class HistoricalCsnOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new HistoricalCsnOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.api.PasswordStorageScheme; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | |
| | | * This class implements the authPasswordMatch matching rule defined in RFC |
| | | * 3112. |
| | | */ |
| | | public class AuthPasswordEqualityMatchingRule |
| | | class AuthPasswordEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link AuthPasswordEqualityMatchingRule}. |
| | | */ |
| | | public final class AuthPasswordEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new AuthPasswordEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | |
| | | |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | * This class implements the authPasswordExactMatch matching rule defined in RFC |
| | | * 3112. |
| | | */ |
| | | public class AuthPasswordExactEqualityMatchingRule |
| | | class AuthPasswordExactEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link AuthPasswordExactEqualityMatchingRule}. |
| | | */ |
| | | public final class AuthPasswordExactEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new AuthPasswordExactEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | * This class defines the bitStringMatch matching rule defined in X.520 and |
| | | * referenced in RFC 2252. |
| | | */ |
| | | public class BitStringEqualityMatchingRule |
| | | class BitStringEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link BitStringEqualityMatchingRule}. |
| | | */ |
| | | public final class BitStringEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new BitStringEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This class defines the booleanMatch matching rule defined in X.520 and |
| | | * referenced in RFC 4519. |
| | | */ |
| | | public class BooleanEqualityMatchingRule |
| | | class BooleanEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link BooleanEqualityMatchingRule}. |
| | | */ |
| | | public final class BooleanEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new BooleanEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | |
| | |
| | | * This class defines the caseExactMatch matching rule defined in X.520 and |
| | | * referenced in RFC 4519. |
| | | */ |
| | | public class CaseExactEqualityMatchingRule |
| | | class CaseExactEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public String getName() |
| | | { |
| | | // No initialization is required. |
| | | return EMR_CASE_EXACT_NAME; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the common name for this matching rule. |
| | | * |
| | | * @return The common name for this matching rule, or <CODE>null</CODE> if |
| | | * it does not have a name. |
| | | * {@inheritDoc} |
| | | */ |
| | | public String getName() |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return EMR_CASE_EXACT_NAME; |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link CaseExactEqualityMatchingRule}. |
| | | */ |
| | | public final class CaseExactEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseExactEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This class implements the caseExactIA5Match matching rule defined in RFC |
| | | * 2252. |
| | | */ |
| | | public class CaseExactIA5EqualityMatchingRule |
| | | class CaseExactIA5EqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | // No initialization is required. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the common name for this matching rule. |
| | | * |
| | | * @return The common name for this matching rule, or <CODE>null</CODE> if |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the OID for this matching rule. |
| | | * |
| | | * @return The OID for this matching rule. |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseExactIA5EqualityMatchingRule}. |
| | | */ |
| | | public final class CaseExactIA5EqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseExactIA5EqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | * directory vendors do provide an implementation using an OID from their own |
| | | * private namespace. |
| | | */ |
| | | public class CaseExactIA5SubstringMatchingRule |
| | | class CaseExactIA5SubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseExactIA5SubstringMatchingRule}. |
| | | */ |
| | | public final class CaseExactIA5SubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseExactIA5SubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | |
| | | * This class defines the caseExactOrderingMatch matching rule defined in X.520 |
| | | * and referenced in RFC 4519. |
| | | */ |
| | | public class CaseExactOrderingMatchingRule |
| | | class CaseExactOrderingMatchingRule |
| | | extends OrderingMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseExactOrderingMatchingRule}. |
| | | */ |
| | | public final class CaseExactOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseExactOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | |
| | |
| | | * This class defines the caseExactSubstringsMatch matching rule defined in |
| | | * X.520 and referenced in RFC 2252. |
| | | */ |
| | | public class CaseExactSubstringMatchingRule |
| | | class CaseExactSubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseExactSubstringMatchingRule}. |
| | | */ |
| | | public final class CaseExactSubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseExactSubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseIgnoreEqualityMatchingRule}. |
| | | */ |
| | | public final class CaseIgnoreEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseIgnoreEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This class implements the caseIgnoreIA5Match matching rule defined in RFC |
| | | * 2252. |
| | | */ |
| | | public class CaseIgnoreIA5EqualityMatchingRule |
| | | class CaseIgnoreIA5EqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseIgnoreIA5EqualityMatchingRule}. |
| | | */ |
| | | public final class CaseIgnoreIA5EqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated MatchingRule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseIgnoreIA5EqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This class implements the caseIgnoreIA5SubstringsMatch matching rule defined |
| | | * in RFC 2252. |
| | | */ |
| | | public class CaseIgnoreIA5SubstringMatchingRule |
| | | class CaseIgnoreIA5SubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseIgnoreIA5SubstringMatchingRule}. |
| | | */ |
| | | public final class CaseIgnoreIA5SubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseIgnoreIA5SubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * This class implements the caseIgnoreListMatch matching rule defined in X.520 |
| | | * and referenced in RFC 2252. |
| | | */ |
| | | public class CaseIgnoreListEqualityMatchingRule |
| | | class CaseIgnoreListEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseIgnoreListEqualityMatchingRule}. |
| | | */ |
| | | public final class CaseIgnoreListEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseIgnoreListEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * This class implements the caseIgnoreListSubstringsMatch matching rule defined |
| | | * in X.520 and referenced in RFC 2252. |
| | | */ |
| | | public class CaseIgnoreListSubstringMatchingRule |
| | | class CaseIgnoreListSubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseIgnoreSubstringMatchingRule}. |
| | | */ |
| | | public final class CaseIgnoreListSubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseIgnoreListSubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link CaseIgnoreOrderingMatchingRule}. |
| | | */ |
| | | public final class CaseIgnoreOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseIgnoreOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * This class defines the caseIgnoreSubstringsMatch matching rule defined in |
| | | * X.520 and referenced in RFC 2252. |
| | | */ |
| | | public class CaseIgnoreSubstringMatchingRule |
| | | class CaseIgnoreSubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link CaseIgnoreSubstringMatchingRule}. |
| | | */ |
| | | public final class CaseIgnoreSubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new CaseIgnoreSubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.text.CollationKey; |
| | | import java.text.Collator; |
| | | import java.nio.CharBuffer; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.SortedSet; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.meta.CollationMatchingRuleCfgDefn. |
| | | MatchingRuleType; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.CollationMatchingRuleCfg; |
| | | import org.opends.server.api.ExtensibleMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import org.opends.server.types.ResultCode; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | import static org.opends.messages.SchemaMessages.*; |
| | | import static org.opends.messages.CoreMessages.*; |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class is a factory class for Collation matching rules. It creates |
| | | * different matching rules based on the configuration entries. |
| | | */ |
| | | public final class CollationMatchingRuleFactory |
| | | extends MatchingRuleFactory<CollationMatchingRuleCfg> |
| | | implements ConfigurationChangeListener<CollationMatchingRuleCfg> |
| | | { |
| | | |
| | | //Whether equality matching rules are enabled. |
| | | private boolean equalityMatchingRuleType; |
| | | |
| | | //Whether less-than matching rules are enabled. |
| | | private boolean lessThanMatchingRuleType; |
| | | |
| | | //Whether less-than-equal-to matching rules are enabled. |
| | | private boolean lessThanEqualToMatchingRuleType; |
| | | |
| | | //Whether less-than-equal-to matching rules are enabled. |
| | | private boolean greaterThanMatchingRuleType; |
| | | |
| | | //Whether greater-than matching rules are enabled. |
| | | private boolean greaterThanEqualToMatchingRuleType; |
| | | |
| | | //Whether greater-than-equal-to matching rules are enabled. |
| | | private boolean substringMatchingRuleType; |
| | | |
| | | //Stores the list of available locales on this JVM. |
| | | private static final Set<Locale> supportedLocales; |
| | | |
| | | //Current Configuration. |
| | | private CollationMatchingRuleCfg currentConfig; |
| | | |
| | | //Map of OID and the Matching Rule. |
| | | private final Map<String, MatchingRule> matchingRules; |
| | | |
| | | |
| | | static |
| | | { |
| | | supportedLocales = new HashSet<Locale>(); |
| | | for(Locale l:Locale.getAvailableLocales()) |
| | | { |
| | | supportedLocales.add(l); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Creates a new instance of CollationMatchingRuleFactory. |
| | | */ |
| | | public CollationMatchingRuleFactory() |
| | | { |
| | | //Initialize the matchingRules. |
| | | matchingRules = new HashMap<String,MatchingRule>(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.unmodifiableCollection(matchingRules.values()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Adds a new mapping of OID and MatchingRule. |
| | | * |
| | | * @param oid OID of the matching rule |
| | | * @param matchingRule instance of a MatchingRule. |
| | | */ |
| | | private final void addMatchingRule(String oid, |
| | | MatchingRule matchingRule) |
| | | { |
| | | matchingRules.put(oid, matchingRule); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the Matching rule for the specified OID. |
| | | * |
| | | * @param oid OID of the matching rule to be searched. |
| | | * @return MatchingRule corresponding to an OID. |
| | | */ |
| | | private final MatchingRule getMatchingRule(String oid) |
| | | { |
| | | return matchingRules.get(oid); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Clears the Map containing matching Rules. |
| | | */ |
| | | private void resetRules() |
| | | { |
| | | matchingRules.clear(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Reads the configuration and initializes matching rule types. |
| | | * |
| | | * @param ruleTypes The Set containing allowed matching rule types. |
| | | */ |
| | | private void initializeMatchingRuleTypes(SortedSet<MatchingRuleType> |
| | | ruleTypes) |
| | | { |
| | | for(MatchingRuleType type:ruleTypes) |
| | | { |
| | | switch(type) |
| | | { |
| | | case EQUALITY: |
| | | equalityMatchingRuleType = true; |
| | | break; |
| | | case LESS_THAN: |
| | | lessThanMatchingRuleType = true; |
| | | break; |
| | | case LESS_THAN_OR_EQUAL_TO: |
| | | lessThanEqualToMatchingRuleType = true; |
| | | break; |
| | | case GREATER_THAN: |
| | | greaterThanMatchingRuleType = true; |
| | | break; |
| | | case GREATER_THAN_OR_EQUAL_TO: |
| | | greaterThanEqualToMatchingRuleType = true; |
| | | break; |
| | | case SUBSTRING: |
| | | substringMatchingRuleType = true; |
| | | break; |
| | | default: |
| | | //No default values allowed. |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new Collator instance. |
| | | * |
| | | * @param locale Locale for the collator |
| | | * @return Returns a new Collator instance |
| | | */ |
| | | private Collator createCollator(Locale locale) |
| | | { |
| | | Collator collator = Collator.getInstance(locale); |
| | | collator.setStrength(Collator.PRIMARY); |
| | | collator.setDecomposition(Collator.FULL_DECOMPOSITION); |
| | | return collator; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void initializeMatchingRule(CollationMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | initializeMatchingRuleTypes(configuration.getMatchingRuleType()); |
| | | for(String collation:configuration.getCollation()) |
| | | { |
| | | CollationMapper mapper = new CollationMapper(collation); |
| | | |
| | | String nOID = mapper.getNumericOID(); |
| | | String languageTag = mapper.getLanguageTag(); |
| | | if(nOID==null || languageTag==null) |
| | | { |
| | | Message msg = |
| | | WARN_ATTR_INVALID_COLLATION_MATCHING_RULE_FORMAT. |
| | | get(collation); |
| | | logError(msg); |
| | | continue; |
| | | } |
| | | |
| | | Locale locale = getLocale(languageTag); |
| | | if(locale!=null) |
| | | { |
| | | createLessThanMatchingRule(mapper,locale); |
| | | createLessThanOrEqualToMatchingRule(mapper,locale); |
| | | createEqualityMatchingRule(mapper,locale); |
| | | createGreaterThanOrEqualToMatchingRule(mapper,locale); |
| | | createGreaterThanMatchingRule(mapper,locale); |
| | | createSubstringMatchingRule(mapper,locale); |
| | | } |
| | | else |
| | | { |
| | | //This locale is not supported by JVM. |
| | | Message msg = |
| | | WARN_ATTR_INVALID_COLLATION_MATCHING_RULE_LOCALE. |
| | | get(collation,configuration.dn().toNormalizedString(), |
| | | languageTag); |
| | | |
| | | logError(msg); |
| | | } |
| | | } |
| | | //Save this configuration. |
| | | currentConfig = configuration; |
| | | //Register for change events. |
| | | currentConfig.addCollationChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void finalizeMatchingRule() |
| | | { |
| | | //De-register the listener. |
| | | currentConfig.removeCollationChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | CollationMatchingRuleCfg configuration) |
| | | { |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<Message> messages = new ArrayList<Message>(); |
| | | |
| | | if(!configuration.isEnabled() || |
| | | currentConfig.isEnabled()!=configuration.isEnabled()) |
| | | { |
| | | //Don't do anything if: |
| | | // 1. The configuration is disabled. |
| | | // 2. There is a change in the enable status |
| | | // i.e. (disable->enable or enable->disable). In this case, the |
| | | // ConfigManager will have already created the new Factory object. |
| | | return new ConfigChangeResult(resultCode, |
| | | adminActionRequired, messages); |
| | | } |
| | | |
| | | //Since we have come here it means that this Factory is enabled and |
| | | //there is a change in the CollationMatchingRuleFactory's configuration. |
| | | // Deregister all the Matching Rule corresponding to this factory.. |
| | | for(MatchingRule rule: getMatchingRules()) |
| | | { |
| | | DirectoryServer.deregisterMatchingRule(rule); |
| | | } |
| | | //Clear the associated matching rules. |
| | | resetRules(); |
| | | |
| | | initializeMatchingRuleTypes(configuration.getMatchingRuleType()); |
| | | for(String collation:configuration.getCollation()) |
| | | { |
| | | CollationMapper mapper = new CollationMapper(collation); |
| | | String nOID = mapper.getNumericOID(); |
| | | String languageTag = mapper.getLanguageTag(); |
| | | Locale locale = getLocale(languageTag); |
| | | createLessThanMatchingRule(mapper,locale); |
| | | createLessThanOrEqualToMatchingRule(mapper,locale); |
| | | createEqualityMatchingRule(mapper,locale); |
| | | createGreaterThanOrEqualToMatchingRule(mapper,locale); |
| | | createGreaterThanMatchingRule(mapper,locale); |
| | | createSubstringMatchingRule(mapper,locale); |
| | | } |
| | | |
| | | try |
| | | { |
| | | for(MatchingRule matchingRule: getMatchingRules()) |
| | | { |
| | | DirectoryServer.registerMatchingRule(matchingRule, false); |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | Message message = WARN_CONFIG_SCHEMA_MR_CONFLICTING_MR.get( |
| | | String.valueOf(configuration.dn()), de.getMessageObject()); |
| | | adminActionRequired = true; |
| | | messages.add(message); |
| | | } |
| | | currentConfig = configuration; |
| | | return new ConfigChangeResult(resultCode, adminActionRequired, messages); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isConfigurationChangeAcceptable( |
| | | CollationMatchingRuleCfg configuration, |
| | | List<Message> unacceptableReasons) |
| | | { |
| | | boolean configAcceptable = true; |
| | | |
| | | //If the new configuration disables this factory, don't do anything. |
| | | if(!configuration.isEnabled()) |
| | | { |
| | | return configAcceptable; |
| | | } |
| | | |
| | | |
| | | //If it comes here we don't need to verify MatchingRuleType; it should be |
| | | //okay as its syntax is verified by the admin framework. Iterate over the |
| | | //collations and verify if the format is okay. Also, verify if the |
| | | //locale is allowed by the JVM. |
| | | for(String collation:configuration.getCollation()) |
| | | { |
| | | CollationMapper mapper = new CollationMapper(collation); |
| | | |
| | | String nOID = mapper.getNumericOID(); |
| | | String languageTag = mapper.getLanguageTag(); |
| | | if(nOID==null || languageTag==null) |
| | | { |
| | | configAcceptable = false; |
| | | Message msg = |
| | | WARN_ATTR_INVALID_COLLATION_MATCHING_RULE_FORMAT. |
| | | get(collation); |
| | | unacceptableReasons.add(msg); |
| | | continue; |
| | | } |
| | | |
| | | Locale locale = getLocale(languageTag); |
| | | if(locale==null) |
| | | { |
| | | Message msg = |
| | | WARN_ATTR_INVALID_COLLATION_MATCHING_RULE_LOCALE. |
| | | get(collation,configuration.dn().toNormalizedString(), |
| | | languageTag); |
| | | unacceptableReasons.add(msg); |
| | | configAcceptable = false; |
| | | continue; |
| | | } |
| | | } |
| | | return configAcceptable; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates Less-than Matching Rule. |
| | | * |
| | | * @param mapper CollationMapper containing OID and the language Tag. |
| | | * @param locale Locale value |
| | | */ |
| | | private void createLessThanMatchingRule(CollationMapper mapper,Locale locale) |
| | | { |
| | | if(!lessThanMatchingRuleType) |
| | | return; |
| | | |
| | | String oid = mapper.getNumericOID()+".1"; |
| | | String lTag = mapper.getLanguageTag(); |
| | | |
| | | Collection<String> names = new HashSet<String>(); |
| | | MatchingRule matchingRule = getMatchingRule(oid); |
| | | if(matchingRule!=null) |
| | | { |
| | | for(String name: matchingRule.getAllNames()) |
| | | { |
| | | names.add(name); |
| | | } |
| | | } |
| | | |
| | | names.add(lTag+".lt"); |
| | | names.add(lTag + ".1"); |
| | | |
| | | matchingRule = new CollationLessThanMatchingRule(oid, names, locale); |
| | | addMatchingRule(oid, matchingRule); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates Less-Than-Equal-To Matching Rule. |
| | | * |
| | | * @param mapper CollationMapper containing OID and the language Tag. |
| | | * @param locale Locale value |
| | | */ |
| | | private void createLessThanOrEqualToMatchingRule(CollationMapper mapper, |
| | | Locale locale) |
| | | { |
| | | if(!lessThanEqualToMatchingRuleType) |
| | | return; |
| | | |
| | | String oid = mapper.getNumericOID()+".2"; |
| | | String lTag = mapper.getLanguageTag(); |
| | | |
| | | Collection<String> names = new HashSet<String>(); |
| | | MatchingRule matchingRule = getMatchingRule(oid); |
| | | if(matchingRule!=null) |
| | | { |
| | | for(String name: matchingRule.getAllNames()) |
| | | { |
| | | names.add(name); |
| | | } |
| | | } |
| | | |
| | | names.add(lTag+".lte"); |
| | | names.add(lTag + ".2"); |
| | | |
| | | matchingRule = |
| | | new CollationLessThanOrEqualToMatchingRule(oid,names,locale); |
| | | addMatchingRule(oid, matchingRule); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates Equality Matching Rule. |
| | | * |
| | | * @param mapper CollationMapper containing OID and the language Tag. |
| | | * @param locale Locale value |
| | | */ |
| | | private void createEqualityMatchingRule(CollationMapper mapper,Locale locale) |
| | | { |
| | | if(!equalityMatchingRuleType) |
| | | return; |
| | | //Register the default OID as equality matching rule. |
| | | String lTag = mapper.getLanguageTag(); |
| | | String nOID = mapper.getNumericOID(); |
| | | |
| | | MatchingRule matchingRule = getMatchingRule(nOID); |
| | | Collection<String> names = new HashSet<String>(); |
| | | if(matchingRule!=null) |
| | | { |
| | | for(String name: matchingRule.getAllNames()) |
| | | { |
| | | names.add(name); |
| | | } |
| | | } |
| | | |
| | | names.add(lTag); |
| | | matchingRule = |
| | | new CollationEqualityMatchingRule(nOID,names,locale); |
| | | addMatchingRule(nOID, matchingRule); |
| | | |
| | | // Register OID.3 as the equality matching rule. |
| | | String OID = mapper.getNumericOID() + ".3"; |
| | | MatchingRule equalityMatchingRule = getMatchingRule(OID); |
| | | Collection<String> equalityNames = new HashSet<String>(); |
| | | if(equalityMatchingRule!=null) |
| | | { |
| | | for(String name: equalityMatchingRule.getAllNames()) |
| | | { |
| | | equalityNames.add(name); |
| | | } |
| | | } |
| | | |
| | | equalityNames.add(lTag+".eq"); |
| | | equalityNames.add(lTag+".3"); |
| | | |
| | | equalityMatchingRule = |
| | | new CollationEqualityMatchingRule(OID,equalityNames,locale); |
| | | addMatchingRule(OID, equalityMatchingRule); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates Greater-than-equal-to Matching Rule. |
| | | * |
| | | * @param mapper CollationMapper containing OID and the language Tag. |
| | | * @param locale Locale value |
| | | */ |
| | | private void createGreaterThanOrEqualToMatchingRule(CollationMapper mapper, |
| | | Locale locale) |
| | | { |
| | | if(!greaterThanEqualToMatchingRuleType) |
| | | return; |
| | | |
| | | String oid = mapper.getNumericOID()+".4"; |
| | | String lTag = mapper.getLanguageTag(); |
| | | |
| | | Collection<String> names = new HashSet<String>(); |
| | | MatchingRule matchingRule = getMatchingRule(oid); |
| | | if(matchingRule!=null) |
| | | { |
| | | for(String name: matchingRule.getAllNames()) |
| | | { |
| | | names.add(name); |
| | | } |
| | | } |
| | | |
| | | names.add(lTag+".gte"); |
| | | names.add(lTag + ".4"); |
| | | matchingRule = |
| | | new CollationGreaterThanOrEqualToMatchingRule(oid,names,locale); |
| | | addMatchingRule(oid, matchingRule); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates Greater-than Matching Rule. |
| | | * |
| | | * @param mapper CollationMapper containing OID and the language Tag. |
| | | * @param locale Locale value |
| | | */ |
| | | private void createGreaterThanMatchingRule(CollationMapper mapper, |
| | | Locale locale) |
| | | { |
| | | if(!greaterThanMatchingRuleType) |
| | | return; |
| | | |
| | | String oid = mapper.getNumericOID()+".5"; |
| | | String lTag = mapper.getLanguageTag(); |
| | | |
| | | Collection<String> names = new HashSet<String>(); |
| | | MatchingRule matchingRule = getMatchingRule(oid); |
| | | if(matchingRule!=null) |
| | | { |
| | | for(String name: matchingRule.getAllNames()) |
| | | { |
| | | names.add(name); |
| | | } |
| | | } |
| | | |
| | | names.add(lTag+".gt"); |
| | | names.add(lTag + ".5"); |
| | | matchingRule = |
| | | new CollationGreaterThanMatchingRule(oid,names,locale); |
| | | addMatchingRule(oid, matchingRule); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates substring Matching Rule. |
| | | * |
| | | * @param mapper CollationMapper containing OID and the language Tag. |
| | | * @param locale Locale value |
| | | */ |
| | | private void createSubstringMatchingRule(CollationMapper mapper,Locale locale) |
| | | { |
| | | if(!substringMatchingRuleType) |
| | | return; |
| | | |
| | | String oid = mapper.getNumericOID()+".6"; |
| | | String lTag = mapper.getLanguageTag(); |
| | | |
| | | Collection<String> names = new HashSet<String>(); |
| | | MatchingRule matchingRule = getMatchingRule(oid); |
| | | if(matchingRule!=null) |
| | | { |
| | | for(String name: matchingRule.getAllNames()) |
| | | { |
| | | names.add(name); |
| | | } |
| | | } |
| | | names.add(lTag+".sub"); |
| | | names.add(lTag + ".6"); |
| | | matchingRule = |
| | | new CollationSubstringMatchingRule(oid,names,locale); |
| | | addMatchingRule(oid, matchingRule); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * Verifies if the locale is supported by the JVM. |
| | | * |
| | | * @param lTag The language tag specified in the configuration. |
| | | * @return Locale The locale correspoding to the languageTag. |
| | | */ |
| | | private Locale getLocale(String lTag) |
| | | { |
| | | //Separates the language and the country from the locale. |
| | | Locale locale; |
| | | String lang = null; |
| | | String country = null; |
| | | String variant = null; |
| | | |
| | | int countryIndex = lTag.indexOf("-"); |
| | | int variantIndex = lTag.lastIndexOf("-"); |
| | | |
| | | if(countryIndex > 0) |
| | | { |
| | | lang = lTag.substring(0,countryIndex); |
| | | |
| | | if(variantIndex>countryIndex) |
| | | { |
| | | country = lTag.substring(countryIndex+1,variantIndex); |
| | | variant = lTag.substring(variantIndex+1,lTag.length()); |
| | | locale = new Locale(lang,country,variant); |
| | | } |
| | | else |
| | | { |
| | | country = lTag.substring(countryIndex+1,lTag.length()); |
| | | locale = new Locale(lang,country); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | lang = lTag; |
| | | locale = new Locale(lTag); |
| | | } |
| | | |
| | | if(!supportedLocales.contains(locale)) |
| | | { |
| | | //This locale is not supported by this JVM. |
| | | locale = null; |
| | | } |
| | | return locale; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | *Collation rule for Equality matching rule. |
| | | */ |
| | | private final class CollationEqualityMatchingRule |
| | | extends ExtensibleMatchingRule |
| | | { |
| | | //Names for this class. |
| | | private final Collection<String> names; |
| | | |
| | | //Collator for performing equality match. |
| | | private final Collator collator; |
| | | |
| | | //Numeric OID of the rule. |
| | | private final String nOID; |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationEqualityMatchingRule. |
| | | * |
| | | * @param nOID OID of the collation matching rule |
| | | * @param names names of this matching rule |
| | | * @param locale Locale of the collation matching rule |
| | | */ |
| | | private CollationEqualityMatchingRule(String nOID,Collection<String> names, |
| | | Locale locale) |
| | | { |
| | | super(); |
| | | this.names = names; |
| | | this.collator =createCollator(locale); |
| | | this.nOID = nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | //Concatenate all the names and return. |
| | | StringBuilder builder = new StringBuilder(); |
| | | for(String name: getAllNames()) |
| | | { |
| | | builder.append(name); |
| | | builder.append("\b"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.unmodifiableCollection(names); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getDescription() |
| | | { |
| | | // There is no standard description for this matching rule. |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getSyntaxOID() |
| | | { |
| | | return SYNTAX_DIRECTORY_STRING_OID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | CollationKey key = collator.getCollationKey(value.stringValue()); |
| | | return new ASN1OctetString(key.toByteArray()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the two provided normalized values are equal to |
| | | * each other. |
| | | * |
| | | * @param value1 The normalized form of the first value to |
| | | * compare. |
| | | * @param value2 The normalized form of the second value to |
| | | * compare. |
| | | * |
| | | * @return {@code true} if the provided values are equal, or |
| | | * {@code false} if not. |
| | | */ |
| | | private boolean areEqual(ByteString value1, ByteString value2) |
| | | { |
| | | return Arrays.equals(value1.value(), value2.value()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | if (areEqual(attributeValue, assertionValue)) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | | else |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Collation rule for Substring matching rule. |
| | | */ |
| | | private final class CollationSubstringMatchingRule |
| | | extends ExtensibleMatchingRule |
| | | { |
| | | //Names for this class. |
| | | private final Collection<String> names; |
| | | |
| | | //Collator for performing equality match. |
| | | private final Collator collator; |
| | | |
| | | //Numeric OID of the rule. |
| | | private final String nOID; |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationSubstringMatchingRule. |
| | | * |
| | | * @param nOID OID of the collation matching rule |
| | | * @param names names of this matching rule |
| | | * @param locale Locale of the collation matching rule |
| | | */ |
| | | private CollationSubstringMatchingRule(String nOID, |
| | | Collection<String> names,Locale locale) |
| | | { |
| | | super(); |
| | | this.names = names; |
| | | this.collator =createCollator(locale); |
| | | this.nOID = nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | //Concatenate all the names and return. |
| | | StringBuilder builder = new StringBuilder(); |
| | | for(String name: getAllNames()) |
| | | { |
| | | builder.append(name); |
| | | builder.append("\b"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.unmodifiableCollection(names); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getDescription() |
| | | { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getSyntaxOID() |
| | | { |
| | | return SYNTAX_DIRECTORY_STRING_OID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | CollationKey key = collator.getCollationKey(value.stringValue()); |
| | | return new ASN1OctetString(key.toByteArray()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ByteString normalizeAssertionValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | // Get a string representation of the value. |
| | | String filterString = value.stringValue(); |
| | | int endPos = filterString.length(); |
| | | |
| | | // Find the locations of all the asterisks in the value. Also, |
| | | // check to see if there are any escaped values, since they will |
| | | // need special treatment. |
| | | boolean hasEscape = false; |
| | | LinkedList<Integer> asteriskPositions = new LinkedList<Integer>(); |
| | | for (int i=0; i < endPos; i++) |
| | | { |
| | | if (filterString.charAt(i) == 0x2A) // The asterisk. |
| | | { |
| | | asteriskPositions.add(i); |
| | | } |
| | | else if (filterString.charAt(i) == 0x5C) // The backslash. |
| | | { |
| | | hasEscape = true; |
| | | } |
| | | } |
| | | |
| | | |
| | | // If there were no asterisks, then this isn't a substring filter. |
| | | if (asteriskPositions.isEmpty()) |
| | | { |
| | | Message message = ERR_SEARCH_FILTER_SUBSTRING_NO_ASTERISKS.get( |
| | | filterString, 0, endPos); |
| | | throw new DirectoryException( |
| | | ResultCode.PROTOCOL_ERROR, message); |
| | | } |
| | | |
| | | // If the value starts with an asterisk, then there is no |
| | | // subInitial component. Otherwise, parse out the subInitial. |
| | | String subInitial; |
| | | int firstPos = asteriskPositions.removeFirst(); |
| | | if (firstPos == 0) |
| | | { |
| | | subInitial = null; |
| | | } |
| | | else |
| | | { |
| | | if (hasEscape) |
| | | { |
| | | CharBuffer buffer = CharBuffer.allocate(firstPos); |
| | | for (int i=0; i < firstPos; i++) |
| | | { |
| | | if (filterString.charAt(i) == 0x5C) |
| | | { |
| | | char escapeValue = hexToEscapedChar(filterString, i +1); |
| | | i +=2; //Move to the next sequence. |
| | | buffer.put(escapeValue); |
| | | } |
| | | else |
| | | { |
| | | buffer.put(filterString.charAt(i)); |
| | | } |
| | | } |
| | | |
| | | char[] subInitialChars = new char[buffer.position()]; |
| | | buffer.flip(); |
| | | buffer.get(subInitialChars); |
| | | subInitial = new String(subInitialChars); |
| | | } |
| | | else |
| | | { |
| | | subInitial = filterString.substring(0,firstPos); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Next, process through the rest of the asterisks to get the |
| | | // subAny values. |
| | | List<String> subAny = new ArrayList<String>(); |
| | | for (int asteriskPos : asteriskPositions) |
| | | { |
| | | int length = asteriskPos - firstPos - 1; |
| | | |
| | | if (hasEscape) |
| | | { |
| | | CharBuffer buffer = CharBuffer.allocate(length); |
| | | for (int i=firstPos+1; i < asteriskPos; i++) |
| | | { |
| | | if (filterString.charAt(i) == 0x5C) |
| | | { |
| | | char escapeValue = hexToEscapedChar(filterString, i + 1); |
| | | i +=2; //Move to the next sequence. |
| | | buffer.put(escapeValue); |
| | | } |
| | | else |
| | | { |
| | | buffer.put(filterString.charAt(i)); |
| | | } |
| | | } |
| | | |
| | | char[] subAnyChars = new char[buffer.position()]; |
| | | buffer.flip(); |
| | | buffer.get(subAnyChars); |
| | | subAny.add(new String(subAnyChars)); |
| | | } |
| | | else |
| | | { |
| | | subAny.add(filterString.substring(firstPos+1, firstPos+length+1)); |
| | | } |
| | | |
| | | |
| | | firstPos = asteriskPos; |
| | | } |
| | | |
| | | |
| | | // Finally, see if there is anything after the last asterisk, |
| | | // which would be the subFinal value. |
| | | String subFinal; |
| | | if (firstPos == (endPos-1)) |
| | | { |
| | | subFinal = null; |
| | | } |
| | | else |
| | | { |
| | | int length = endPos - firstPos - 1; |
| | | |
| | | if (hasEscape) |
| | | { |
| | | CharBuffer buffer = CharBuffer.allocate(length); |
| | | for (int i=firstPos+1; i < endPos; i++) |
| | | { |
| | | if (filterString.charAt(i) == 0x5C) |
| | | { |
| | | char escapeValue = hexToEscapedChar(filterString, i + 1); |
| | | i +=2; //Move to the next sequence. |
| | | buffer.put(escapeValue); |
| | | } |
| | | else |
| | | { |
| | | buffer.put(filterString.charAt(i)); |
| | | } |
| | | } |
| | | |
| | | char[] subFinalChars = new char[buffer.position()]; |
| | | buffer.flip(); |
| | | buffer.get(subFinalChars); |
| | | subFinal = new String(subFinalChars); |
| | | } |
| | | else |
| | | { |
| | | subFinal = filterString.substring(firstPos+1, length + firstPos + 1); |
| | | } |
| | | } |
| | | |
| | | // Normalize the Values in the following format: |
| | | // initialLength, initial, numberofany, anyLength1, any1, anyLength2, |
| | | // any2, ..., anyLengthn, anyn, finalLength, final |
| | | CollationKey key = null; |
| | | List<Integer> normalizedList = new ArrayList<Integer>(); |
| | | |
| | | if(subInitial == null) |
| | | { |
| | | normalizedList.add(0); |
| | | } |
| | | else |
| | | { |
| | | key = collator.getCollationKey(subInitial); |
| | | byte[] initialBytes = key.toByteArray(); |
| | | // Last 4 bytes are 0s with PRIMARY strenght. |
| | | int length = initialBytes.length - 4 ; |
| | | normalizedList.add(length); |
| | | for(int i=0;i<length;i++) |
| | | { |
| | | normalizedList.add((int)initialBytes[i]); |
| | | } |
| | | } |
| | | if(subAny.size()==0) |
| | | { |
| | | normalizedList.add(0); |
| | | } |
| | | else |
| | | { |
| | | normalizedList.add(subAny.size()); |
| | | for(String any:subAny) |
| | | { |
| | | key = collator.getCollationKey(any); |
| | | byte[] anyBytes = key.toByteArray(); |
| | | int length = anyBytes.length - 4; |
| | | normalizedList.add(length); |
| | | for(int i=0;i<length;i++) |
| | | { |
| | | normalizedList.add((int)anyBytes[i]); |
| | | } |
| | | } |
| | | } |
| | | if(subFinal ==null) |
| | | { |
| | | normalizedList.add(0); |
| | | } |
| | | else |
| | | { |
| | | key = collator.getCollationKey(subFinal); |
| | | byte[] subFinalBytes = key.toByteArray(); |
| | | int length = subFinalBytes.length - 4; |
| | | normalizedList.add(length); |
| | | for(int i=0;i<length;i++) |
| | | { |
| | | normalizedList.add((int)subFinalBytes[i]); |
| | | } |
| | | } |
| | | |
| | | byte[] normalizedBytes = new byte[normalizedList.size()]; |
| | | for(int i=0;i<normalizedList.size();i++) |
| | | { |
| | | normalizedBytes[i] = normalizedList.get(i).byteValue(); |
| | | } |
| | | return new ASN1OctetString(normalizedBytes); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | byte[] valueBytes = attributeValue.value(); |
| | | int valueLength = valueBytes.length - 4; |
| | | |
| | | byte[] assertionBytes = assertionValue.value(); |
| | | |
| | | int valuePos = 0; // position in the value bytes array. |
| | | int assertPos = 0; // position in the assertion bytes array. |
| | | int subInitialLength = 0xFF & assertionBytes[0]; |
| | | //First byte is the length of subInitial. |
| | | |
| | | if(subInitialLength!= 0) |
| | | { |
| | | if(subInitialLength > valueLength) |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | |
| | | for(;valuePos < subInitialLength; valuePos++) |
| | | { |
| | | if(valueBytes[valuePos]!=assertionBytes[valuePos+1]) |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | } |
| | | } |
| | | assertPos = subInitialLength + 1; |
| | | int anySize = 0xFF & assertionBytes[assertPos++]; |
| | | if(anySize!=0) |
| | | { |
| | | while(anySize-- > 0) |
| | | { |
| | | int anyLength = 0xFF & assertionBytes[assertPos++]; |
| | | int end = valueLength - anyLength; |
| | | boolean match = false; |
| | | for(; valuePos <= end; valuePos++) |
| | | { |
| | | |
| | | if(assertionBytes[assertPos] == valueBytes[valuePos]) |
| | | { |
| | | boolean subMatch = true; |
| | | for(int i=1;i<anyLength;i++) |
| | | { |
| | | |
| | | if(assertionBytes[assertPos+i] != valueBytes[valuePos+i]) |
| | | { |
| | | subMatch = false; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if(subMatch) |
| | | { |
| | | match = subMatch; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if(match) |
| | | { |
| | | valuePos += anyLength; |
| | | } |
| | | else |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | assertPos = assertPos + anyLength; |
| | | } |
| | | } |
| | | |
| | | int finalLength = 0xFF & assertionBytes[assertPos++]; |
| | | if(finalLength!=0) |
| | | { |
| | | if((valueLength - finalLength) < valuePos) |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | |
| | | valuePos = valueLength - finalLength; |
| | | |
| | | if(finalLength != assertionBytes.length - assertPos ) |
| | | { |
| | | //Some issue with the encoding. |
| | | return ConditionResult.FALSE; |
| | | } |
| | | |
| | | valuePos = valueLength - finalLength; |
| | | for (int i=0; i < finalLength; i++,valuePos++) |
| | | { |
| | | if (assertionBytes[assertPos+i] != valueBytes[valuePos]) |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ConditionResult.TRUE; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | *Collation rule for less-than matching rule. |
| | | */ |
| | | private final class CollationLessThanMatchingRule |
| | | extends ExtensibleMatchingRule |
| | | { |
| | | //Names for this class. |
| | | private final Collection<String> names; |
| | | |
| | | //Collator for performing equality match. |
| | | private final Collator collator; |
| | | |
| | | //Numeric OID of the rule. |
| | | private final String nOID; |
| | | |
| | | /** |
| | | * Constructs a new CollationLessThanMatchingRule. |
| | | * |
| | | * @param nOID OID of the collation matching rule |
| | | * @param names names of this matching rule |
| | | * @param locale Locale of the collation matching rule |
| | | */ |
| | | private CollationLessThanMatchingRule(String nOID, |
| | | Collection<String> names,Locale locale) |
| | | { |
| | | super(); |
| | | this.names = names; |
| | | this.collator =createCollator(locale); |
| | | this.nOID = nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | //Concatenate all the names and return. |
| | | StringBuilder builder = new StringBuilder(); |
| | | for(String name: getAllNames()) |
| | | { |
| | | builder.append(name); |
| | | builder.append("\b"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.unmodifiableCollection(names); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getDescription() |
| | | { |
| | | // There is no standard description for this matching rule. |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getSyntaxOID() |
| | | { |
| | | return SYNTAX_DIRECTORY_STRING_OID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | CollationKey key = collator.getCollationKey(value.stringValue()); |
| | | return new ASN1OctetString(key.toByteArray()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Compares the first value to the second and returns a value that |
| | | * indicates their relative order. |
| | | * |
| | | * @param b1 The normalized form of the first value to |
| | | * compare. |
| | | * @param b2 The normalized form of the second value to |
| | | * compare. |
| | | * |
| | | * @return A negative integer if {@code value1} should come before |
| | | * {@code value2} in ascending order, a positive integer if |
| | | * {@code value1} should come after {@code value2} in |
| | | * ascending order, or zero if there is no difference |
| | | * between the values with regard to ordering. |
| | | */ |
| | | private int compare(byte[] b1, byte[] b2) |
| | | { |
| | | //Compare values using byte arrays. |
| | | int minLength = Math.min(b1.length, b2.length); |
| | | |
| | | for (int i=0; i < minLength; i++) |
| | | { |
| | | int firstByte = 0xFF & ((int)b1[i]); |
| | | int secondByte = 0xFF & ((int)b2[i]); |
| | | |
| | | if (firstByte == secondByte) |
| | | { |
| | | continue; |
| | | } |
| | | else if (firstByte < secondByte) |
| | | { |
| | | return -1; |
| | | } |
| | | else if (firstByte > secondByte) |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | if (b1.length == b2.length) |
| | | { |
| | | return 0; |
| | | } |
| | | else if (b1.length < b2.length) |
| | | { |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | int ret = compare(attributeValue.value(),assertionValue.value()); |
| | | |
| | | if(ret <0) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | | else |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Collation rule for less-than-equal-to matching rule. |
| | | */ |
| | | private final class CollationLessThanOrEqualToMatchingRule |
| | | extends ExtensibleMatchingRule |
| | | { |
| | | //Names for this class. |
| | | private final Collection<String> names; |
| | | |
| | | //Collator for performing equality match. |
| | | private final Collator collator; |
| | | |
| | | //Numeric OID of the rule. |
| | | private final String nOID; |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationLessThanOrEqualToMatchingRule. |
| | | * |
| | | * @param nOID OID of the collation matching rule |
| | | * @param names names of this matching rule |
| | | * @param locale Locale of the collation matching rule |
| | | */ |
| | | private CollationLessThanOrEqualToMatchingRule(String nOID, |
| | | Collection<String> names, |
| | | Locale locale) |
| | | { |
| | | super(); |
| | | this.names = names; |
| | | this.collator =createCollator(locale); |
| | | this.nOID = nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | //Concatenate all the names and return. |
| | | StringBuilder builder = new StringBuilder(); |
| | | for(String name: getAllNames()) |
| | | { |
| | | builder.append(name); |
| | | builder.append("\b"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.unmodifiableCollection(names); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getDescription() |
| | | { |
| | | // There is no standard description for this matching rule. |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getSyntaxOID() |
| | | { |
| | | return SYNTAX_DIRECTORY_STRING_OID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | CollationKey key = collator.getCollationKey(value.stringValue()); |
| | | return new ASN1OctetString(key.toByteArray()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Compares the first value to the second and returns a value that |
| | | * indicates their relative order. |
| | | * |
| | | * @param b1 The normalized form of the first value to |
| | | * compare. |
| | | * @param b2 The normalized form of the second value to |
| | | * compare. |
| | | * |
| | | * @return A negative integer if {@code value1} should come before |
| | | * {@code value2} in ascending order, a positive integer if |
| | | * {@code value1} should come after {@code value2} in |
| | | * ascending order, or zero if there is no difference |
| | | * between the values with regard to ordering. |
| | | */ |
| | | public int compare(byte[] b1, byte[] b2) |
| | | { |
| | | //Compare values using byte arrays. |
| | | int minLength = Math.min(b1.length, b2.length); |
| | | |
| | | for (int i=0; i < minLength; i++) |
| | | { |
| | | int firstByte = 0xFF & ((int)b1[i]); |
| | | int secondByte = 0xFF & ((int)b2[i]); |
| | | |
| | | if (firstByte == secondByte) |
| | | { |
| | | continue; |
| | | } |
| | | else if (firstByte < secondByte) |
| | | { |
| | | return -1; |
| | | } |
| | | else if (firstByte > secondByte) |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | if (b1.length == b2.length) |
| | | { |
| | | return 0; |
| | | } |
| | | else if (b1.length < b2.length) |
| | | { |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | int ret = compare(attributeValue.value(),assertionValue.value()); |
| | | |
| | | if(ret <= 0) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | | else |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Collation rule for greater-than matching rule. |
| | | */ |
| | | private final class CollationGreaterThanMatchingRule |
| | | extends ExtensibleMatchingRule |
| | | { |
| | | //Names for this class. |
| | | private final Collection<String> names; |
| | | |
| | | //Collator for performing equality match. |
| | | private final Collator collator; |
| | | |
| | | //Numeric OID of the rule. |
| | | private final String nOID; |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationGreaterThanMatchingRule. |
| | | * |
| | | * @param nOID OID of the collation matching rule |
| | | * @param names names of this matching rule |
| | | * @param locale Locale of the collation matching rule |
| | | */ |
| | | private CollationGreaterThanMatchingRule(String nOID, |
| | | Collection<String> names,Locale locale) |
| | | { |
| | | super(); |
| | | this.names = names; |
| | | this.collator =createCollator(locale); |
| | | this.nOID = nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | //Concatenate all the names and return. |
| | | StringBuilder builder = new StringBuilder(); |
| | | for(String name: getAllNames()) |
| | | { |
| | | builder.append(name); |
| | | builder.append("\b"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.unmodifiableCollection(names); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getDescription() |
| | | { |
| | | // There is no standard description for this matching rule. |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getSyntaxOID() |
| | | { |
| | | return SYNTAX_DIRECTORY_STRING_OID; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | CollationKey key = collator.getCollationKey(value.stringValue()); |
| | | return new ASN1OctetString(key.toByteArray()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Compares the first value to the second and returns a value that |
| | | * indicates their relative order. |
| | | * |
| | | * @param b1 The normalized form of the first value to |
| | | * compare. |
| | | * @param b2 The normalized form of the second value to |
| | | * compare. |
| | | * |
| | | * @return A negative integer if {@code value1} should come before |
| | | * {@code value2} in ascending order, a positive integer if |
| | | * {@code value1} should come after {@code value2} in |
| | | * ascending order, or zero if there is no difference |
| | | * between the values with regard to ordering. |
| | | */ |
| | | public int compare(byte[] b1, byte[] b2) |
| | | { |
| | | //Compare values using byte arrays. |
| | | int minLength = Math.min(b1.length, b2.length); |
| | | |
| | | for (int i=0; i < minLength; i++) |
| | | { |
| | | int firstByte = 0xFF & ((int)b1[i]); |
| | | int secondByte = 0xFF & ((int)b2[i]); |
| | | |
| | | if (firstByte == secondByte) |
| | | { |
| | | continue; |
| | | } |
| | | else if (firstByte < secondByte) |
| | | { |
| | | return -1; |
| | | } |
| | | else if (firstByte > secondByte) |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | if (b1.length == b2.length) |
| | | { |
| | | return 0; |
| | | } |
| | | else if (b1.length < b2.length) |
| | | { |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | int ret = compare(attributeValue.value(),assertionValue.value()); |
| | | |
| | | if(ret > 0) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | | else |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Collation rule for greater-than-equal-to matching rule. |
| | | */ |
| | | private final class CollationGreaterThanOrEqualToMatchingRule |
| | | extends ExtensibleMatchingRule |
| | | { |
| | | |
| | | //Names for this class. |
| | | private final Collection<String> names; |
| | | |
| | | //Collator for performing equality match. |
| | | private final Collator collator; |
| | | |
| | | //Numeric OID of the rule. |
| | | private final String nOID; |
| | | |
| | | |
| | | /** |
| | | * Constructs a new CollationGreaterThanOrEqualToMatchingRule. |
| | | * |
| | | * @param nOID OID of the collation matching rule |
| | | * @param names names of this matching rule |
| | | * @param locale Locale of the collation matching rule |
| | | */ |
| | | private CollationGreaterThanOrEqualToMatchingRule(String nOID, |
| | | Collection<String> names, |
| | | Locale locale) |
| | | { |
| | | super(); |
| | | this.names = names; |
| | | this.collator =createCollator(locale); |
| | | this.nOID = nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | //Concatenate all the names and return. |
| | | StringBuilder builder = new StringBuilder(); |
| | | for(String name: getAllNames()) |
| | | { |
| | | builder.append(name); |
| | | builder.append("\b"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<String> getAllNames() |
| | | { |
| | | return Collections.unmodifiableCollection(names); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return nOID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getDescription() |
| | | { |
| | | // There is no standard description for this matching rule. |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getSyntaxOID() |
| | | { |
| | | return SYNTAX_DIRECTORY_STRING_OID; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | CollationKey key = collator.getCollationKey(value.stringValue()); |
| | | return new ASN1OctetString(key.toByteArray()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Compares the first value to the second and returns a value that |
| | | * indicates their relative order. |
| | | * |
| | | * @param b1 The normalized form of the first value to |
| | | * compare. |
| | | * @param b2 The normalized form of the second value to |
| | | * compare. |
| | | * |
| | | * @return A negative integer if {@code value1} should come before |
| | | * {@code value2} in ascending order, a positive integer if |
| | | * {@code value1} should come after {@code value2} in |
| | | * ascending order, or zero if there is no difference |
| | | * between the values with regard to ordering. |
| | | */ |
| | | public int compare(byte[] b1, byte[] b2) |
| | | { |
| | | //Compare values using byte arrays. |
| | | int minLength = Math.min(b1.length, b2.length); |
| | | |
| | | for (int i=0; i < minLength; i++) |
| | | { |
| | | int firstByte = 0xFF & ((int)b1[i]); |
| | | int secondByte = 0xFF & ((int)b2[i]); |
| | | |
| | | if (firstByte == secondByte) |
| | | { |
| | | continue; |
| | | } |
| | | else if (firstByte < secondByte) |
| | | { |
| | | return -1; |
| | | } |
| | | else if (firstByte > secondByte) |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | if (b1.length == b2.length) |
| | | { |
| | | return 0; |
| | | } |
| | | else if (b1.length < b2.length) |
| | | { |
| | | return -1; |
| | | } |
| | | else |
| | | { |
| | | return 1; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | int ret = compare(attributeValue.value(),assertionValue.value()); |
| | | |
| | | if(ret >= 0) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | | else |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * A utility class for extracting the OID and Language Tag from the |
| | | * configuration entry. |
| | | */ |
| | | private final class CollationMapper |
| | | { |
| | | //OID of the collation rule. |
| | | private String oid; |
| | | |
| | | //Language Tag. |
| | | private String lTag; |
| | | |
| | | |
| | | /** |
| | | * Creates a new instance of CollationMapper. |
| | | * |
| | | * @param collation The collation text in the LOCALE:OID format. |
| | | */ |
| | | private CollationMapper(String collation) |
| | | { |
| | | int index = collation.indexOf(":"); |
| | | if(index>0) |
| | | { |
| | | oid = collation.substring(index+1,collation.length()); |
| | | lTag = collation.substring(0,index); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the OID part of the collation text. |
| | | * |
| | | * @return OID part of the collation text. |
| | | */ |
| | | private String getNumericOID() |
| | | { |
| | | return oid; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the language Tag of collation text. |
| | | * |
| | | * @return Language Tag part of the collation text. |
| | | */ |
| | | private String getLanguageTag() |
| | | { |
| | | return lTag; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * objectclass descriptions) in which the "first component" is the first item |
| | | * after the opening parenthesis. |
| | | */ |
| | | public class DirectoryStringFirstComponentEqualityMatchingRule |
| | | class DirectoryStringFirstComponentEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link DirectoryStringFirstComponentEqualityMatchingRule}. |
| | | */ |
| | | public final class DirectoryStringFirstComponentEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new DirectoryStringFirstComponentEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AcceptRejectWarn; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | |
| | | * This class defines the distinguishedNameMatch matching rule defined in X.520 |
| | | * and referenced in RFC 2252. |
| | | */ |
| | | public class DistinguishedNameEqualityMatchingRule |
| | | class DistinguishedNameEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link DistinguishedNameEqualityMatchingRule}. |
| | | */ |
| | | public final class DistinguishedNameEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new DistinguishedNameEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.ApproximateMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.ApproximateMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | |
| | | * updated to always only generate a single value rather than one or possibly |
| | | * two values. |
| | | */ |
| | | public class DoubleMetaphoneApproximateMatchingRule |
| | | class DoubleMetaphoneApproximateMatchingRule |
| | | extends ApproximateMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(ApproximateMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link DoubleMetaphoneApproximateMatchingRule}. |
| | | */ |
| | | public final class DoubleMetaphoneApproximateMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new DoubleMetaphoneApproximateMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | |
| | | /** |
| | | * This class defines the generalizedTimeMatch matching rule defined in X.520 |
| | | * and referenced in RFC 2252. |
| | | */ |
| | | public class GeneralizedTimeEqualityMatchingRule |
| | | class GeneralizedTimeEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link GeneralizedTimeEqualityMatchingRule}. |
| | | */ |
| | | public final class GeneralizedTimeEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new GeneralizedTimeEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | |
| | | |
| | |
| | | * This class defines the generalizedTimeOrderingMatch matching rule defined in |
| | | * X.520 and referenced in RFC 2252. |
| | | */ |
| | | public class GeneralizedTimeOrderingMatchingRule |
| | | class GeneralizedTimeOrderingMatchingRule |
| | | extends OrderingMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link GeneralizedTimeOrderingMatchingRule}. |
| | | */ |
| | | public final class GeneralizedTimeOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new GeneralizedTimeOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This class defines the integerMatch matching rule defined in X.520 and |
| | | * referenced in RFC 2252. |
| | | */ |
| | | public class IntegerEqualityMatchingRule |
| | | class IntegerEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link IntegerEqualityMatchingRule}. |
| | | */ |
| | | public final class IntegerEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new IntegerEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | |
| | | * objectclass descriptions) in which the "first component" is the first item |
| | | * after the opening parenthesis. |
| | | */ |
| | | public class IntegerFirstComponentEqualityMatchingRule |
| | | class IntegerFirstComponentEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link IntegerFirstComponentEqualityMatchingRule}. |
| | | */ |
| | | public final class IntegerFirstComponentEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new IntegerFirstComponentEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | * This class defines the integerOrderingMatch matching rule defined in X.520 |
| | | * and referenced in RFC 4519. |
| | | */ |
| | | public class IntegerOrderingMatchingRule |
| | | class IntegerOrderingMatchingRule |
| | | extends OrderingMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link IntegerOrderingMatchingRule}. |
| | | */ |
| | | public final class IntegerOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new IntegerOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | |
| | | * document defines "keyword" as implementation-specific, but in this case we |
| | | * will interpret it in the same way as "word" for the wordMatch rule. |
| | | */ |
| | | public class KeywordEqualityMatchingRule |
| | | class KeywordEqualityMatchingRule |
| | | extends WordEqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| | |
| | | * @return The common name for this matching rule, or <CODE>null</CODE> if |
| | | * it does not have a name. |
| | | */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | return EMR_KEYWORD_NAME; |
| | |
| | | * |
| | | * @return The OID for this matching rule. |
| | | */ |
| | | @Override |
| | | public String getOID() |
| | | { |
| | | return EMR_KEYWORD_OID; |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link KeywordEqualityMatchingRule}. |
| | | */ |
| | | public final class KeywordEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new KeywordEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * and referenced in RFC 2252. It allows for values with numeric digits and |
| | | * spaces, but ignores spaces when performing matching. |
| | | */ |
| | | public class NumericStringEqualityMatchingRule |
| | | class NumericStringEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link NumericStringEqualityMatchingRule}. |
| | | */ |
| | | public final class NumericStringEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new NumericStringEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This implements defines the numericStringOrderingMatch matching rule defined |
| | | * in X.520 and referenced in RFC 2252. |
| | | */ |
| | | public class NumericStringOrderingMatchingRule |
| | | class NumericStringOrderingMatchingRule |
| | | extends OrderingMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link NumericStringOrderingMatchingRule}. |
| | | */ |
| | | public final class NumericStringOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new NumericStringOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This class implements the numericStringSubstringsMatch matching rule defined |
| | | * in X.520 and referenced in RFC 2252. |
| | | */ |
| | | public class NumericStringSubstringMatchingRule |
| | | class NumericStringSubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link NumericStringSubstringMatchingRule}. |
| | | */ |
| | | public final class NumericStringSubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new NumericStringSubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types. AttributeType; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.NameForm; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.ResultCode; |
| | |
| | | * and referenced in RFC 2252. This expects to work on OIDs and will match |
| | | * either an attribute/objectclass name or a numeric OID. |
| | | */ |
| | | public class ObjectIdentifierEqualityMatchingRule |
| | | class ObjectIdentifierEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link ObjectIdentifierEqualityMatchingRule}. |
| | | */ |
| | | public final class ObjectIdentifierEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new ObjectIdentifierEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.NameForm; |
| | | import org.opends.server.types.ObjectClass; |
| | | |
| | |
| | | * objectclass descriptions) in which the "first component" is the first item |
| | | * after the opening parenthesis. |
| | | */ |
| | | public class ObjectIdentifierFirstComponentEqualityMatchingRule |
| | | class ObjectIdentifierFirstComponentEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link ObjectIdentifierFirstComponentEqualityMatchingRule}. |
| | | */ |
| | | public final class ObjectIdentifierFirstComponentEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new ObjectIdentifierFirstComponentEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | |
| | |
| | | * will be used as the default equality matching rule for the binary and octet |
| | | * string syntaxes. |
| | | */ |
| | | public class OctetStringEqualityMatchingRule |
| | | class OctetStringEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link OctetStringEqualityMatchingRule}. |
| | | */ |
| | | public final class OctetStringEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new OctetStringEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | |
| | | * X.520. This will be the default ordering matching rule for the binary and |
| | | * octet string syntaxes. |
| | | */ |
| | | public class OctetStringOrderingMatchingRule |
| | | class OctetStringOrderingMatchingRule |
| | | extends OrderingMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link OctectStringOrderingMatchingRule}. |
| | | */ |
| | | public final class OctetStringOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new OctetStringOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | |
| | | * X.520. It will be used as the default substring matching rule for the binary |
| | | * and octet string syntaxes. |
| | | */ |
| | | public class OctetStringSubstringMatchingRule |
| | | class OctetStringSubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link OctectStringSubstringMatchingRule}. |
| | | */ |
| | | public final class OctetStringSubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new OctetStringSubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * associated syntax have been deprecated, this matching rule behaves exactly |
| | | * like the caseIgnoreMatch rule. |
| | | */ |
| | | public class PresentationAddressEqualityMatchingRule |
| | | class PresentationAddressEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link PresentationAddressEqualityMatchingRule}. |
| | | */ |
| | | public final class PresentationAddressEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new PresentationAddressEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * associated syntax have been deprecated, this matching rule behaves exactly |
| | | * like the caseIgnoreMatch rule. |
| | | */ |
| | | public class ProtocolInformationEqualityMatchingRule |
| | | class ProtocolInformationEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link ProtocolInformationEqualityMatchingRule}. |
| | | */ |
| | | public final class ProtocolInformationEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new ProtocolInformationEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * very rigorous format, this is widely ignored so this matching will compare |
| | | * only numeric digits and strip out everything else. |
| | | */ |
| | | public class TelephoneNumberEqualityMatchingRule |
| | | class TelephoneNumberEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link TelephoneNumberEqualityMatchingRule}. |
| | | */ |
| | | public final class TelephoneNumberEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new TelephoneNumberEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.admin.std.server.SubstringMatchingRuleCfg; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * specification calls for a very rigorous format, this is widely ignored so |
| | | * this matching will compare only numeric digits and strip out everything else. |
| | | */ |
| | | public class TelephoneNumberSubstringMatchingRule |
| | | class TelephoneNumberSubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(SubstringMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link TelephoneNumberSubstringMatchingRule}. |
| | | */ |
| | | public final class TelephoneNumberSubstringMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new TelephoneNumberSubstringMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | * This class defines the uuidMatch matching rule defined in RFC 4530. It will |
| | | * be used as the default equality matching rule for the UUID syntax. |
| | | */ |
| | | public class UUIDEqualityMatchingRule |
| | | class UUIDEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link UUIDEqualityMatchingRule}. |
| | | */ |
| | | public final class UUIDEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | // Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new UUIDEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.messages.Message; |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.OrderingMatchingRuleCfg; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.messages.SchemaMessages.*; |
| | |
| | | * This class defines the uuidOrderingMatch matching rule defined in RFC 4530. |
| | | * This will be the default ordering matching rule for the UUID syntax. |
| | | */ |
| | | public class UUIDOrderingMatchingRule |
| | | class UUIDOrderingMatchingRule |
| | | extends OrderingMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(OrderingMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for {@link UUIDOrderingMatchingRule}. |
| | | */ |
| | | public final class UUIDOrderingMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new UUIDOrderingMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | |
| | | * and will compare values with a distinguished name and optional bit string |
| | | * suffix. |
| | | */ |
| | | public class UniqueMemberEqualityMatchingRule |
| | | class UniqueMemberEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link UniqueMemberEqualityMatchingRule}. |
| | | */ |
| | | public final class UniqueMemberEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new UniqueMemberEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.api.PasswordStorageScheme; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | |
| | | * This class implements the userPasswordMatch matching rule, which can be used |
| | | * to determine whether a clear-text value matches an encoded password. |
| | | */ |
| | | public class UserPasswordEqualityMatchingRule |
| | | class UserPasswordEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link UserPasswordExactEqualityMatchingRule}. |
| | | */ |
| | | public final class UserPasswordEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new UserPasswordEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collections; |
| | | import java.util.Collection; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | |
| | |
| | | * simply compare encoded hashed password values to see if they are exactly |
| | | * equal to each other. |
| | | */ |
| | | public class UserPasswordExactEqualityMatchingRule |
| | | class UserPasswordExactEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link UserPasswordExactEqualityMatchingRule}. |
| | | */ |
| | | public final class UserPasswordExactEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new UserPasswordExactEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | |
| | | * <LI>An equal sign</LI> |
| | | * </UL> |
| | | */ |
| | | public class WordEqualityMatchingRule |
| | | class WordEqualityMatchingRule |
| | | extends EqualityMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.admin.std.server.MatchingRuleCfg; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | /** |
| | | * This class is a factory class for |
| | | * {@link WordEqualityMatchingRule}. |
| | | */ |
| | | public final class WordEqualityMatchingRuleFactory |
| | | extends MatchingRuleFactory<MatchingRuleCfg> |
| | | { |
| | | //Associated Matching Rule. |
| | | private MatchingRule matchingRule; |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final void initializeMatchingRule(MatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | matchingRule = new WordEqualityMatchingRule(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public final Collection<MatchingRule> getMatchingRules() |
| | | { |
| | | return Collections.singleton(matchingRule); |
| | | } |
| | | } |
| | |
| | | |
| | | // The matching rule that will be used to normalize schema element |
| | | // definitions. |
| | | private EqualityMatchingRule normalizationMatchingRule; |
| | | private MatchingRule normalizationMatchingRule; |
| | | |
| | | // The set of subordinate attribute types registered within the |
| | | // server schema. |
| | |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | if (name != null) |
| | | { |
| | | MatchingRule conflictingRule = matchingRules.get(name); |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | { |
| | | MatchingRule conflictingRule = |
| | | matchingRules.get(name); |
| | | |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, |
| | | message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | matchingRules.put(toLowerCase(matchingRule.getOID()), |
| | | matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | matchingRules.put(toLowerCase(name), matchingRule); |
| | | if (name != null) |
| | | { |
| | | matchingRules.put(toLowerCase(name), matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would |
| | | // use a very expensive matching rule (OID first component |
| | |
| | | matchingRules.remove(toLowerCase(matchingRule.getOID()), |
| | | matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | matchingRules.remove(toLowerCase(name), matchingRule); |
| | | if (name != null) |
| | | { |
| | | matchingRules.remove(toLowerCase(name), matchingRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would |
| | | // use a very expensive matching rule (OID first component |
| | |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | |
| | | String name = matchingRule.getName(); |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | String oid = toLowerCase(matchingRule.getOID()); |
| | | approximateMatchingRules.put(oid, matchingRule); |
| | | matchingRules.put(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | approximateMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | approximateMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | approximateMatchingRules.remove(oid, matchingRule); |
| | | matchingRules.remove(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | approximateMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | approximateMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | { |
| | | MatchingRule conflictingRule = matchingRules.get(name); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | { |
| | | MatchingRule conflictingRule = |
| | | matchingRules.get(name); |
| | | |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, |
| | | message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | equalityMatchingRules.put(oid, matchingRule); |
| | | matchingRules.put(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | equalityMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | equalityMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | equalityMatchingRules.remove(oid, matchingRule); |
| | | matchingRules.remove(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | equalityMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | equalityMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | if (name != null) |
| | | { |
| | | MatchingRule conflictingRule = matchingRules.get(name); |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | { |
| | | MatchingRule conflictingRule = matchingRules.get(name); |
| | | |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, |
| | | message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | orderingMatchingRules.put(oid, matchingRule); |
| | | matchingRules.put(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | orderingMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | orderingMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | orderingMatchingRules.remove(oid, matchingRule); |
| | | matchingRules.remove(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | orderingMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | orderingMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | if (name != null) |
| | | { |
| | | MatchingRule conflictingRule = matchingRules.get(name); |
| | | name = toLowerCase(name); |
| | | if (matchingRules.containsKey(name)) |
| | | { |
| | | MatchingRule conflictingRule = matchingRules.get(name); |
| | | |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, message); |
| | | Message message = ERR_SCHEMA_CONFLICTING_MR_NAME. |
| | | get(matchingRule.getOID(), name, |
| | | conflictingRule.getOID()); |
| | | throw new DirectoryException( |
| | | ResultCode.CONSTRAINT_VIOLATION, |
| | | message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | substringMatchingRules.put(oid, matchingRule); |
| | | matchingRules.put(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | substringMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | substringMatchingRules.put(name, matchingRule); |
| | | matchingRules.put(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | substringMatchingRules.remove(oid, matchingRule); |
| | | matchingRules.remove(oid, matchingRule); |
| | | |
| | | String name = matchingRule.getName(); |
| | | if (name != null) |
| | | for(String name:matchingRule.getAllNames()) |
| | | { |
| | | name = toLowerCase(name); |
| | | substringMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | if (name != null) |
| | | { |
| | | name = toLowerCase(name); |
| | | substringMatchingRules.remove(name, matchingRule); |
| | | matchingRules.remove(name, matchingRule); |
| | | } |
| | | } |
| | | |
| | | // We'll use an attribute value including the normalized value |
| | | // rather than the attribute type because otherwise it would use |
| | | // a very expensive matching rule (OID first component match) |
| | |
| | | } |
| | | else |
| | | { |
| | | MatchingRule<?> mr = DirectoryServer.getMatchingRule( |
| | | MatchingRule mr = DirectoryServer.getMatchingRule( |
| | | toLowerCase(matchingRuleID)); |
| | | if (mr == null) |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | // We must have a matching rule to use in the determination. |
| | | MatchingRule<?> matchingRule = null; |
| | | MatchingRule matchingRule = null; |
| | | |
| | | if (matchingRuleID != null) |
| | | { |
| | | matchingRule = |
| | |
| | | ByteString normalizedValue; |
| | | try |
| | | { |
| | | normalizedValue = |
| | | matchingRule.normalizeValue(assertionValue.getValue()); |
| | | normalizedValue = |
| | | matchingRule. |
| | | normalizeAssertionValue(assertionValue.getValue()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | MatchingRule<?> mr = |
| | | MatchingRule mr = |
| | | DirectoryServer.getMatchingRule( |
| | | toLowerCase(matchingRuleID)); |
| | | if (mr == null) |
| | |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.IdentifiedException; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.RDN; |
| | | import org.opends.server.types.ResultCode; |
| | | import static org.opends.messages.CoreMessages.*; |
| | | |
| | | |
| | | /** |
| | |
| | | return addr != null && addr.contains("@") && addr.contains("."); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Evaluates and converts 2 consequetive characters of the provided |
| | | * string starting at startPos and converts them into a single escaped char. |
| | | * |
| | | * @param hexString The hexadecimal string containing |
| | | * the escape sequence. |
| | | * @param startPos The starting position of the hexadecimal escape |
| | | * sequence. |
| | | * |
| | | * @return The escaped character |
| | | * |
| | | * @throws DirectoryException If the provided string contains invalid |
| | | * hexadecimal digits . |
| | | */ |
| | | public static char hexToEscapedChar(String hexString,int startPos) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // The two positions must be the hex characters that |
| | | // comprise the escaped value. |
| | | if ((startPos+ 1) >= hexString.length()) |
| | | { |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE. |
| | | get(hexString, startPos+1); |
| | | |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | message); |
| | | } |
| | | byte byteValue = 0; |
| | | switch(hexString.charAt(startPos)) |
| | | { |
| | | case 0x30: // '0' |
| | | break; |
| | | case 0x31: // '1' |
| | | byteValue = (byte) 0x10; |
| | | break; |
| | | case 0x32: // '2' |
| | | byteValue = (byte) 0x20; |
| | | break; |
| | | case 0x33: // '3' |
| | | byteValue = (byte) 0x30; |
| | | break; |
| | | case 0x34: // '4' |
| | | byteValue = (byte) 0x40; |
| | | break; |
| | | case 0x35: // '5' |
| | | byteValue = (byte) 0x50; |
| | | break; |
| | | case 0x36: // '6' |
| | | byteValue = (byte) 0x60; |
| | | break; |
| | | case 0x37: // '7' |
| | | byteValue = (byte) 0x70; |
| | | break; |
| | | case 0x38: // '8' |
| | | byteValue = (byte) 0x80; |
| | | break; |
| | | case 0x39: // '9' |
| | | byteValue = (byte) 0x90; |
| | | break; |
| | | case 0x41: // 'A' |
| | | case 0x61: // 'a' |
| | | byteValue = (byte) 0xA0; |
| | | break; |
| | | case 0x42: // 'B' |
| | | case 0x62: // 'b' |
| | | byteValue = (byte) 0xB0; |
| | | break; |
| | | case 0x43: // 'C' |
| | | case 0x63: // 'c' |
| | | byteValue = (byte) 0xC0; |
| | | break; |
| | | case 0x44: // 'D' |
| | | case 0x64: // 'd' |
| | | byteValue = (byte) 0xD0; |
| | | break; |
| | | case 0x45: // 'E' |
| | | case 0x65: // 'e' |
| | | byteValue = (byte) 0xE0; |
| | | break; |
| | | case 0x46: // 'F' |
| | | case 0x66: // 'f' |
| | | byteValue = (byte) 0xF0; |
| | | break; |
| | | default: |
| | | Message message = |
| | | ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE. |
| | | get(hexString, startPos); |
| | | throw new DirectoryException( |
| | | ResultCode.PROTOCOL_ERROR, message); |
| | | } |
| | | |
| | | switch (hexString.charAt(++startPos)) |
| | | { |
| | | case 0x30: // '0' |
| | | break; |
| | | case 0x31: // '1' |
| | | byteValue |= (byte) 0x01; |
| | | break; |
| | | case 0x32: // '2' |
| | | byteValue |= (byte) 0x02; |
| | | break; |
| | | case 0x33: // '3' |
| | | byteValue |= (byte) 0x03; |
| | | break; |
| | | case 0x34: // '4' |
| | | byteValue |= (byte) 0x04; |
| | | break; |
| | | case 0x35: // '5' |
| | | byteValue |= (byte) 0x05; |
| | | break; |
| | | case 0x36: // '6' |
| | | byteValue |= (byte) 0x06; |
| | | break; |
| | | case 0x37: // '7' |
| | | byteValue |= (byte) 0x07; |
| | | break; |
| | | case 0x38: // '8' |
| | | byteValue |= (byte) 0x08; |
| | | break; |
| | | case 0x39: // '9' |
| | | byteValue |= (byte) 0x09; |
| | | break; |
| | | case 0x41: // 'A' |
| | | case 0x61: // 'a' |
| | | byteValue |= (byte) 0x0A; |
| | | break; |
| | | case 0x42: // 'B' |
| | | case 0x62: // 'b' |
| | | byteValue |= (byte) 0x0B; |
| | | break; |
| | | case 0x43: // 'C' |
| | | case 0x63: // 'c' |
| | | byteValue |= (byte) 0x0C; |
| | | break; |
| | | case 0x44: // 'D' |
| | | case 0x64: // 'd' |
| | | byteValue |= (byte) 0x0D; |
| | | break; |
| | | case 0x45: // 'E' |
| | | case 0x65: // 'e' |
| | | byteValue |= (byte) 0x0E; |
| | | break; |
| | | case 0x46: // 'F' |
| | | case 0x66: // 'f' |
| | | byteValue |= (byte) 0x0F; |
| | | break; |
| | | default: |
| | | Message message =ERR_SEARCH_FILTER_INVALID_ESCAPED_BYTE. |
| | | get(hexString, startPos); |
| | | throw new DirectoryException( |
| | | ResultCode.PROTOCOL_ERROR, message); |
| | | } |
| | | return (char)byteValue; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.EqualityMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.schema.CaseIgnoreEqualityMatchingRule; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.schema.CaseIgnoreEqualityMatchingRuleFactory; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | |
| | | |
| | |
| | | private boolean isObsolete; |
| | | |
| | | // The matching rule that will do all the real work behind the scenes. |
| | | private CaseIgnoreEqualityMatchingRule caseIgnoreMatchingRule; |
| | | private EqualityMatchingRule caseIgnoreMatchingRule; |
| | | |
| | | // The name for this matching rule. |
| | | private String name; |
| | |
| | | this.name = name; |
| | | this.oid = oid; |
| | | |
| | | caseIgnoreMatchingRule = new CaseIgnoreEqualityMatchingRule(); |
| | | caseIgnoreMatchingRule.initializeMatchingRule(null); |
| | | CaseIgnoreEqualityMatchingRuleFactory factory = |
| | | new CaseIgnoreEqualityMatchingRuleFactory(); |
| | | factory.initializeMatchingRule(null); |
| | | caseIgnoreMatchingRule = (EqualityMatchingRule)factory. |
| | | getMatchingRules().iterator().next(); |
| | | isObsolete = false; |
| | | } |
| | | |
| | |
| | | this.oid = oid; |
| | | this.isObsolete = isObsolete; |
| | | |
| | | caseIgnoreMatchingRule = new CaseIgnoreEqualityMatchingRule(); |
| | | caseIgnoreMatchingRule.initializeMatchingRule(null); |
| | | CaseIgnoreEqualityMatchingRuleFactory factory = |
| | | new CaseIgnoreEqualityMatchingRuleFactory(); |
| | | factory.initializeMatchingRule(null); |
| | | caseIgnoreMatchingRule = (EqualityMatchingRule)factory. |
| | | getMatchingRules().iterator().next(); |
| | | } |
| | | |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(EqualityMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.opends.server.api.MatchingRuleFactory; |
| | | import org.opends.server.api.MatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1Element; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.schema.BooleanEqualityMatchingRule; |
| | | import org.opends.server.schema.DistinguishedNameEqualityMatchingRule; |
| | | import org.opends.server.schema.IntegerEqualityMatchingRule; |
| | | import org.opends.server.schema.BooleanEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.DistinguishedNameEqualityMatchingRuleFactory; |
| | | import org.opends.server.schema.IntegerEqualityMatchingRuleFactory; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.ByteString; |
| | |
| | | } |
| | | |
| | | @DataProvider(name = "extensibleMatchFilterData") |
| | | public Object[][] createExtensibleMatchFilterData() |
| | | public Object[][] createExtensibleMatchFilterData() throws Exception |
| | | { |
| | | MatchingRuleFactory<?> factory = new BooleanEqualityMatchingRuleFactory(); |
| | | factory.initializeMatchingRule(null); |
| | | MatchingRule booleanEquality = factory.getMatchingRules().iterator().next(); |
| | | factory = new IntegerEqualityMatchingRuleFactory(); |
| | | factory.initializeMatchingRule(null); |
| | | MatchingRule integerEquality = factory.getMatchingRules().iterator().next(); |
| | | factory = new DistinguishedNameEqualityMatchingRuleFactory(); |
| | | factory.initializeMatchingRule(null); |
| | | MatchingRule distinguishedEquality = factory.getMatchingRules().iterator().next(); |
| | | |
| | | return new Object[][] |
| | | { |
| | | { "description", new BooleanEqualityMatchingRule(), "description" }, |
| | | { "objectclass", new IntegerEqualityMatchingRule() ,"top" }, |
| | | { "fakeobjecttype", new DistinguishedNameEqualityMatchingRule(), "fakevalue" }, }; |
| | | { "description", booleanEquality, "description" }, |
| | | { "objectclass", integerEquality ,"top" }, |
| | | { "fakeobjecttype", distinguishedEquality, "fakevalue" }, }; |
| | | } |
| | | |
| | | /** |
| | |
| | | // Create and register the approximate matching rule for testing purposes. |
| | | EqualLengthApproximateMatchingRule testApproxRule = |
| | | new EqualLengthApproximateMatchingRule(); |
| | | testApproxRule.initializeMatchingRule(null); |
| | | DirectoryServer.registerApproximateMatchingRule(testApproxRule, false); |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | |
| | | package org.opends.server.schema; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation; |
| | | import org.opends.server.protocols.ldap.LDAPFilter; |
| | | import org.opends.server.tools.LDAPModify; |
| | | import org.opends.server.types.DereferencePolicy; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.types.SearchResultEntry; |
| | | import org.opends.server.types.SearchScope; |
| | | import org.testng.annotations.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | |
| | | /** |
| | | * This Test Class tests various collation matching rules. |
| | | */ |
| | | public final class CollationMatchingRuleTest |
| | | extends SchemaTestCase |
| | | { |
| | | |
| | | /** |
| | | * Ensures that the Directory Server is running before executing the |
| | | * testcases. |
| | | * |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @BeforeClass() |
| | | public void startServer() |
| | | throws Exception |
| | | { |
| | | TestCaseUtils.startServer(); |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Test to verify an ADD of an entry containing international characters. |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void addEntry() throws Exception |
| | | { |
| | | String filePath = TestCaseUtils.createTempFile( |
| | | "dn: uid=user,o=test", |
| | | "objectClass: person", |
| | | "objectClass: organizationalPerson", |
| | | "objectClass: inetorgperson", |
| | | "objectClass: top", |
| | | "departmentNumber:: w4NiYzExMQ==", //Ãbc111 |
| | | "carLicense:: w6liZTI=", //ébe2 |
| | | "uid: user", |
| | | "cn:: U8ODbmNoZXo=", //SÃnchez |
| | | "sn:: UXXDqWJlYw=="); //Québec |
| | | String[] args = new String [] |
| | | { |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D","cn=directory manager", |
| | | "-w","password", |
| | | "-a", |
| | | "-f", filePath, |
| | | }; |
| | | int err = LDAPModify.mainModify(args, false, null,null); |
| | | assertEquals(err,0); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test to search the collation equality matching rule using OID. |
| | | */ |
| | | @Test(dependsOnMethods = {"org.opends.server.schema."+ |
| | | "CollationMatchingRuleTest.addEntry"}) |
| | | public void searchCollationEqualityUsingOID() throws Exception |
| | | { |
| | | //Search the collation rule with OID of en and no suffix in the filter. |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation( |
| | | conn, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | new ASN1OctetString("uid=user,o=test"), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | | Integer.MAX_VALUE, |
| | | false, |
| | | LDAPFilter.decode("cn:1.3.6.1.4.1.42.2.27.9.4.34.1:=sanchez"), |
| | | null, null); |
| | | |
| | | searchOperation.run(); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned. |
| | | assertNotNull(e); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test to search the collation equality matching rule using language Tag. |
| | | */ |
| | | @Test(dependsOnMethods = {"org.opends.server.schema."+ |
| | | "CollationMatchingRuleTest.addEntry"}) |
| | | public void searchCollationEqualityUsingLanguageTag() throws Exception |
| | | { |
| | | //Search the collation rule with language tag of en and no suffix |
| | | //in the filter. |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation( |
| | | conn, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | new ASN1OctetString("uid=user,o=test"), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | | Integer.MAX_VALUE, |
| | | false, |
| | | LDAPFilter.decode("cn:en:=sanchez"), |
| | | null, null); |
| | | |
| | | searchOperation.run(); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned. |
| | | assertNotNull(e); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test to search the collation Less than matching rule using OID and suffix. |
| | | */ |
| | | @Test(dependsOnMethods = {"org.opends.server.schema."+ |
| | | "CollationMatchingRuleTest.addEntry"}) |
| | | public void searchCollationLTUsingOIDSuffix() throws Exception |
| | | { |
| | | //Search the collation rule with OID of es and suffix in the filter. |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation( |
| | | conn, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | new ASN1OctetString("uid=user,o=test"), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | | Integer.MAX_VALUE, |
| | | false, |
| | | LDAPFilter. |
| | | decode("departmentnumber:1.3.6.1.4.1.42.2.27.9.4.49.1.1:=Ãbc120"), |
| | | null, null); |
| | | |
| | | searchOperation.run(); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned. |
| | | assertNotNull(e); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test to search the collation Less than Equal to matching rule using |
| | | * Language Tag and suffix. |
| | | */ |
| | | @Test(dependsOnMethods = {"org.opends.server.schema."+ |
| | | "CollationMatchingRuleTest.addEntry"}) |
| | | public void searchCollationLTEUsingLanguageSuffix() throws Exception |
| | | { |
| | | //Search the collation rule with tag of fr and suffix in the filter. |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation( |
| | | conn, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | new ASN1OctetString("uid=user,o=test"), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | | Integer.MAX_VALUE, |
| | | false, |
| | | LDAPFilter. |
| | | decode("carLicense:fr.2:=ebe2"), |
| | | null, null); |
| | | |
| | | searchOperation.run(); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned. |
| | | assertNotNull(e); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test to search the collation Greater than matching rule using language |
| | | * tag. |
| | | */ |
| | | @Test(dependsOnMethods = {"org.opends.server.schema."+ |
| | | "CollationMatchingRuleTest.addEntry"}) |
| | | public void searchCollationGTUsingLanguage() throws Exception |
| | | { |
| | | //Search the collation rule with tag of fr in the filter. |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation( |
| | | conn, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | new ASN1OctetString("uid=user,o=test"), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | | Integer.MAX_VALUE, |
| | | false, |
| | | LDAPFilter. |
| | | decode("carLicense:fr.5:=ébe1"), |
| | | null, null); |
| | | |
| | | searchOperation.run(); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned. |
| | | assertNotNull(e); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test to search the collation Greater than Equal to matching rule using |
| | | * language tag. |
| | | */ |
| | | @Test(dependsOnMethods = {"org.opends.server.schema."+ |
| | | "CollationMatchingRuleTest.addEntry"}) |
| | | public void searchCollationGTEUsingLanguage() throws Exception |
| | | { |
| | | //Search the collation rule with tag of es and suffix in the filter. |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation( |
| | | conn, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | new ASN1OctetString("uid=user,o=test"), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | | Integer.MAX_VALUE, |
| | | false, |
| | | LDAPFilter. |
| | | decode("departmentnumber:es.4:=abc111"), |
| | | null, null); |
| | | |
| | | searchOperation.run(); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned. |
| | | assertNotNull(e); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Test to search the collation substring matching rule using |
| | | * language tag and suffix. |
| | | */ |
| | | @Test(dependsOnMethods = {"org.opends.server.schema."+ |
| | | "CollationMatchingRuleTest.addEntry"}) |
| | | public void searchCollationSubstring() throws Exception |
| | | { |
| | | /*Search the collation rule with tag of en and suffix in the filter. |
| | | *It searches for string quebec against the value of sn which is |
| | | *Québec. |
| | | */ |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation( |
| | | conn, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | new ASN1OctetString("uid=user,o=test"), |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, |
| | | Integer.MAX_VALUE, |
| | | Integer.MAX_VALUE, |
| | | false, |
| | | LDAPFilter. |
| | | decode("sn:en.6:=*u*bec"), |
| | | null, null); |
| | | |
| | | searchOperation.run(); |
| | | assertEquals(searchOperation.getResultCode(), ResultCode.SUCCESS); |
| | | List<SearchResultEntry> entries = searchOperation.getSearchEntries(); |
| | | SearchResultEntry e = entries.get(0); |
| | | //An entry must be returned for sn=quebec. |
| | | assertNotNull(e); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | import org.opends.server.admin.std.server.ApproximateMatchingRuleCfg; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import org.opends.server.api.ApproximateMatchingRule; |
| | | import org.opends.server.config.ConfigEntry; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ByteStringFactory; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | |
| | |
| | | * consider two values approximately equal only if they have the same length. |
| | | * It is intended purely for testing purposes. |
| | | */ |
| | | public class EqualLengthApproximateMatchingRule |
| | | class EqualLengthApproximateMatchingRule |
| | | extends ApproximateMatchingRule |
| | | { |
| | | /** |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void initializeMatchingRule(ApproximateMatchingRuleCfg configuration) |
| | | throws ConfigException, InitializationException |
| | | public Collection<String> getAllNames() |
| | | { |
| | | // No initialization is required. |
| | | return Collections.singleton(getName()); |
| | | } |
| | | |
| | | |
| | |
| | | TreeSet<String> invalidOIDs = new TreeSet<String>(); |
| | | |
| | | Schema schema = DirectoryServer.getSchema(); |
| | | for (MatchingRule<?> mr : schema.getMatchingRules().values()) |
| | | for (MatchingRule mr : schema.getMatchingRules().values()) |
| | | { |
| | | if (! isNumericOID(mr.getOID())) |
| | | { |