&& !"".equals( browserConnection.getBaseDN().toString() ) )
{
// only add the specified base DN
try
{
LdapDN dn = browserConnection.getBaseDN();
IEntry entry = browserConnection.getEntryFromCache( dn );
if ( entry == null )
{
entry = new BaseDNEntry( new LdapDN( dn ), browserConnection );
browserConnection.cacheEntry( entry );
}
rootDseEntries.put( dn, entry );
}
catch ( InvalidNameException e )
{
monitor.reportError( BrowserCoreMessages.model__error_setting_base_dn, e );
}
}
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] );
}
}
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( new LdapDN( dn ), browserConnection );
browserConnection.cacheEntry( entry );
}
rootDseEntries.put( dn, entry );
}
catch ( InvalidNameException e )