}
exclusions = new HashSet();
for ( int ii = 0; ii < collectiveExclusions.size(); ii++ )
{
AttributeType attrType = registry.lookup( ( String ) collectiveExclusions.get( ii ) );
exclusions.add( attrType.getOid() );
}
}
else
{
exclusions = Collections.EMPTY_SET;
}
/*
* For each collective subentry referenced by the entry we lookup the
* attributes of the subentry and copy collective attributes from the
* subentry into the entry.
*/
for ( int ii = 0; ii < subentries.size(); ii++ )
{
String subentryDnStr = ( String ) subentries.get( ii );
Name subentryDn = new LdapName( subentryDnStr );
Attributes subentry = nexus.lookup( subentryDn );
NamingEnumeration attrIds = subentry.getIDs();
while ( attrIds.hasMore() )
{
String attrId = ( String ) attrIds.next();
AttributeType attrType = registry.lookup( attrId );
// skip the addition of this collective attribute if it is excluded
if ( exclusions.contains( attrType.getOid() ) )
{
continue;
}
/*
* If the attribute type of the subentry attribute is collective
* then we need to add all the values of the collective attribute
* to the entry making sure we do not overwrite values already
* existing for the collective attribute in case multiple
* subentries add the same collective attributes to this entry.
*/
if ( attrType.isCollective() )
{
Attribute subentryColAttr = subentry.get( attrId );
Attribute entryColAttr = entry.get( attrId );
// if entry does not have attribute for colattr then create it