Package javax.naming.directory

Examples of javax.naming.directory.BasicAttribute


      Column e = getElementFromSymbol(selectSymbolItr.next());
      String ldapAttributeName = this.getNameFromElement(e);
      Object ldapAttributeClass = e.getJavaType();

      // Store the element's name and class type, so that we know what to look for in the search results.
      BasicAttribute newAttr = new BasicAttribute(ldapAttributeName, ldapAttributeClass);
      ldapAttributeList.add(newAttr);
      i++;
    }
    return ldapAttributeList;
  }
View Full Code Here


        distinguishedName = (String)insertValue;
      }
      // for other attributes specified in the insert command,
      // create a new
      else {
        insertAttr = new BasicAttribute(nameInsertElement);
        insertValue = ((Literal)insertValueList.get(i)).getValue();
        insertAttr.add(insertValue);
        insertAttrs.put(insertAttr);
      }
    }
View Full Code Here

      // didn't exist, it will automatically be created
      // TODO - since null is a valid attribute
      // value, we don't do any special handling of it right
      // now.  But maybe null should mean to delete an
      // attribute?
            updateMods[i] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(nameLeftElement, valueRightExpr));
    }
    // just try to update an LDAP entry using the DN and
    // attributes specified in the UPDATE operation.  If it isn't
    // legal, we'll get a NamingException back, whose explanation
    // we'll return in a ConnectorException
View Full Code Here

 
  private Attribute fetchMembers(DirContext ctx, String fetchDN) throws NamingException
  {
    Attributes attrs = ctx.getAttributes(fetchDN, new String[] { "uniquemember" });
    Attribute members = attrs.get("uniquemember");
    return (members == null)? new BasicAttribute("uniquemember") : members;
  }
View Full Code Here

      if (values[0].isBoolean()) {
        ordered = values[0].toBoolean();
        i++;
      }
    }
    BasicAttribute attr = new BasicAttribute(id, ordered);
    for(; i<n; i++) {
      attr.add(values[i].toObject());
    }
    return new AnyAttribute(attr);
  }
View Full Code Here

        // Create a first entry associated to the partition
        Attributes attrs = new BasicAttributes(true);

        // First, the objectClass attribute
        Attribute attr = new BasicAttribute("objectClass");
        attr.add("top");
        attr.add("organization");
        attrs.put(attr);

        // The the 'Organization' attribute
        attr = new BasicAttribute("o");
        attr.add("sevenseas");
        attrs.put(attr);

        // Associate this entry to the partition
        pcfg.setContextEntry(attrs);
View Full Code Here

        byte pwdArray[] = new byte[unicodePwd.length * 2];
        for (int i=0; i<unicodePwd.length; i++) {
          pwdArray[i*2 + 1] = (byte) (unicodePwd[i] >>> 8);
          pwdArray[i*2 + 0] = (byte) (unicodePwd[i] & 0xff);
        }
        userPasswordAttribute = new BasicAttribute ( ldapUserPasswordAttribute, pwdArray );
      } else {
        userPasswordAttribute = new BasicAttribute ( ldapUserPasswordAttribute, pwd );
      }

      modificationItems [ 0 ] = new ModificationItem ( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute );
      ctx.modifyAttributes ( dn, modificationItems );
      ctx.close();
View Full Code Here

            DirContext ctx = LDAPUserManager.bindAsAdmin();

            // Make the attributes.
            Attributes attrs = new BasicAttributes();

            attrs.put(new BasicAttribute("turbineRoleName", roleName));
            attrs.put(new BasicAttribute("objectClass", "turbineUserGroup"));
            attrs.put(new BasicAttribute("turbineUserUniqueId", userName));
            try
            {
                // Add the turbineUserGroup.
                ctx.bind(dn, null, attrs);
            }
            catch (NameAlreadyBoundException ex)
            {
                // Since turbineUserGroup had already been created
                // then just add the role name attribute.
                attrs = new BasicAttributes();
                attrs.put(new BasicAttribute("turbineRoleName", roleName));
                ctx.modifyAttributes(dn, DirContext.ADD_ATTRIBUTE, attrs);
            }

        }
        catch (NamingException ex)
View Full Code Here

                    + LDAPSecurityConstants.getBaseSearch();

            // Make the attributes.
            Attributes attrs = new BasicAttributes();

            attrs.put(new BasicAttribute("turbineRoleName", roleName));

            // Connect to LDAP.
            DirContext ctx = LDAPUserManager.bindAsAdmin();

            // Remove the role.
View Full Code Here

                    + LDAPSecurityConstants.getBaseSearch();

            // Make the attributes.
            Attributes attrs = new BasicAttributes();

            attrs.put(new BasicAttribute("turbinePermissionName", permName));

            // Connect to LDAP.
            DirContext ctx = LDAPUserManager.bindAsAdmin();

            // Add the permission.
View Full Code Here

TOP

Related Classes of javax.naming.directory.BasicAttribute

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.