Change directories to WLS_HOMEserverlib.

7-8 Oracle Fusion Middleware Developers Guide for Oracle Identity Manager

7.5 About Mapped Values

You can use mapped values to setup and provide contextual information on the environment. With simple mapped values, a hashed table is built in which you can store a one-to-one mapping of values. The plug-in framework uses the following logic to determine a simple mapped value: ■ If the attribute has a mapping specified for a given method, that mapping is used. ■ If the attribute uses the same mapping for all methods, that mapping is always used. ■ Otherwise, if no mapping is specified, a NoSuchMappingException is thrown. ■ If the mappings attribute is declared, it is used as the key to look up the value in the provided HashMap. ■ If the mappings attribute is not declared but the mappings value is declared, that value is returned. Here is an example that shows how the hash map is built and used: public boolean evaluateString password { MapString, Object ro = new HashMapString, Object; ro.putsmvalue1, value; ro.putsmattr2, value2; Using the mappings declared in Example 22-1, attr1 would have the value of smvalue1. String attr1 = PluginFramework.getMappedValuethis, ro, attr1, evaluate; Using the mappings declared in Example 22-1, attr1 would have the value of value2 String attr2 = PluginFramework.getMappedValuethis, ro, attr2, evaluate; Here, Example 22-1 refers to an example plugin.xml, as shown in Example 7–1 : Example 7–1 Example Plugin.xml ?xml version=1.0 encoding=UTF-8? oimplugininstances plugininstances name=CustomPasswordElementInstance plugin=num pwd element pluginpoint=oracle.iam.sample.passwdmgmt.service.PasswordElement version=1.0.1 metadata name=meta1 value1value metadata mapping method=evaluate simple-mapping name=attr1 entity-type=User value=smvalue1 runtime-mapping name=phone entity-type=User attribute=phonenumber value=NA mapping mapping simple-mapping name=attr1 entity-type=User value=value1 simple-mapping name=attr2 entity-type=User attribute=smattr2 runtime-mapping name=fname entity-type=User attribute=firstname runtime-mapping name=lname entity-type=User attribute=lastname mapping descriptionTest class for plugin mapped valuedescription plugininstances oimplugininstances