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

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


     */
    public DN findDn( String entityName ) throws Exception
    {
        ServerEntry sr = find( entityName );
        DN dn = sr.getDn();
        dn.normalize( schemaManager.getNormalizerMapping() );
        return dn;
    }


    /* (non-Javadoc)
 
View Full Code Here


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

     * @see org.apache.directory.server.core.schema.SchemaPartitionDao#enableSchema(java.lang.String)
     */
    public void enableSchema( String schemaName ) throws Exception
    {
        DN dn = new DN( "cn=" + schemaName + ",ou=schema" );
        dn.normalize( schemaManager.getNormalizerMapping() );
        ServerEntry entry = partition.lookup( new LookupOperationContext( null, dn ) );
        EntryAttribute disabledAttr = entry.get( disabledAttributeType );
        List<Modification> mods = new ArrayList<Modification>( 3 );

        if ( disabledAttr == null )
View Full Code Here

   
    @Test
    public void testChangeLogSerialization() throws NamingException, IOException, ClassNotFoundException
    {
        DN systemDn = new DN( "ou=system" );
        systemDn.normalize( oidsMap );
       
        DN adminDn = new DN( "uid=admin, ou=system" );
        adminDn.normalize( oidsMap );

        LdifEntry forward = new LdifEntry();
View Full Code Here

    {
        DN systemDn = new DN( "ou=system" );
        systemDn.normalize( oidsMap );
       
        DN adminDn = new DN( "uid=admin, ou=system" );
        adminDn.normalize( oidsMap );

        LdifEntry forward = new LdifEntry();
        forward.setDn( systemDn );
        forward.setChangeType( ChangeType.Add );
        forward.putAttribute( "objectClass", "organizationalUnit" );
View Full Code Here

        forward.setChangeType( ChangeType.Add );
        forward.putAttribute( "objectClass", "organizationalUnit" );
        forward.putAttribute( "ou", "system" );
       
        DN reverseDn = new DN( forward.getDn() );
        reverseDn.normalize( oidsMap );

        LdifEntry reverse = LdifRevertor.reverseAdd( reverseDn );

        String zuluTime = DateUtils.getGeneralizedTime();
        long revision = 1L;
View Full Code Here


    @Test public void testSerializeDNServerEntry() throws Exception
    {
        DN dn = new DN( "cn=text, dc=example, dc=com" );
        dn.normalize( oids );
       
        ServerEntry entry = new DefaultServerEntry( schemaManager, dn );

        ServerEntrySerializer ses = new ServerEntrySerializer( schemaManager );
       
View Full Code Here


    @Test public void testSerializeServerEntryOC() throws Exception
    {
        DN dn = new DN( "cn=text, dc=example, dc=com" );
        dn.normalize( oids );
       
        ServerEntry entry = new DefaultServerEntry( schemaManager, dn );
        entry.add( "objectClass", "top", "person", "inetOrgPerson", "organizationalPerson" );

        ServerEntrySerializer ses = new ServerEntrySerializer( schemaManager );
View Full Code Here


    @Test public void testSerializeServerEntry() throws Exception
    {
        DN dn = new DN( "cn=text, dc=example, dc=com" );
        dn.normalize( oids );
       
        ServerEntry entry = new DefaultServerEntry( schemaManager, dn );
        entry.add( "objectClass", "top", "person", "inetOrgPerson", "organizationalPerson" );
        entry.add( "cn", "text", "test" );
        entry.add( "SN", (String)null );
View Full Code Here


    @Test public void testSerializeServerEntryWithEmptyDN() throws Exception
    {
        DN dn = new DN( "" );
        dn.normalize( oids );
       
        ServerEntry entry = new DefaultServerEntry( schemaManager, dn );
        entry.add( "objectClass", "top", "person", "inetOrgPerson", "organizationalPerson" );
        entry.add( "cn", "text", "test" );
        entry.add( "SN", (String)null );
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.