Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This configuration will query three IPersonAttributeDaos in order and merge their results using the default IAttributeMerger which is the MultivaluedAttributeMerger.

Configuration

MergingPersonAttributeDaoImpl has an anonymous constructor.

Property

Type

Default Value

 

defaultAttribute

String

username

The attribute name to use for calls to IPerson getPerson(String). A query Map is generated for these calls using the defaultAttribute and the value passed in.

personAttributeDaos

List<IPersonAttributeDao>

null

A List of IPersonAttributeDaos to be queried and have their results merged.

attrMerger

IAttributeMerger

new MultivaluedAttributeMerger()

The result set merging strategy to be used. See the Merging Strategies section for more information on available options.

recoverExceptions

boolean

true

If an exception thrown by a child IPersonAttributeDao

Merging Strategies

Both merging daos use the IAttributeMerger to actually put the multiple results together. Person Directory ships with three implementations of this interface.

MultivaluedAttributeMerger

Merging of the Sets of IPersons is additive. For IPersons with the same name the person's attributes are merged into multi-valued lists.

As an example of this for two IPersons with the same name where:

  • IPerson A has attributes {email=eric.dalquist@example.com, phone=123-456-7890}
  • IPerson B has attributes {phone=[111-222-3333, 000-999-8888], office=3233}
  • The resulting merged IPerson would have attributes: {email=eric.dalquist@example.com, phone=[123-456-7890, 111-222-3333, 000-999-8888], office=3233}

NoncollidingAttributeAdder

Merging of the Sets of IPersons is additive. For IPersons with the same name the person's attributes are merged such that only attributes on the second IPerson that don't already exist on the first IPerson are merged in.

As an example of this for two IPersons with the same name where:

  • IPerson A has attributes {email=eric.dalquist@example.com, phone=123-456-7890}
  • IPerson B has attributes {phone=[111-222-3333, 000-999-8888], office=3233}
  • The resulting merged IPerson would have attributes: {email=eric.dalquist@example.com, phone=123-456-7890, office=3233}