/** * @see Object#toString() */ public String toString() { return "AddContext for Dn '" + getDn().getName() + "'" + ", added entry: " + entry; } }
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { checkAdd( addContext.getDn(), addContext.getEntry() ); next( addContext ); }
Dn normName = addContext.getDn();
/** * {@inheritDoc} */ @Override public void add( AddOperationContext addContext ) throws LdapException { Dn name = addContext.getDn(); Entry entry = addContext.getEntry(); // Bypass trigger handling if the service is disabled. if ( !enabled ) { next( addContext ); return; } // Gather supplementary data. StoredProcedureParameterInjector injector = new AddStoredProcedureParameterInjector( addContext, name, entry ); // Gather Trigger Specifications which apply to the entry being added. List<TriggerSpecification> triggerSpecs = new ArrayList<>(); addPrescriptiveTriggerSpecs( addContext, triggerSpecs, name, entry ); /** * NOTE: We do not handle entryTriggerSpecs for ADD operation. */ Map<ActionTime, List<TriggerSpecification>> triggerMap = getActionTimeMappedTriggerSpecsForOperation( triggerSpecs, LdapOperation.ADD ); next( addContext ); triggerSpecCache.subentryAdded( name, entry ); // Fire AFTER Triggers. List<TriggerSpecification> afterTriggerSpecs = triggerMap.get( ActionTime.AFTER ); executeTriggers( addContext, afterTriggerSpecs, injector ); }
if ( addContext.getDn().size() != 3 ) String ouValue = addContext.getDn().getRdn().getValue(); ouValue = Strings.toLowerCaseAscii( Strings.trim( ouValue ) ); String msg = I18n.err( I18n.ERR_83, addContext.getDn() ); LOG.error( msg ); throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, msg );
public void entryAdded( AddOperationContext addContext ) { try { Binding binding = new Binding( addContext.getDn().getName(), ServerEntryUtils.toBasicAttributes( addContext.getEntry() ), false ); NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_ADDED, binding, null, addContext ); if ( listener instanceof NamespaceChangeListener ) { ( ( NamespaceChangeListener ) listener ).objectAdded( evt ); } } catch ( Exception e ) { deliverNamingExceptionEvent( e ); } }
/** * {@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 ) ); }
public void entryAdded( AddOperationContext addContext ) { if ( !psearchControl.isNotificationEnabled( ChangeType.ADD ) ) { return; } SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() ); respEntry.setObjectName( addContext.getDn() ); // the entry needs to be cloned cause addContext.getEntry() will only contain // the user provided values and all the operational attributes added during // Partition.add() will be applied in the cloned entry present inside it // if we don't clone then the attributes will not be filtered // e.x the operational attributes will also be sent even when a user requests // user attributes only Entry entry = new ClonedServerEntry( addContext.getEntry() ); filterEntry( entry ); respEntry.setEntry( entry ); setECResponseControl( respEntry, addContext, ChangeType.ADD ); session.getIoSession().write( respEntry ); }
ldif.setDn( addContext.getDn() );
public void add( AddOperationContext addContext ) throws LdapException Dn dn = addContext.getDn(); Entry entry = addContext.getEntry();