public ModifyStoredProcedureParameterInjector( ModifyOperationContext opContext ) throws LdapException { super( opContext ); modifiedEntryName = opContext.getDn(); modifications = opContext.getModItems(); this.oldEntry = getEntry( opContext ); Map<Class<?>, MicroInjector> injectors = super.getInjectors(); injectors.put( StoredProcedureParameter.Modify_OBJECT.class, objectInjector ); injectors.put( StoredProcedureParameter.Modify_MODIFICATION.class, modificationInjector ); injectors.put( StoredProcedureParameter.Modify_OLD_ENTRY.class, oldEntryInjector ); injectors.put( StoredProcedureParameter.Modify_NEW_ENTRY.class, newEntryInjector ); }
/** * {@inheritDoc} */ @Override public void modify( ModifyOperationContext modifyContext ) throws LdapException { if ( algorithm == null ) { next( modifyContext ); return; } List<Modification> mods = modifyContext.getModItems(); for ( Modification mod : mods ) { Attribute attribute = mod.getAttribute(); if ( attributeTypes.contains( attribute.getAttributeType() ) ) { includeHashed( attribute ); } } next( modifyContext ); } }
List<Modification> mods = modContext.getModItems();
/** * {@inheritDoc} */ @Override public void modify( ModifyOperationContext modifyContext ) throws LdapException { // Special case : if we don't have any modification to apply, just return if ( modifyContext.getModItems().isEmpty() ) { return; } Partition partition = getPartition( modifyContext.getDn() ); partition.modify( modifyContext ); if ( modifyContext.isPushToEvtInterceptor() ) { directoryService.getInterceptor( InterceptorEnum.EVENT_INTERCEPTOR.getName() ).modify( modifyContext ); } }
/** * {@inheritDoc} */ @Override public void modify( ModifyOperationContext modifyContext ) throws LdapException { PartitionTxn partitionTxn = modifyContext.getTransaction(); synchronized ( lock ) { try { Entry modifiedEntry = super.modify( partitionTxn, modifyContext.getDn(), modifyContext.getModItems().toArray( new Modification[] {} ) ); // Remove the EntryDN modifiedEntry.removeAttributes( entryDnAT ); modifyContext.setAlteredEntry( modifiedEntry ); } catch ( Exception e ) { throw new LdapOperationException( e.getMessage(), e ); } dirty = true; rewritePartitionData( partitionTxn ); } }
throws LdapException List<Modification> mods = modContext.getModItems();
Modification modification = ServerEntryUtils.getModificationItem( modifyContext.getModItems(), entryDeleted ); boolean isDelete = modification != null; for ( Modification mod : modifyContext.getModItems() ) || modifyContext.getModItems().isEmpty() )
public void subentryModified( ModifyOperationContext opContext, Entry entry ) throws LdapException { if ( !hasPrescriptiveTrigger( entry ) ) { return; } Dn normName = opContext.getDn(); List<Modification> mods = opContext.getModItems(); boolean isTriggerSpecModified = false; for ( Modification mod : mods ) { isTriggerSpecModified |= mod.getAttribute().contains( PRESCRIPTIVE_TRIGGER_ATTR ); } if ( isTriggerSpecModified ) { subentryDeleted( normName, entry ); subentryAdded( normName, entry ); } }
modifyContext.getDn(), entry, modifyContext.getModItems() ) ); throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM );
super.modify( modifyContext.getTransaction(), modifyContext.getDn(), modifyContext.getModItems().toArray( new Modification[] {} ) );
@Override public void entryModified( ModifyOperationContext modifyContext ) List<Modification> mods = modifyContext.getModItems();
/** * Check that we can modify an entry */ private void checkModify( ModifyOperationContext modifyContext ) throws LdapException { List<Modification> mods = modifyContext.getModItems(); Entry originalEntry = modifyContext.getEntry(); Entry targetEntry = SchemaUtils.getTargetEntry( mods, originalEntry ); // If the modified entry contains the CollectiveAttributeSubentry, then the modification // is accepted, no matter what if ( targetEntry.contains( directoryService.getAtProvider().getObjectClass(), SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC ) ) { return; } // Check that we don't add any collectve attribute, this is not allowed on normal entries if ( hasCollectiveAttributes( mods ) ) { /* * TODO: Replace the Exception and the ResultCodeEnum with the correct ones. */ LOG.info( "Cannot modify the entry {} : it contains some CollectiveAttributes and is not a collective subentry", targetEntry ); throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, I18n.err( I18n.ERR_242 ) ); } }
/** * Proceed with the Modification operation when the PasswordPolicy is not activated. */ private void processStandardModify( ModifyOperationContext modifyContext ) throws LdapException { next( modifyContext ); List<Modification> modifications = modifyContext.getModItems(); for ( Modification modification : modifications ) { if ( directoryService.getAtProvider().getUserPassword() .equals( modification.getAttribute().getAttributeType() ) ) { invalidateAuthenticatorCaches( modifyContext.getDn() ); break; } } return; }
List<Modification> mods = modifyContext.getModItems();
List<Modification> mods = modifyContext.getModItems(); boolean hasModification = SCHEMA_UNCHANGED;
for ( Modification modification : modifyContext.getModItems() )
List<Modification> mods = modifyContext.getModItems();
private PwdModDetailsHolder getPwdModDetails( ModifyOperationContext modifyContext, PasswordPolicyConfiguration policyConfig ) throws LdapException { PwdModDetailsHolder pwdModDetails = new PwdModDetailsHolder(); List<Modification> mods = modifyContext.getModItems(); for ( Modification m : mods ) { Attribute at = m.getAttribute(); AttributeType passwordAttribute = schemaManager.lookupAttributeTypeRegistry( policyConfig.getPwdAttribute() ); if ( at.getAttributeType().equals( passwordAttribute ) ) { pwdModDetails.setPwdModPresent( true ); ModificationOperation op = m.getOperation(); if ( op == REMOVE_ATTRIBUTE ) { pwdModDetails.setDelete( true ); } else if ( op == REPLACE_ATTRIBUTE || op == ADD_ATTRIBUTE ) { pwdModDetails.setAddOrReplace( true ); pwdModDetails.setNewPwd( at.getBytes() ); } } else { pwdModDetails.setOtherModExists( true ); } } return pwdModDetails; }
/** * {@inheritDoc} */ public void modify( ModifyOperationContext modifyContext ) throws LdapException { Entry entry = modifyContext.getEntry(); if ( entry == null ) { LookupOperationContext lookupCtx = new LookupOperationContext( modifyContext.getSession(), modifyContext.getDn() ); lookupCtx.setPartition( this ); lookupCtx.setTransaction( modifyContext.getTransaction() ); entry = wrapped.lookup( lookupCtx ); modifyContext.setEntry( entry ); } Entry targetEntry = SchemaUtils.getTargetEntry( modifyContext.getModItems(), entry ); boolean cascade = modifyContext.hasRequestControl( Cascade.OID ); boolean hasModification = synchronizer.modify( modifyContext, targetEntry, cascade ); if ( hasModification ) { wrapped.modify( modifyContext ); } if ( !modifyContext.getDn().equals( schemaModificationDN ) ) { updateSchemaModificationAttributes( modifyContext ); } }
List<Modification> modifications = modifyContext.getModItems(); Dn dn = modifyContext.getDn(); String uuid = modifyContext.getEntry().get( directoryService.getAtProvider().getEntryUUID() ).getString();