Package javax.naming.ldap

Examples of javax.naming.ldap.Rdn.toAttributes()


    public void testRdnString027() {
        try {
            Rdn rdn1 = new Rdn("t", "test");
            Rdn rdn2 = new Rdn("t = test + t = test");
            assertFalse(rdn1.equals(rdn2));
            assertEquals(rdn1.toAttributes(), rdn2.toAttributes());           
        } catch (InvalidNameException e) {}
    }

    /**
     * <p>
 
View Full Code Here


        try {
            final LdapName subjectDN = new LdapName(subjectPrincipal);
            final List<Rdn> rdns = subjectDN.getRdns();
            for (int i = rdns.size() - 1; i >= 0; i--) {
                final Rdn rds = rdns.get(i);
                final Attributes attributes = rds.toAttributes();
                final Attribute cn = attributes.get("cn");
                if (cn != null) {
                    try {
                        final Object value = cn.get();
                        if (value != null) {
View Full Code Here

    private Attributes getAttributesFromDN(Name name)
            throws InvalidNameException {
        if (name instanceof LdapName) {
            Rdn rdn = ((LdapName) name).getRdn(name.size() - 1);
            return rdn.toAttributes();
        }

        if (name instanceof CompositeName) {
            LdapName lname = new LdapName(name.get(0));
            Rdn rdn = lname.getRdn(lname.size() - 1);
View Full Code Here

        }

        if (name instanceof CompositeName) {
            LdapName lname = new LdapName(name.get(0));
            Rdn rdn = lname.getRdn(lname.size() - 1);
            return rdn.toAttributes();
        }

        throw new InvalidNameException(Messages.getString("ldap.26")); //$NON-NLS-1$
    }
View Full Code Here

        try {
            final LdapName subjectDN = new LdapName(subjectPrincipal);
            final List<Rdn> rdns = subjectDN.getRdns();
            for (int i = rdns.size() - 1; i >= 0; i--) {
                final Rdn rds = rdns.get(i);
                final Attributes attributes = rds.toAttributes();
                final Attribute cn = attributes.get("cn");
                if (cn != null) {
                    try {
                        final Object value = cn.get();
                        if (value != null) {
View Full Code Here

            List rdnList = (new LdapName(dn)).getRdns();

            // Get leaf RDN
            //Rdn rdn = rdnList.get(rdnList.size() - 1);
            Rdn rdn = (Rdn) rdnList.get(rdnList.size() - 1);
            Attributes nameAttrs = rdn.toAttributes();

            // Add attributes of RDN to attrs if not already there
            NamingEnumeration enum_ = nameAttrs.getAll();
            Attribute nameAttr;
            while (enum_.hasMore()) {
View Full Code Here

        try {
            final LdapName subjectDN = new LdapName(subjectPrincipal);
            final List<Rdn> rdns = subjectDN.getRdns();
            for (int i = rdns.size() - 1; i >= 0; i--) {
                final Rdn rds = rdns.get(i);
                final Attributes attributes = rds.toAttributes();
                final Attribute cn = attributes.get("cn");
                if (cn != null) {
                    try {
                        final Object value = cn.get();
                        if (value != null) {
View Full Code Here

        try {
            final LdapName subjectDN = new LdapName(subjectPrincipal);
            final List<Rdn> rdns = subjectDN.getRdns();
            for (int i = rdns.size() - 1; i >= 0; i--) {
                final Rdn rds = rdns.get(i);
                final Attributes attributes = rds.toAttributes();
                final Attribute cn = attributes.get("cn");
                if (cn != null) {
                    try {
                        final Object value = cn.get();
                        if (value != null) {
View Full Code Here

      assertEquals(1,x2.size());
      assertEquals(1,x3.size());
      assertEquals(1,x4.size());
//      Testing toAttributes()
            assertEquals(0,x2.toAttributes().toString().compareToIgnoreCase(x1.toAttributes().toString()));
            assertEquals(0,x4.toAttributes().toString().compareToIgnoreCase(x1.toAttributes().toString()));
      assertNotNull(x3.toAttributes());
     
    } catch (InvalidNameException e) {
      fail("Failed with:"+e);
    }
View Full Code Here

    public void testRdnString027() {
        try {
            Rdn rdn1 = new Rdn("t", "test");
            Rdn rdn2 = new Rdn("t = test + t = test");
            assertFalse(rdn1.equals(rdn2));
            assertEquals(rdn1.toAttributes(), rdn2.toAttributes());           
        } catch (InvalidNameException e) {}
    }

    /**
     * <p>
 
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.