AddOperationContext addContext = new AddOperationContext( null, contextEntry ); addContext.setPartition( this ); addContext.setTransaction( this.beginWriteTransaction() ); AddOperationContext addContext = new AddOperationContext( null, entry ); addContext.setPartition( this ); addContext.setTransaction( this.beginWriteTransaction() );
/** * {@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( 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() ); }
@Override public void entryAdded( AddOperationContext addContext ) { Entry entry = addContext.getEntry(); updatePasswordPolicy( entry, false ); }
if ( addContext.isReplEvent() ) Dn normName = addContext.getDn(); Entry entry = addContext.getEntry();
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { next( addContext ); if ( !changeLog.isEnabled() ) { return; } Entry addEntry = addContext.getEntry(); // we don't want to record addition of a tag as a change if ( addEntry.get( REV_AT_OID ) != null ) { return; } LdifEntry forward = new LdifEntry(); forward.setChangeType( ChangeType.Add ); forward.setDn( addContext.getDn() ); for ( Attribute attribute : addEntry.getAttributes() ) { AttributeType attributeType = attribute.getAttributeType(); forward.addAttribute( addEntry.get( attributeType ).clone() ); } LdifEntry reverse = LdifRevertor.reverseAdd( addContext.getDn() ); addContext.setChangeLogEvent( changeLog.log( getPrincipal( addContext ), forward, reverse ) ); }
Entry entry = addContext.getEntry(); if ( !directoryService.isPwdPolicyEnabled() || addContext.isReplEvent() ) boolean isPPolicyReqCtrlPresent = addContext.hasRequestControl( PasswordPolicy.OID ); responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.get( e.getErrorCode() ) ); addContext.addResponseControl( responseControl ); if ( !addContext.getSession().isAnAdministrator() || entry.get( pwdChangedTimeAT ) == null ) if ( policyConfig.isPwdMustChange() && addContext.getSession().isAnAdministrator() )
super.add( new AddOperationContext( null, contextEntry ) ); addMandatoryOpAt( entry ); super.add( new AddOperationContext( null, entry ) );
entry.add( SchemaConstants.ENTRY_CSN_AT, directoryService.getCSN().toString() ); AddOperationContext addContext = new AddOperationContext( directoryService.getAdminSession() ); addContext.setDn( numberHolder ); addContext.setEntry( new ClonedServerEntry( entry ) ); addContext.setPartition( systemPartition ); PartitionTxn partitionTxn = null; addContext.setTransaction( partitionTxn );
if ( addContext.isReplEvent() ) Entry entry = addContext.getEntry();
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { synchronized ( lock ) { super.add( addContext ); if ( contextEntry == null ) { Entry entry = addContext.getEntry(); if ( entry.getDn().equals( suffixDn ) ) { contextEntry = entry; } } dirty = true; rewritePartitionData( addContext.getTransaction() ); } }
Entry entry = addContext.getEntry(); boolean isAdmin = addContext.getSession().getAuthenticatedPrincipal().getDn().equals( adminDn );
/** * 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() ); }
AddOperationContext addContext = new AddOperationContext( null, contextEntry ); addContext.setTransaction( partitionTxn );
AddOperationContext addContext = new AddOperationContext( session, remoteEntry ); addContext.setReplEvent( true ); addContext.setRid( rid );
/** * @see Object#toString() */ public String toString() { return "AddContext for Dn '" + getDn().getName() + "'" + ", added entry: " + entry; } }
/** * {@inheritDoc} */ public void add( AddOperationContext addContext ) throws LdapException { super.add( addContext ); addEntry( addContext.getEntry() ); }
entry.add(SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString()); AddOperationContext addContext = new AddOperationContext(null, entry); super.add(addContext);