// Call the operation
boolean result = operationManager.compare( (CompareOperationContext)opContext );
// setup the op context and populate with request controls
opContext = new SearchOperationContext( session, dn, filter,
searchControls );
((SearchOperationContext)opContext).setAliasDerefMode( aliasDerefMode );
opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
( ( SearchOperationContext ) opContext ).setTypesOnly( typesOnly );
if ( result )
{
ServerEntry emptyEntry = new DefaultServerEntry( service.getSchemaManager(), DN.EMPTY_DN );
return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>( emptyEntry ), (SearchOperationContext)opContext );
}
else
{
return new BaseEntryFilteringCursor( new EmptyCursor<ServerEntry>(), (SearchOperationContext)opContext );
}
}
else
{
// It's a Search
// setup the op context and populate with request controls
opContext = new SearchOperationContext( session, dn, filter, searchControls );
( ( SearchOperationContext ) opContext ).setAliasDerefMode( aliasDerefMode );
opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
( ( SearchOperationContext ) opContext ).setTypesOnly( typesOnly );
// Inject the referral handling into the operation context