/** * {@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 ); } }
ModifyOperationContext bindModCtx = new ModifyOperationContext( directoryService.getAdminSession() ); bindModCtx.setDn( numberHolder ); bindModCtx.setPushToEvtInterceptor( true ); bindModCtx.setModItems( mods );
@Override public void entryModified( ModifyOperationContext modifyContext ) { Entry entry = modifyContext.getAlteredEntry(); updatePasswordPolicy( entry, false ); }
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 { 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 ); } }
/** * {@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 ); } }
Dn dn = modifyContext.getDn(); List<Modification> modifications = modifyContext.getModItems(); Entry entry = modifyContext.getEntry(); SearchOperationContext searchOperationContext = new SearchOperationContext( modifyContext.getSession(), oldBaseDn, filter, controls ); searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES ); searchOperationContext.setPartition( modifyContext.getPartition() ); searchOperationContext.setTransaction( modifyContext.getTransaction() ); ModifyOperationContext newModifyContext = new ModifyOperationContext( modifyContext.getSession(), candidateDn, getOperationalModsForRemove( dn, candidate ) ); newModifyContext.setPartition( modifyContext.getPartition() ); newModifyContext.setTransaction( modifyContext.getTransaction() ); searchOperationContext = new SearchOperationContext( modifyContext.getSession(), newBaseDn, filter, controls ); searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES ); searchOperationContext.setPartition( modifyContext.getPartition() ); searchOperationContext.setTransaction( modifyContext.getTransaction() ); nexus.modify( new ModifyOperationContext( modifyContext.getSession(), candidateDn, getOperationalModsForAdd( candidate, operationalAttributes ) ) ); Entry newEntry = modifyContext.getAlteredEntry(); ModifyOperationContext newModifyContext = new ModifyOperationContext( modifyContext.getSession(), dn, subentriesOpAttrMods ); newModifyContext.setPartition( modifyContext.getPartition() );
PasswordPolicyConfiguration policyConfig = getPwdPolicy( modifyContext.getEntry() ); CoreSession userSession = modifyContext.getSession(); boolean isPPolicyReqCtrlPresent = modifyContext.hasRequestControl( PasswordPolicy.OID ); Entry entry = modifyContext.getEntry(); responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.PASSWORD_TOO_YOUNG ); modifyContext.addResponseControl( responseControl ); responseControl.getResponse().setPasswordPolicyError( PasswordPolicyErrorEnum.get( e.getErrorCode() ) ); modifyContext.addResponseControl( responseControl ); invalidateAuthenticatorCaches( modifyContext.getDn() ); LookupOperationContext lookupContext = new LookupOperationContext( adminSession, modifyContext.getDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY ); lookupContext.setPartition( modifyContext.getPartition() ); lookupContext.setTransaction( modifyContext.getTransaction() ); if ( modifyContext.getSession().isAnAdministrator() ) ModifyOperationContext internalModifyCtx = new ModifyOperationContext( adminSession ); internalModifyCtx.setPushToEvtInterceptor( true ); internalModifyCtx.setDn( modifyContext.getDn() ); internalModifyCtx.setEntry( entry ); internalModifyCtx.setModItems( mods );
public void entryModified( ModifyOperationContext modifyContext ) { try { Binding newBinding = new Binding( modifyContext.getDn().getName(), ServerEntryUtils.toBasicAttributes( modifyContext.getEntry() ), false ); Binding oldBinding = new Binding( modifyContext.getDn().getName(), ServerEntryUtils.toBasicAttributes( ( ( ClonedServerEntry ) modifyContext.getEntry() ) .getOriginalEntry() ), false ); NamingEvent evt = new NamingEvent( source, NamingEvent.OBJECT_CHANGED, newBinding, oldBinding, modifyContext ); if ( listener instanceof ObjectChangeListener ) { ( ( ObjectChangeListener ) listener ).objectChanged( evt ); } } catch ( Exception e ) { deliverNamingExceptionEvent( e ); } }
List<Modification> modifications = modifyContext.getModItems(); Dn dn = modifyContext.getDn(); String uuid = modifyContext.getEntry().get( directoryService.getAtProvider().getEntryUUID() ).getString(); Attribute modifiedAdminRole = ( ( ClonedServerEntry ) modifyContext.getEntry() ).getOriginalEntry().get( directoryService.getAtProvider().getAdministrativeRole() ); if ( !( modifyContext.isReplEvent() && modifyContext.getSession().isAdministrator() ) )
throws LdapException Entry entry = modifyContext.getEntry(); Attribute oc = entry.get( objectClassAT ); modifyContext.getDn(), entry, modifyContext.getModItems() ) ); throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM );
List<Modification> mods = modifyContext.getModItems(); boolean isAdmin = modifyContext.getSession().getAuthenticatedPrincipal().getDn().equals( adminDn ); Dn dn = modifyContext.getDn();
Modification modification = ServerEntryUtils.getModificationItem( modifyContext.getModItems(), entryDeleted ); boolean isDelete = modification != null; for ( Modification mod : modifyContext.getModItems() ) || modifyContext.getModItems().isEmpty() ) forward.setDn( modifyContext.getDn() ); modifyContext.getDn(), mods, clientEntry ); modifyContext.setChangeLogEvent( changeLog.log( getPrincipal( modifyContext ), forward, reverse ) );
ModifyOperationContext modifyContext = new ModifyOperationContext( session, schemaModificationDN, mods ); modifyContext.setPartition( this ); modifyContext.setTransaction( opContext.getTransaction() );
/** * {@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 ); } }
/** * 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 ) ); } }
throws LdapException Dn principalDn = modContext.getDn(); LookupOperationContext lookupContext = modContext.newLookupContext( principalDn, SchemaConstants.OBJECT_CLASS_AT, KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT ); lookupContext.setPartition( modContext.getPartition() ); lookupContext.setTransaction( modContext.getTransaction() );
public void entryModified( ModifyOperationContext modifyContext ) { if ( !psearchControl.isNotificationEnabled( ChangeType.MODIFY ) ) { return; } SearchResultEntry respEntry = new SearchResultEntryImpl( req.getMessageId() ); respEntry.setObjectName( modifyContext.getDn() ); Entry entry = new ClonedServerEntry( modifyContext.getAlteredEntry() ); filterEntry( entry ); respEntry.setEntry( entry ); setECResponseControl( respEntry, modifyContext, ChangeType.MODIFY ); session.getIoSession().write( respEntry ); }
List<Modification> mods = modContext.getModItems(); krb5KeyVersionNumber ); modContext.setModItems( newModsList );
private void internalModify( ModifyOperationContext modContext ) throws LdapException Partition partition = directoryService.getPartitionNexus().getPartition( modContext.getDn() ); modContext.setPartition( partition ); PartitionTxn partitionTxn = null; modContext.setTransaction( partitionTxn );