/** * {@inheritDoc} */ @Override public Entry lookup( Dn dn, Control[] controls, String... attrIds ) throws LdapException { OperationManager operationManager = directoryService.getOperationManager(); LookupOperationContext lookupContext = new LookupOperationContext( this, dn, attrIds ); if ( controls != null ) { lookupContext.addRequestControls( controls ); } return operationManager.lookup( lookupContext ); }
/** * Used to encapsulate [de]marshalling of controls before and after lookup operations. * * @param target The Dn we are looking for * @return The found entry * @throws Exception If the lookup failed */ protected Entry doLookupOperation( Dn target ) throws Exception { // setup the op context and populate with request controls // execute lookup/getRootDSE operation LookupOperationContext lookupContext = new LookupOperationContext( session, target ); 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() ); return serverEntry; }
lookupContext.addRequestControls( convertControls( true, requestControls ) ); OperationManager operationManager = service.getOperationManager(); Entry serverEntry = operationManager.lookup( lookupContext );