*/
protected Entry doLookupOperation( Dn target, String[] attrIds ) throws Exception
{
// setup the op context and populate with request controls
// execute lookup/getRootDSE operation
LookupOperationContext lookupContext = new LookupOperationContext( session, target, attrIds );
lookupContext.addRequestControls( convertControls( true, requestControls ) );
OperationManager operationManager = service.getOperationManager();
Entry serverEntry = operationManager.lookup( lookupContext );
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
responseControls = JndiUtils.toJndiControls(
getDirectoryService().getLdapCodecService(),
lookupContext.getResponseControls() );
// Now remove the ObjectClass attribute if it has not been requested
if ( ( lookupContext.getReturningAttributes() != null ) && ( lookupContext.getReturningAttributes().size() != 0 ) &&
( ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ) != null )
&& ( serverEntry.get( SchemaConstants.OBJECT_CLASS_AT ).size() == 0 ) ) )
{
serverEntry.removeAttributes( SchemaConstants.OBJECT_CLASS_AT );
}