}
Iterator<QPathEntryFilter> patternIterator = uncachedPatterns.iterator();
while (patternIterator.hasNext())
{
QPathEntryFilter pattern = patternIterator.next();
if (pattern.isExactName())
{
DataRequest exactNameRequest = new DataRequest(nodeData.getIdentifier(), pattern.getQPathEntry());
exactNameRequest.start();
requests.add(exactNameRequest);
ItemData data = getCachedItemData(nodeData, pattern.getQPathEntry(), ItemType.PROPERTY);
if (data != null)
{
if (!(data instanceof NullPropertyData))
{
childPropsMap.put(data.getIdentifier(), (PropertyData)data);
}
patternIterator.remove();
}
}
else
{
// get properties list by pattern
List<PropertyData> cachedItemList = cache.getChildProperties(nodeData, pattern);
if (cachedItemList != null)
{
//merge results
for (int j = 0, length = cachedItemList.size(); j < length; j++)
{
childPropsMap.put(cachedItemList.get(j).getIdentifier(), cachedItemList.get(j));
}
patternIterator.remove();
}
}
}
patternIterator = null;
// execute all patterns and put result in cache
if (!uncachedPatterns.isEmpty())
{
executeAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws RepositoryException
{
List<PropertyData> persistedItemList =
CacheableWorkspaceDataManager.super.getChildPropertiesData(nodeData,
new ArrayList<QPathEntryFilter>(uncachedPatterns));
if (persistedItemList.size() > 0)
{
NodeData parent = (NodeData)getItemData(nodeData.getIdentifier());
if (parent != null)
{
// filter properties list for each exact name
Iterator<QPathEntryFilter> patternIterator = uncachedPatterns.iterator();
while (patternIterator.hasNext())
{
QPathEntryFilter pattern = patternIterator.next();
@SuppressWarnings("unchecked")
List<PropertyData> persistedPropData =
(List<PropertyData>)pattern.accept(persistedItemList);
if (pattern.isExactName())
{
if (persistedPropData.isEmpty())
{
cache.put(new NullPropertyData(parent, pattern.getQPathEntry()));
}
else
{
cache.put(persistedPropData.get(0));
}