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

Examples of org.apache.directory.shared.ldap.name.LdapDN


    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);
    return dn.toNormName();
  }
View Full Code Here


      System.out.println("created entry: " + dn.toNormName());
    }
  }

  protected void createGroup(String name) throws InvalidNameException, Exception, NamingException {
    LdapDN dn = new LdapDN("ou=" + name + ",o=camunda,c=org");
    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());
    }
  }
View Full Code Here

      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");
    if (!service.getAdminSession().exists(dn)) {
      ServerEntry entry = service.newEntry(dn);
      entry.add("objectClass", "top", "groupOfNames");
      entry.add("cn", roleName);
      for (String user : users) {       
View Full Code Here

            : LdapURL.LDAP_SCHEME );
        url.setHost( connection.getHost() );
        url.setPort( connection.getPort() );
        try
        {
            url.setDn( new LdapDN( searchBase ) );
        }
        catch ( InvalidNameException e )
        {
        }
        if ( attributes != null )
View Full Code Here

        {
            return null;
        }
        try
        {
            return new LdapDN( dn );
        }
        catch ( InvalidNameException e )
        {
            return null;
        }
View Full Code Here

     *
     * @return the composed DN
     */
    public static LdapDN composeDn( Rdn rdn, LdapDN parent )
    {
        LdapDN ldapDn = ( LdapDN ) parent.clone();
        ldapDn.add( ( Rdn ) rdn.clone() );
        return ldapDn;
    }
View Full Code Here

        {
            return null;
        }
        else
        {
            LdapDN parent = ( LdapDN ) dn.getPrefix( dn.size() - 1 );
            return parent;
        }
    }
View Full Code Here

     *
     * @throws InvalidNameException the invalid name exception
     */
    public static LdapDN composeDn( String rdn, String parent ) throws InvalidNameException
    {
        return composeDn( new Rdn( rdn ), new LdapDN( parent ) );
    }
View Full Code Here

     *
     * @return the composed DN
     */
    public static LdapDN composeDn( LdapDN prefix, LdapDN suffix )
    {
        LdapDN ldapDn = ( LdapDN ) suffix.clone();

        for ( int i = 0; i < prefix.size(); i++ )
        {
            ldapDn.add( ( Rdn ) prefix.getRdn( i ).clone() );
        }

        return ldapDn;
    }
View Full Code Here

        {
            return null;
        }
        else
        {
            LdapDN prefix = ( LdapDN ) dn.getSuffix( suffix.size() );
            return prefix;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.name.LdapDN

Copyright © 2018 www.massapicom. 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.