Package org.apache.directory.api.ldap.model.name

Examples of org.apache.directory.api.ldap.model.name.Dn.apply()


            ENTRY_CSN_AT = schemaManager.getAttributeType( SchemaConstants.ENTRY_CSN_AT );
            OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );

            // Initialize and normalize the localy used DNs
            Dn adminDn = directoryService.getDnFactory().create( ServerDNConstants.ADMIN_SYSTEM_DN );
            adminDn.apply( schemaManager );

            Value<?> attr = rootDse.get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
            subschemSubentryDn = directoryService.getDnFactory().create( attr.getString() );

            List<Partition> initializedPartitions = new ArrayList<Partition>();
View Full Code Here


        {
            return searchFromRoot( searchContext );
        }

        // Not sure we need this code...
        base.apply( schemaManager );

        // Normal case : do a search on the specific partition
        Partition backend = getPartition( base );

        return backend.search( searchContext );
View Full Code Here

                Dn contextEntryDn = contextEntry.getDn();

                // Checking if the context entry DN is schema aware
                if ( !contextEntryDn.isSchemaAware() )
                {
                    contextEntryDn.apply( schemaManager );
                }

                // We're only adding the entry if the two DNs are equal
                if ( suffixDn.equals( contextEntryDn ) )
                {
View Full Code Here

        Entry entry = next( lookupContext );

        LdapPrincipal principal = session.getEffectivePrincipal();
        Dn principalDn = principal.getDn();

        principalDn.apply( schemaManager );

        // Bypass this interceptor if we disabled the AC subsystem or if the principal is the admin
        if ( isPrincipalAnAdministrator( principalDn ) || !directoryService.isAccessControlEnabled() )
        {
            return entry;
View Full Code Here

        boolean isparentReferral = false;
        DirectoryService directoryService = session.getCoreSession().getDirectoryService();
        ReferralManager referralManager = directoryService.getReferralManager();
        Dn reqTargetDn = req.getBase();

        reqTargetDn.apply( directoryService.getSchemaManager() );

        // Check if the entry itself is a referral
        referralManager.lockRead();

        try
View Full Code Here

        if ( obj instanceof Dn )
        {
            dn = ( Dn ) obj;

            dn = ( dn.isSchemaAware() ? dn : dn.apply( schemaManager ) );
        }
        else if ( obj instanceof String )
        {
            dn = new Dn( schemaManager, ( String ) obj );
        }
View Full Code Here

    @Test
    public void testSerializeCompleteEntry() throws LdapException, IOException, ClassNotFoundException
    {
        Dn dn = new Dn( "ou=system" );

        dn.apply( schemaManager );

        byte[] password = Strings.getBytesUtf8( "secret" );
        Entry entry = new DefaultEntry( dn );
        entry.add( "ObjectClass", "top", "person" );
        entry.add( "cn", "test1" );
View Full Code Here

    @Test
    public void testSerializeEntryWithNoAttribute() throws LdapException, IOException, ClassNotFoundException
    {
        Dn dn = new Dn( "ou=system" );

        dn.apply( schemaManager );

        Entry entry = new DefaultEntry( dn );

        Entry entrySer = deserializeValue( serializeValue( entry ) );
View Full Code Here

        assertFalse( two.getParent().isSchemaAware() );
        assertFalse( two.getParent().isEmpty() );
        assertEquals( "o=acme", two.getParent().getName() );

        Dn three = new Dn( "cn=test,dc=example,dc=com" );
        three.apply( schemaManager );
        Dn threeParent = three.getParent();
        assertNotNull( threeParent );
        assertTrue( threeParent.isSchemaAware() );
        assertFalse( threeParent.isEmpty() );
        assertEquals( "dc=example,dc=com", threeParent.getName() );
View Full Code Here

     */
    @Test
    public void testTrailingEscapedSpace() throws Exception
    {
        Dn dn1 = new Dn( "ou=A\\ ,ou=system" );
        dn1.apply( schemaManager );
        assertEquals( "ou=A\\ ,ou=system", dn1.getName() );
        assertEquals( "2.5.4.11=a,2.5.4.11=system", dn1.getNormName() );
        assertEquals( "ou=A\\ ", dn1.getRdn().getName() );
        assertEquals( "2.5.4.11=a", dn1.getRdn().getNormName() );

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.