Package org.apache.directory.shared.ldap.name

Examples of org.apache.directory.shared.ldap.name.DN.normalize()


        //this.directoryService = directoryService;
        schemaManager = directoryService.getSchemaManager();
       
        // Initialize and normalize the localy used DNs
        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
        adminDn.normalize( schemaManager.getNormalizerMapping() );
           
        initializeSystemPartition( directoryService );
       
        List<Partition> initializedPartitions = new ArrayList<Partition>();
        initializedPartitions.add( 0, this.system );
View Full Code Here


        system.initialize( );
       
       
        // Add root context entry for system partition
        DN systemSuffixDn = new DN( ServerDNConstants.SYSTEM_DN );
        systemSuffixDn.normalize( schemaManager.getNormalizerMapping() );
        ServerEntry systemEntry = new DefaultServerEntry( schemaManager, systemSuffixDn );

        // Add the ObjectClasses
        systemEntry.put( SchemaConstants.OBJECT_CLASS_AT,
            SchemaConstants.TOP_OC,
View Full Code Here

        systemEntry.add( SchemaConstants.ENTRY_CSN_AT, directoryService.getCSN().toString() );
        systemEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
        systemEntry.put( NamespaceTools.getRdnAttribute( ServerDNConstants.SYSTEM_DN ),
            NamespaceTools.getRdnValue( ServerDNConstants.SYSTEM_DN ) );
        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
        adminDn.normalize( schemaManager.getNormalizerMapping() );
        CoreSession adminSession = new DefaultCoreSession(
            new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
        AddOperationContext addOperationContext = new AddOperationContext( adminSession, systemEntry );
       
        if ( !system.hasEntry( new EntryOperationContext( adminSession, systemEntry.getDn() ) ) )
View Full Code Here

        for ( String suffix : new HashSet<String>( this.partitions.keySet() ) )
        {
            try
            {
                DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
                adminDn.normalize( schemaManager.getNormalizerMapping() );
                CoreSession adminSession = new DefaultCoreSession(
                    new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
                removeContextPartition( new RemoveContextPartitionOperationContext(
                    adminSession, new DN( suffix ) ) );
            }
View Full Code Here

   
            // TODO : handle searches based on the RootDSE
            throw new LdapNameNotFoundException();
        }
   
        base.normalize( schemaManager.getNormalizerMapping() );
        Partition backend = getPartition( base );
        return backend.search( opContext );
    }

View Full Code Here

    @Test
    public void testFreshStore() throws Exception
    {
        DN dn = new DN( "o=Good Times Co." );
        dn.normalize( schemaManager.getNormalizerMapping() );
        assertEquals( 1L, ( long ) store.getEntryId( dn.toNormName() ) );
        assertEquals( 11, store.count() );
        assertEquals( "o=Good Times Co.", store.getEntryUpdn( dn.toNormName() ) );
        assertEquals( dn.toNormName(), store.getEntryDn( 1L ) );
        assertEquals( dn.getName(), store.getEntryUpdn( 1L ) );
View Full Code Here

        }
       
        try
        {
            DN newRdn = new DN( req.getNewRdn().toString() );
            newRdn.normalize( session.getCoreSession().getDirectoryService()
                .getSchemaManager().getNormalizerMapping() );
           
            DN oldRdn = new DN( req.getName().getRdn().toString() );
            oldRdn.normalize( session.getCoreSession().getDirectoryService()
                .getSchemaManager().getNormalizerMapping() );
View Full Code Here

            DN newRdn = new DN( req.getNewRdn().toString() );
            newRdn.normalize( session.getCoreSession().getDirectoryService()
                .getSchemaManager().getNormalizerMapping() );
           
            DN oldRdn = new DN( req.getName().getRdn().toString() );
            oldRdn.normalize( session.getCoreSession().getDirectoryService()
                .getSchemaManager().getNormalizerMapping() );
           
            boolean rdnChanged = req.getNewRdn() != null &&
                ! newRdn.getNormName().equals( oldRdn.getNormName() );
           
View Full Code Here

            DN childUpdn = ( DN ) updn.clone();
            DN oldUpdn = new DN( getEntryUpdn( childId ) );

            String rdn = oldUpdn.get( oldUpdn.size() - 1 );
            DN rdnDN = new DN( rdn );
            rdnDN.normalize( schemaManager.getNormalizerMapping() );
            childUpdn.add( rdnDN.getRdn() );

            // Modify the child
            ServerEntry entry = lookup( childId );
            entry.setDn( childUpdn );
View Full Code Here

        partition.add( addCtx );
       
        DeleteOperationContext delCtx = new DeleteOperationContext( session );

        DN dn = new DN( "dc=test1,dc=test,ou=test,ou=system" );
        dn.normalize( schemaManager.getNormalizerMapping() );
       
        delCtx.setDn( dn );
       
        partition.delete( delCtx );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.