public abstract class AbstractAggregatingDefaultQueryPersonAttributeDao extends AbstractDefaultAttributePersonAttributeDao
| Property | Description | Required | Default |
|---|---|---|---|
| personAttributeDaos |
A List of IPersonAttributeDaos to aggregate attributes from.
|
Yes | null |
| attrMerger |
A IAttributeMerger strategy to use for merging the attributes from
the List of IPersonAttributeDaos.
|
No | MultivaluedAttributeMerger |
| recoverExceptions |
Sets the action to be taken if one of the IPersonAttributeDaos in the
List fails with a RuntimeException. If set to true a warn level
log message and stack trace will be logged. If set to false an error level
message and stack trace will be logged and the exception will re-thrown.
|
No | true |
| stopOnSuccess | If true iteration of the child DAOs will stop after the first one that returns without throwing an exception. This is intended to provide fail-over among attribute sources. The recoverExceptions should be set to true for this to function as expected | No | false |
| Modifier and Type | Field and Description |
|---|---|
protected IAttributeMerger |
attrMerger
Strategy for merging together the results from successive PersonAttributeDaos.
|
protected List<IPersonAttributeDao> |
personAttributeDaos
A List of child IPersonAttributeDao instances which we will poll in order.
|
protected boolean |
recoverExceptions
True if we should catch, logger, and ignore Throwables propogated by
individual DAOs.
|
protected boolean |
stopOnSuccess |
loggerWILDCARD, WILDCARD_PATTERN| Constructor and Description |
|---|
AbstractAggregatingDefaultQueryPersonAttributeDao() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Set<IPersonAttributes> |
getAttributesFromDao(Map<String,List<Object>> seed,
boolean isFirstQuery,
IPersonAttributeDao currentlyConsidering,
Set<IPersonAttributes> resultPeople)
Call to execute the appropriate query on the current
IPersonAttributeDao. |
Set<String> |
getAvailableQueryAttributes()
Merges the results of calling
IPersonAttributeDao.getAvailableQueryAttributes() on each child dao using
the configured IAttributeMerger.mergeAvailableQueryAttributes(Set, Set). |
IAttributeMerger |
getMerger()
Get the strategy whereby we accumulate attributes.
|
Set<IPersonAttributes> |
getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query)
Iterates through the configured
List of IPersonAttributeDao
instances. |
List<IPersonAttributeDao> |
getPersonAttributeDaos()
Get an unmodifiable
List of delegates which we will poll for attributes. |
Set<String> |
getPossibleUserAttributeNames()
Merges the results of calling
IPersonAttributeDao.getPossibleUserAttributeNames() on each child dao using
the configured IAttributeMerger.mergePossibleUserAttributeNames(Set, Set). |
boolean |
isRecoverExceptions()
True if this class will catch exceptions thrown by its delegate DAOs
and fail to propogate them.
|
boolean |
isStopOnSuccess() |
void |
setMerger(IAttributeMerger merger)
Set the strategy whereby we accumulate attributes from the results of
polling our delegates.
|
void |
setPersonAttributeDaos(List<IPersonAttributeDao> daos)
Set the
List of delegates which we will poll for attributes. |
void |
setRecoverExceptions(boolean recover)
Set to true if you would like this class to swallow RuntimeExceptions
thrown by its delegates.
|
void |
setStopOnSuccess(boolean stopOnSuccess)
If true iteration of the child DAOs will stop after the first one that returns without
throwing an exception.
|
getPerson, getUsernameAttributeProvider, setUsernameAttributeProvider, toSeedMapgetPeople, toMultivaluedSeedflattenResults, getMultivaluedUserAttributes, getMultivaluedUserAttributes, getUserAttributes, getUserAttributesprotected List<IPersonAttributeDao> personAttributeDaos
protected IAttributeMerger attrMerger
protected boolean recoverExceptions
protected boolean stopOnSuccess
public AbstractAggregatingDefaultQueryPersonAttributeDao()
public Set<IPersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query)
List of IPersonAttributeDao
instances. The results from each DAO are merged into the result Map
by the configured IAttributeMerger.protected abstract Set<IPersonAttributes> getAttributesFromDao(Map<String,List<Object>> seed, boolean isFirstQuery, IPersonAttributeDao currentlyConsidering, Set<IPersonAttributes> resultPeople)
IPersonAttributeDao. Provides extra information
beyond the seed for the state of the query chain and previous results.seed - The seed for the original query.isFirstQuery - If this is the first query, this will stay true until a call to this method returns (does not throw an exception).currentlyConsidering - The IPersonAttributeDao to execute the query on.resultPeople - The Map of results from all previous queries, may be null.IPersonAttributeDao.getUserAttributes(Map).public final Set<String> getPossibleUserAttributeNames()
IPersonAttributeDao.getPossibleUserAttributeNames() on each child dao using
the configured IAttributeMerger.mergePossibleUserAttributeNames(Set, Set). If all children return null
this method returns null as well. If any child does not return null this method will not return null.public Set<String> getAvailableQueryAttributes()
IPersonAttributeDao.getAvailableQueryAttributes() on each child dao using
the configured IAttributeMerger.mergeAvailableQueryAttributes(Set, Set). If all children return null this
method returns null as well. If any child does not return null this method will not return null.public final IAttributeMerger getMerger()
public final void setMerger(IAttributeMerger merger)
merger - The attrMerger to set.IllegalArgumentException - If merger is null.public final List<IPersonAttributeDao> getPersonAttributeDaos()
List of delegates which we will poll for attributes.public final void setPersonAttributeDaos(List<IPersonAttributeDao> daos)
List of delegates which we will poll for attributes.daos - The personAttributeDaos to set.IllegalArgumentException - If daos is null.public final boolean isRecoverExceptions()
public final void setRecoverExceptions(boolean recover)
recover - whether you would like exceptions recovered internallypublic boolean isStopOnSuccess()
public void setStopOnSuccess(boolean stopOnSuccess)
stopOnSuccess - If the first valid results should be returned, defaults to falseCopyright © 2015 Jasig. All Rights Reserved.