Package org.apache.directory.server.core.interceptor.context

Examples of org.apache.directory.server.core.interceptor.context.ModifyOperationContext


                DN dn = candidate.getDn();
                dn.normalize( schemaManager.getNormalizerMapping() );

                if ( evaluator.evaluate( ssOld, apName, dn, candidate ) )
                {
                    nexus.modify( new ModifyOperationContext( opContext.getSession(), dn,
                        getOperationalModsForRemove( name, candidate ) ) );
                }
            }

            // search for all selected entries by the new SS and add references to subentry
            Subentry subentry = subentryCache.getSubentry( name.toNormName() );
            ServerEntry operational = getSubentryOperatationalAttributes( name, subentry );
            DN newBaseDn = ( DN ) apName.clone();
            newBaseDn.addAll( ssNew.getBase() );
           
            searchOperationContext = new SearchOperationContext( opContext.getSession(), newBaseDn,
                filter, controls );
            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
           
            subentries = nexus.search( searchOperationContext );
           
            while ( subentries.next() )
            {
                ServerEntry candidate = subentries.get();
                DN dn = candidate.getDn();
                dn.normalize( schemaManager.getNormalizerMapping() );

                if ( evaluator.evaluate( ssNew, apName, dn, candidate ) )
                {
                    nexus.modify( new ModifyOperationContext( opContext.getSession(), dn,
                        getOperationalModsForAdd( candidate, operational ) ) );
                }
            }
        }
        else
        {
            next.modify( opContext );

            if ( !objectClasses.contains( SchemaConstants.SUBENTRY_OC ) )
            {
                ServerEntry newEntry = opContext.lookup( name, ByPassConstants.LOOKUP_BYPASS );

                List<Modification> subentriesOpAttrMods = getModsOnEntryModification( name, oldEntry, newEntry );

                if ( subentriesOpAttrMods.size() > 0 )
                {
                    nexus.modify( new ModifyOperationContext( opContext.getSession(), name, subentriesOpAttrMods ) );
                }
            }
        }
    }
View Full Code Here


        for ( Modification mod:mods )
        {
            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
        }
       
        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );

        opContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.modify( opContext );
    }
View Full Code Here

        for ( Modification mod:mods )
        {
            serverModifications.add( new ServerModification( directoryService.getSchemaManager(), mod ) );
        }

        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );
       
        setReferralHandling( opContext, ignoreReferral );
        opContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.modify( opContext );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void modify( InternalModifyRequest modifyRequest, LogChange log ) throws Exception
    {
        ModifyOperationContext opContext = new ModifyOperationContext( this, modifyRequest );

        opContext.setLogChange( log );

        OperationManager operationManager = directoryService.getOperationManager();
        operationManager.modify( opContext );
        modifyRequest.getResultResponse().addAll( opContext.getResponseControls() );
    }
View Full Code Here

        modifications.add( modifyTimestampMod );
       
        // Call the modify operation
        DN dn = buildDn( schemaObject.getObjectType(), schemaObject.getName() );
       
        ModifyOperationContext modifyContext = new ModifyOperationContext( session, dn, modifications );
        modifyContext.setByPassed( ByPassConstants.BYPASS_ALL_COLLECTION );

        OperationManager operationManager =
            session.getDirectoryService().getOperationManager();
       
        operationManager.modify( modifyContext );
View Full Code Here

        serverEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
        serverEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );

        List<Modification> items = ModifyOperationContext.createModItems( serverEntry, ModificationOperation.REPLACE_ATTRIBUTE );

        ModifyOperationContext newModify = new ModifyOperationContext( opContext.getSession(), newDn, items );
        newModify.setEntry( opContext.getAlteredEntry() );
       
        service.getPartitionNexus().modify( newModify );
    }
View Full Code Here

        serverEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );

        List<Modification> items = ModifyOperationContext.createModItems( serverEntry, ModificationOperation.REPLACE_ATTRIBUTE );


        ModifyOperationContext newModify =
            new ModifyOperationContext( opContext.getSession(), opContext.getParent(), items );
       
        service.getPartitionNexus().modify( newModify );
    }
View Full Code Here

        serverEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal().getName() );
        serverEntry.put( SchemaConstants.MODIFY_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );

        List<Modification> items = ModifyOperationContext.createModItems( serverEntry, ModificationOperation.REPLACE_ATTRIBUTE );

        ModifyOperationContext newModify =
            new ModifyOperationContext( opContext.getSession(), opContext.getParent(), items );
       
        service.getPartitionNexus().modify( newModify );
    }
View Full Code Here

                Attribute timeStampAt = mods.get( 1 ).getAttribute();
                timeStampAt.clear();
                timeStampAt.add( DateUtils.getGeneralizedTime() );

                ModifyOperationContext csnModContext = new ModifyOperationContext( directoryService.getAdminSession(),
                    directoryService.getSystemPartition().getSuffixDn(), mods );
                directoryService.getSystemPartition().modify( csnModContext );
            }
        }
        catch ( Exception e )
View Full Code Here

            if ( !mods.isEmpty() )
            {
                LOG.debug( "modifying the entry {} after adding missing manadatory operational attributes",
                    entry.getDn() );
                ModifyOperationContext modifyContext = new ModifyOperationContext( session );
                modifyContext.setEntry( entry );
                modifyContext.setDn( entry.getDn() );
                modifyContext.setModItems( mods );
                partition.modify( modifyContext );
            }

            mods.clear();
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.interceptor.context.ModifyOperationContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.