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

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


   
    @Test
    public void testRename() throws Exception
    {
        LdapDN dn = new LdapDN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );
        DefaultServerEntry entry = new DefaultServerEntry( registries, dn );
        entry.add( "objectClass", "top", "person", "organizationalPerson" );
        entry.add( "ou", "Engineering" );
        entry.add( "cn""Private Ryan");
        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
View Full Code Here


   
    @Test
    public void testMove() throws Exception
    {
        LdapDN childDn = new LdapDN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co." );
        childDn.normalize( attributeRegistry.getNormalizerMapping() );
        DefaultServerEntry childEntry = new DefaultServerEntry( registries, childDn );
        childEntry.add( "objectClass", "top", "person", "organizationalPerson" );
        childEntry.add( "ou", "Engineering" );
        childEntry.add( "cn""Private Ryan");
        childEntry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
View Full Code Here

        childEntry.add( "entryUUID", SchemaUtils.uuidToBytes( UUID.randomUUID() ) );

        store.add( childEntry );

        LdapDN parentDn = new LdapDN( "ou=Sales,o=Good Times Co." );
        parentDn.normalize( attributeRegistry.getNormalizerMapping() );

        Rdn rdn = new Rdn("cn=Ryan");

        store.move( childDn, parentDn, rdn, true );
View Full Code Here

        // to drop the alias indices  
        childDn = new LdapDN( "commonName=Jim Bean,ou=Apache,ou=Board of Directors,o=Good Times Co." );
        childDn.normalize( attributeRegistry.getNormalizerMapping() );
       
        parentDn = new LdapDN( "ou=Engineering,o=Good Times Co." );
        parentDn.normalize( attributeRegistry.getNormalizerMapping() );
       
        assertEquals( 3, store.getSubAliasIndex().count() );
       
        store.move( childDn, parentDn);
       
View Full Code Here

   
    @Test
    public void testModifyAdd() throws Exception
    {
        LdapDN dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );

        List<Modification> mods = new ArrayList<Modification>();
        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.SURNAME_AT,
            attributeRegistry.lookup( SchemaConstants.SURNAME_AT ) );
       
View Full Code Here

   
    @Test
    public void testModifyReplace() throws Exception
    {
        LdapDN dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );

        List<Modification> mods = new ArrayList<Modification>();
        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.SN_AT,
            attributeRegistry.lookup( SchemaConstants.SN_AT_OID ) );
       
View Full Code Here

   
    @Test
    public void testModifyRemove() throws Exception
    {
        LdapDN dn = new LdapDN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );

        List<Modification> mods = new ArrayList<Modification>();
        ServerAttribute attrib = new DefaultServerAttribute( SchemaConstants.SN_AT,
            attributeRegistry.lookup( SchemaConstants.SN_AT_OID ) );
       
View Full Code Here

   
    @Test
    public void testModifyReplaceNonExistingIndexAttribute() throws Exception
    {
        LdapDN dn = new LdapDN( "cn=Tim B,ou=Sales,o=Good Times Co." );
        dn.normalize( attributeRegistry.getNormalizerMapping() );
        DefaultServerEntry entry = new DefaultServerEntry( registries, dn );
        entry.add( "objectClass", "top", "person", "organizationalPerson" );
        entry.add( "cn", "Tim B");
        entry.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
        entry.add( "entryUUID", SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
View Full Code Here

        // check to see if target entry exists
        LdapDN newDn = ( LdapDN ) dn.clone();
        newDn.remove( dn.size() - 1 );
        newDn.add( opContext.getNewRdn() );
        newDn.normalize( normalizerMap );
       
        if ( nextInterceptor.hasEntry( new EntryOperationContext( opContext.getSession(), newDn ) ) )
        {
            LdapNameAlreadyBoundException e;
            e = new LdapNameAlreadyBoundException( "target entry " + newDn.getUpName() + " already exists!" );
View Full Code Here

                ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT,
                registries.getAttributeTypeRegistry().lookup( ApacheSchemaConstants.SCHEMA_MODIFIERS_NAME_AT ),
                modifiersName ) ) );
       
        LdapDN name = new LdapDN( ServerDNConstants.SCHEMA_TIMESTAMP_ENTRY_DN );
        name.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
       
        opContext.modify( name, mods, SCHEMA_MODIFICATION_ATTRIBUTES_UPDATE_BYPASS );
    }
}
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.