{
entry = ( Attributes ) rec.getAttributes().clone();
}
else if ( attrIdsHasPlus )
{
entry = new LockableAttributesImpl();
// add all listed attributes
for ( int ii = 0; ii < attrIds.length; ii++ )
{
if ( attrIds[ii].equals( "+") )
{
continue;
}
// there is no attribute by that name in the entry so we continue
if ( null == rec.getAttributes().get( attrIds[ii] ) )
{
continue;
}
// clone attribute to stuff into the new resultant entry
Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone();
entry.put( attr );
}
// add all operational attributes
NamingEnumeration list = rec.getAttributes().getIDs();
while ( list.hasMore() )
{
String attrId = ( String ) list.next();
AttributeType attrType = registry.lookup( attrId );
if ( attrType.getUsage() == UsageEnum.USERAPPLICATIONS )
{
continue;
}
Attribute attr = ( Attribute ) rec.getAttributes().get( attrId ).clone();
entry.put( attr );
}
}
else if ( attrIdsHasStar )
{
entry = new LockableAttributesImpl();
// add all listed operational attributes
for ( int ii = 0; ii < attrIds.length; ii++ )
{
if ( attrIds[ii].equals( "*") )
{
continue;
}
// there is no attribute by that name in the entry so we continue
if ( null == rec.getAttributes().get( attrIds[ii] ) )
{
continue;
}
// clone attribute to stuff into the new resultant entry
Attribute attr = ( Attribute ) rec.getAttributes().get( attrIds[ii] ).clone();
entry.put( attr );
}
// add all user attributes
NamingEnumeration list = rec.getAttributes().getIDs();
while ( list.hasMore() )
{
String attrId = ( String ) list.next();
AttributeType attrType = registry.lookup( attrId );
if ( attrType.getUsage() == UsageEnum.USERAPPLICATIONS )
{
Attribute attr = ( Attribute ) rec.getAttributes().get( attrId ).clone();
entry.put( attr );
}
}
}
else
{
entry = new LockableAttributesImpl();
for ( int ii = 0; ii < attrIds.length; ii++ )
{
// there is no attribute by that name in the entry so we continue
if ( null == rec.getAttributes().get( attrIds[ii] ) )