* @param monitor the progress monitor
*/
private static boolean mustReload( LdapDN schemaLocation, IBrowserConnection browserConnection,
StudioProgressMonitor monitor )
{
Schema schema = browserConnection.getSchema();
try
{
SearchParameter sp = new SearchParameter();
sp.setSearchBase( schemaLocation );
sp.setFilter( Schema.SCHEMA_FILTER );
sp.setScope( SearchScope.OBJECT );
sp.setReturningAttributes( new String[]
{ SchemaConstants.CREATE_TIMESTAMP_AT, SchemaConstants.MODIFY_TIMESTAMP_AT } );
NamingEnumeration<SearchResult> enumeration = SearchRunnable.search( browserConnection, sp, monitor );
while ( enumeration != null && enumeration.hasMore() )
{
String createTimestamp = null;
String modifyTimestamp = null;
SearchResult sr = enumeration.next();
NamingEnumeration<? extends Attribute> attributes = sr.getAttributes().getAll();
while ( attributes.hasMore() )
{
Attribute attribute = attributes.next();
if ( attribute.getID().equalsIgnoreCase( SchemaConstants.MODIFY_TIMESTAMP_AT ) )
{
modifyTimestamp = ( String ) attribute.get();
}
if ( attribute.getID().equalsIgnoreCase( SchemaConstants.CREATE_TIMESTAMP_AT ) )
{
createTimestamp = ( String ) attribute.get();
}
}
String schemaTimestamp = modifyTimestamp != null ? modifyTimestamp : createTimestamp;
String cacheTimestamp = schema.getModifyTimestamp() != null ? schema.getModifyTimestamp() : schema
.getCreateTimestamp();
if ( cacheTimestamp != null && schemaTimestamp != null
&& schemaTimestamp.compareTo( cacheTimestamp ) > 0 )
{
return true;