Entry Definition
There are 2 types of entries:
- Static entry
This entry has a constant RDN, it represents a single entry in the resulting virtual directory. - Dynamic entry
This entry has a dynamic RDN, it represents multiple entries in the resulting virtual directory.
An entry definition includes the definition of the attributes, the mapping to the data sources, access control, etc. The configuration can be found in PENROSE_HOME/conf/mapping.xml.
<mapping> <entry dn="..."> <oc>...</oc> <at name="..." rdn="..."> <expression>...</expression> </at> <source name="..."> <source-name>...</source-name> <field name="..."> <expression>...</expression> </field> </source> <relationship> <expression>...</expression> </relationship> <aci ...> ... </aci> <parameter> <param-name>...</param-name> <param-value>...</param-value> </parameter> </entry> </mapping>
To define an entry, you need to specify:
- Distinguished Name (DN)
Specify the entry's DN. Static entries use static RDNs (e.g. ou=Users,dc=Example,dc=org). Dynamic entries use "..." in the RDN values (e.g. uid=...,ou=Users,dc=Example,dc=org).
- Object Class
Specify the object classes for this entry.
- Attributes
Specify the attribute name and the expression for computing the attribute's values. See Attribute Mappings.
- Sources
Specify the sources needed in this mapping, and also the expressions to compute the value of each fields. See Source and Field Mappings.
- Relationships
Specify the relationships between the sources.
- Access Control Instruction
See Access Control.
- Parameters
Specify any additional parameters.
Cache
Each dynamic entry has 2 caches:
- Filter cache
It stores the RDNs resulting from search operations. - Data cache
It stores the full entry data resulting from search operations.
When Penrose accepts a search request, first it checks the filter cache. If the requested filter is not in the cache, it will perform a search operation on the mapped sources to get the RDNs of the entries. The resulting RDNs will be stored in the cache.
With a set of RDNs obtained from the above operation, Penrose will try to load the data. If the data is not in the data cache, it will perform a load operation to get the full entry data and store it in the cache.
To configure the cache, add the following parameters:
| Parameter | Description | Valid Values | Default |
|---|---|---|---|
| filterCacheSize | Filter cache size | integer > 0 | 100 |
| filterCacheExpiration | Filter cache expiration (in minutes) | integer >= 0 | 5 |
| dataCacheSize | Data cache size | integer > 0 | 100 |
| dataCacheExpiration | Data cache expiration (in minutes) | integer >= 0 | 5 |
You can set the cache expiration to 0 to disable the cache. In this case all requests will always be performed against the datasource.
Examples
The following is an example how to define a static entry.
<mapping> <entry dn="dc=Example,dc=com"> <oc>dcObject</oc> <oc>organization</oc> <at name="dc" rdn="true"> <expression>"Example"</expression> </at> <at name="o"> <expression>"Example"</expression> </at> </entry> </mapping>
This mapping rule defines the entry dc=Example,dc=com. The entry has 2 object classes: dcObject and organization. The values of dc and o attribute are string constants "Example".
See the Mapping Rules for examples of dynamic entries.