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

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


  }

  protected String createUserUid(String user, String group, String firstname, String lastname, String email) throws Exception {
    LdapDN dn = new LdapDN("uid="+user+",ou="+group+",o=camunda,c=org");
    createUser(user, firstname, lastname, email, dn);
    return dn.toNormName();
  }

  protected String createUserCN(String user, String group, String firstname, String lastname, String email) throws Exception {
    LdapDN dn = new LdapDN("cn="+lastname + "\\," + firstname +",ou="+group+",o=camunda,c=org");
    createUser(user, firstname, lastname, email, dn);
View Full Code Here


  }

  protected String createUserCN(String user, String group, String firstname, String lastname, String email) throws Exception {
    LdapDN dn = new LdapDN("cn="+lastname + "\\," + firstname +",ou="+group+",o=camunda,c=org");
    createUser(user, firstname, lastname, email, dn);
    return dn.toNormName();
  }

  private void createUser(String user, String firstname, String lastname,
      String email, LdapDN dn) throws Exception, NamingException,
      UnsupportedEncodingException {
View Full Code Here

    if (!service.getAdminSession().exists(dn)) {
      ServerEntry entry = service.newEntry(dn);
      entry.add("objectClass", "top", "organizationalUnit");
      entry.add("ou", name);
      service.getAdminSession().add(entry);
      System.out.println("created entry: " + dn.toNormName());
    }
  }

  protected void createRole(String roleName, String... users) throws Exception {
    LdapDN dn = new LdapDN("ou=" + roleName + ",o=camunda,c=org");
View Full Code Here

        exclusions = new ArrayList<String>();
        Set chopBeforeExclusions = subtreeSpecification.getChopBeforeExclusions();
        for ( Object chopBeforeExclusion : chopBeforeExclusions )
        {
            LdapDN dn = ( LdapDN ) chopBeforeExclusion;
            exclusions.add( "chopBefore: \"" + dn.toNormName() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
        }

        Set chopAfterExclusions = subtreeSpecification.getChopAfterExclusions();
        for ( Object chopAfterExclusion : chopAfterExclusions )
        {
View Full Code Here

        Set chopAfterExclusions = subtreeSpecification.getChopAfterExclusions();
        for ( Object chopAfterExclusion : chopAfterExclusions )
        {
            LdapDN dn = ( LdapDN ) chopAfterExclusion;
            exclusions.add( "chopAfter: \"" + dn.toNormName() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
        }

        returnValue = null;
    }
View Full Code Here

        exclusions = new ArrayList<String>();
        Set chopBeforeExclusions = subtreeSpecification.getChopBeforeExclusions();
        for ( Object chopBeforeExclusion : chopBeforeExclusions )
        {
            LdapDN dn = ( LdapDN ) chopBeforeExclusion;
            exclusions.add( "chopBefore: \"" + dn.toNormName() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
        }

        Set chopAfterExclusions = subtreeSpecification.getChopAfterExclusions();
        for ( Object chopAfterExclusion : chopAfterExclusions )
        {
View Full Code Here

        Set chopAfterExclusions = subtreeSpecification.getChopAfterExclusions();
        for ( Object chopAfterExclusion : chopAfterExclusions )
        {
            LdapDN dn = ( LdapDN ) chopAfterExclusion;
            exclusions.add( "chopAfter: \"" + dn.toNormName() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
        }

        returnValue = null;
    }
View Full Code Here

    @Test
    public void testFreshStore() throws Exception
    {
        LdapDN dn = new LdapDN( "o=Good Times Co." );
        dn.normalize( attributeRegistry.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.getUpName(), store.getEntryUpdn( 1L ) );
View Full Code Here

    {
        LdapDN dn = new LdapDN( "o=Good Times Co." );
        dn.normalize( attributeRegistry.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.getUpName(), store.getEntryUpdn( 1L ) );

        // note that the suffix entry returns 0 for it's parent which does not exist
        assertEquals( 0L, ( long ) store.getParentId( dn.toNormName() ) );
View Full Code Here

        LdapDN dn = new LdapDN( "o=Good Times Co." );
        dn.normalize( attributeRegistry.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.getUpName(), store.getEntryUpdn( 1L ) );

        // note that the suffix entry returns 0 for it's parent which does not exist
        assertEquals( 0L, ( long ) store.getParentId( dn.toNormName() ) );
        assertNull( store.getParentId( 0L ) );
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.