}
else
{
// get base DNs from namingContexts attribute
Set<String> namingContextSet = new HashSet<String>();
IAttribute attribute = browserConnection.getRootDSE().getAttribute(
IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS );
if ( attribute != null )
{
String[] values = attribute.getStringValues();
for ( int i = 0; i < values.length; i++ )
{
namingContextSet.add( values[i] );
}
}
if ( !namingContextSet.isEmpty() )
{
for ( String namingContext : namingContextSet )
{
if ( !"".equals( namingContext ) ) { //$NON-NLS-1$
try
{
LdapDN dn = new LdapDN( namingContext );
IEntry entry = browserConnection.getEntryFromCache( dn );
if ( entry == null )
{
entry = new BaseDNEntry( dn, browserConnection );
browserConnection.cacheEntry( entry );
}
rootDseEntries.put( dn, entry );
}
catch ( InvalidNameException e )
{
monitor.reportError( BrowserCoreMessages.model__error_setting_base_dn, e );
}
}
else
{
// special handling of empty namingContext (Novell eDirectory):
// perform a one-level search and add all result DNs to the set
searchRootDseEntries( browserConnection, rootDseEntries, monitor );
}
}
}
else
{
// special handling of non-existing namingContexts attribute (Oracle Internet Directory)
// perform a one-level search and add all result DNs to the set
searchRootDseEntries( browserConnection, rootDseEntries, monitor );
}
}
// 2nd: add schema sub-entry
IEntry[] schemaEntries = getDirectoryMetadataEntries( browserConnection,
IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY );
for ( IEntry entry : schemaEntries )
{
if ( entry instanceof DirectoryMetadataEntry )
{
( ( DirectoryMetadataEntry ) entry ).setSchemaEntry( true );
}
rootDseEntries.put( entry.getDn(), entry );
}
// get other meta data entries
IAttribute[] rootDseAttributes = browserConnection.getRootDSE().getAttributes();
if ( rootDseAttributes != null )
{
for ( IAttribute attribute : rootDseAttributes )
{
IEntry[] metadataEntries = getDirectoryMetadataEntries( browserConnection, attribute.getDescription() );
for ( IEntry entry : metadataEntries )
{
rootDseEntries.put( entry.getDn(), entry );
}
}