定制属性用于配置高级设置,这些高级设置在联合存储库中提供一些其他功能。
添加了 preFetchData 定制属性,以针对 LDAP 存储库为用户或组实体类型支持预取和高速缓存一组属性。通过使用此属性,可定义要为特定用户或组实体类型永久预取和高速缓存的属性的列表。
信息 | 值 |
---|---|
数据类型 | 字符串 |
有效值 | 包含由实体类型名称及其属性集组成的对的字符串 |
EntityType1:attribute1,attribute2;EntityType2:attribute1,attribute2
如果为这些属性指定的格式或值不正确,那么可能会看到类似于下列示例的异常:
com.ibm.websphere.wim.exception.WIMConfigurationException:
CWWIM1043E: “preFetchData”属性的值的格式无效。请指定有效值,例如,“PersonAccount:sn,mail;Group:cn,description”。
com.ibm.websphere.wim.exception.WIMConfigurationException:
CWWIM5068E: 实体类型“abc”无效。
其中 abc 是 preFetchData
属性的配置中提供的无效实体类型的名称。会显示该消息,并且指出已配置的实体类型的名称。com.ibm.websphere.wim.exception.WIMConfigurationException:
CWWIM4516E 对于“组”实体类型,未定义“uid1”属性。
其中
uid1 是 preFetchData 属性的配置中提供的组实体类型的无效属性名。会显示该消息,并且指出已配置的属性和实体类型名称。$AdminTask setIdMgrCustomProperty {-id <ldap_repository_name> -name <property_name> -value <value>}
例如:$AdminTask setIdMgrCustomProperty {-id LDAP1 -name
preFetchData -value “PersonAccount:sn,cn,givenName,displayName,preferredLanguage;Group:cn,description”}<config:repositories xsi:type="config:LdapRepositoryType" adapterClassName="com.ibm.ws.wim.adapter.ldap.LdapAdapter"
id="LDAP1" isExtIdUnique="true" supportAsyncMode="false" supportExternalName="false"
supportPaging="false" supportSorting="false" supportTransactions="false" certificateFilter=""
certificateMapMode="exactdn" ldapServerType="IDS" translateRDN="false">
<config:baseEntries name="o=ldap" nameInRepository="o=ldap"/>
<config:loginProperties>uid</config:loginProperties>
<config:CustomProperties name="preFetchData" value="PersonAccount:sn,cn,givenName,displayName,preferredLanguage;Group:cn,description"/>
<config:ldapServerConfiguration primaryServerQueryTimeInterval="15" returnToPrimaryServer="true"
sslConfiguration="">
<config:ldapServers authentication="simple" bindDN="cn=root" bindPassword="{xor}LTAwK25tbA=="
connectionPool="false" connectTimeout="0" derefAliases="always" referal="ignore"
sslEnabled="false">
<config:connections host="localhost" port="389"/>
</config:ldapServers>
</config:ldapServerConfiguration>
</config:repositories>
当第一次为 user1 执行操作时,还会检索到 sn 属性,并将其与该用户的登录属性一起进行高速缓存,虽然在查询期间,对于 sn,不存在任何显式请求。对于将 user1 作为成员包含的组,会高速缓存 cn 属性。对于后续调用,会先在高速缓存中查找要检索的数据,并且仅当找不到该数据时,才会针对所需属性进行 JNDI 调用。
当针对组 g1 运行搜索时,联合存储库会根据您已指定的配置检索并高速缓存组 cn。如果后续调用搜索 cn 和 description 属性,那么会接着从高速缓存访存 cn,并且会进行显式 JNDI 调用以访存组 description。
可使用此属性查找在运行时任何可用的 LDAP 服务器,针对特定域名,在 LDAP 存储库的 DNS 配置文件中定义了该 LDAP 服务器。
信息 | 值 |
---|---|
数据类型 | 字符串 |
有效值 | 域的名称,对于该域,在 DNS 配置文件中定义了 LDAP 服务器记录 |
除了主服务器配置之外,还可在联合 LDAP 存储库配置中配置故障转移服务器。如果主服务器关闭,那么联合存储库会切换至故障转移服务器。如果存在大量为其定义了用户和组的 LDAP 服务器,那么在联合 LDAP 存储库配置中指定所有 LDAP 服务器名称会变得很困难。如果在 WebSphere Application Server 中配置了大量节点,并且每个节点都配置为具有多个 LDAP,那么配置会变得更困难并且要用更长时间。当存在大量 LDAP 服务器时,请使用 domainNameForAutomaticDiscoveryOfLDAPServers 属性在运行时动态查找这些 LDAP 服务器名称,不管在 LDAP 存储库中配置了哪个 LDAP 服务器。
ldap._tcp.ibm.com 86400 IN SRV 0 0 389 bigbox.ibm.com
ldap._tcp.ibm.com 86400 IN SRV 10 20 1389 smallbox1.ibm.com
如果设置了
domainNameForAutomaticDiscoveryOfLDAPServers 属性,那么联合存储库会从 DNS 配置文件中查找 LDAP 服务器,并对该特定服务器进行后续
JNDI 调用。可通过使用以下 setIdMgrCustomProperty 命令来设置 domainNameForAutomaticDiscoveryOfLDAPServers 属性:$AdminTask setIdMgrCustomProperty {-id <ldap_repository_name> -name <property_name> -value <value>}
$AdminTask setIdMgrCustomProperty {-id LDAP1 -name domainNameForAutomaticDiscoveryOfLDAPServers -value “dc=ibm,dc=com”}
<config:repositories xsi:type="config:LdapRepositoryType" adapterClassName="com.ibm.ws.wim.adapter.ldap.LdapAdapter"
id="LDAP1" isExtIdUnique="true" supportAsyncMode="false" supportExternalName="false"
supportPaging="false" supportSorting="false" supportTransactions="false" certificateFilter=""
certificateMapMode="exactdn" ldapServerType="IDS" translateRDN="false">
<config:baseEntries name="o=ldap" nameInRepository="o=ldap"/>
<config:loginProperties>uid</config:loginProperties>
<config:CustomProperties name="domainNameForAutomaticDiscoveryOfLDAPServers" value="dc=ibm,dc=com"/>
<config:ldapServerConfiguration primaryServerQueryTimeInterval="15" returnToPrimaryServer="true"
sslConfiguration="">
<config:ldapServers authentication="simple" bindDN="cn=root" bindPassword="{xor}LTAwK25tbA=="
connectionPool="false" connectTimeout="0" derefAliases="always" referal="ignore"
sslEnabled="false">
<config:connections host="localhost" port="389"/>
</config:ldapServers>
</config:ldapServerConfiguration>
</config:repositories>
domainNameForAutomaticDiscoveryOfLDAPServers
属性会覆盖 LDAP 存储库中设置的 LDAP 服务器配置,并从 DNS 配置文件中检索 LDAP 服务器名称和端口号。系统会生成以下联合 LDAP 存储库 URL 并使用它来搜索 LDAP 服务器记录:ldap:///dc=ibm,dc=com。
如果 JNDI 以域名形式接收到该 URL,那么会从 DNS 配置文件中检索到 LDAP 服务器。如果其中一个 LDAP 服务器关闭,那么 JNDI 会启动在该域的 DNS 配置文件中定义的另一 LDAP 服务器。
信息 | 值 |
---|---|
数据类型 | Boolean |
缺省值 | True |
信息 | 值 |
---|---|
数据类型 | 整数 |
缺省值 | 5 |
信息 | 值 |
---|---|
数据类型 | 毫秒 |
缺省值 | 1000 |