/** * {@inheritDoc} */ @Override public void add( Entry entry, LogChange log ) throws LdapException { AddOperationContext addContext = new AddOperationContext( this, entry ); addContext.setLogChange( log ); OperationManager operationManager = directoryService.getOperationManager(); operationManager.add( addContext ); }
/** * {@inheritDoc} */ @Override public void add( Entry entry, boolean ignoreReferral, LogChange log ) throws LdapException { AddOperationContext addContext = new AddOperationContext( this, entry ); addContext.setLogChange( log ); setReferralHandling( addContext, ignoreReferral ); OperationManager operationManager = directoryService.getOperationManager(); operationManager.add( addContext ); }
operationManager.add( addContext );
/** * {@inheritDoc} */ @Override public void add( AddRequest addRequest, LogChange log ) throws LdapException { AddOperationContext addContext = new AddOperationContext( this, addRequest ); addContext.setLogChange( log ); OperationManager operationManager = directoryService.getOperationManager(); try { operationManager.add( addContext ); } catch ( LdapException e ) { addRequest.getResultResponse().addAllControls( addContext.getResponseControls() ); throw e; } addRequest.getResultResponse().addAllControls( addContext.getResponseControls() ); }
/** * Used to encapsulate [de]marshalling of controls before and after add operations. * * @param target The entry's Dn to add * @param entry The entry to add * @throws Exception If the add failed */ protected void doAddOperation( Dn target, Entry entry ) throws Exception { // setup the op context and populate with request controls AddOperationContext opCtx = new AddOperationContext( session, entry ); opCtx.addRequestControls( convertControls( true, requestControls ) ); // Inject the referral handling into the operation context injectReferralControl( opCtx ); // execute add operation OperationManager operationManager = service.getOperationManager(); operationManager.add( opCtx ); // clear the request controls and set the response controls requestControls = EMPTY_CONTROLS; responseControls = JndiUtils.toJndiControls( getDirectoryService().getLdapCodecService(), opCtx.getResponseControls() ); }