Examples of BasicAttribute


Examples of javax.naming.directory.BasicAttribute

                    + LDAPSecurityConstants.getBaseSearch();

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

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

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

            // Remove the permission.
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

                    + LDAPSecurityConstants.getBaseSearch();

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

            attrs.put(new BasicAttribute("objectClass", "turbineGroup"));
            attrs.put(new BasicAttribute("turbineGroupName", groupName));

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

            // Add the group in LDAP.
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

                    + LDAPSecurityConstants.getBaseSearch();

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

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

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

            // Add the role in LDAP.
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

                    + LDAPSecurityConstants.getBaseSearch();

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

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

            DirContext ctx = LDAPUserManager.bindAsAdmin();

            // Add the permission in LDAP.
            ctx.bind(dn, null, attrs);
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

        {
            Object value = "turbineUser";

            if (value != null)
            {
                Attribute attr = new BasicAttribute(attrName, value);

                attribs.put(attr);
            }
        }

        // Set the User id.
        attrName = LDAPSecurityConstants.getUserIdAttribute();
        if (attrName != null)
        {
            Object value = getPrimaryKey();

            if (value != null)
            {
                Attribute attr = new BasicAttribute(attrName, value);

                attribs.put(attr);
            }
        }

        // Set the Username.
        attrName = LDAPSecurityConstants.getNameAttribute();
        if (attrName != null)
        {
            Object value = getName();

            if (value != null)
            {
                Attribute attr = new BasicAttribute(attrName, value);

                attribs.put(attr);
            }
        }

        // Set the Firstname.
        attrName = LDAPSecurityConstants.getFirstNameAttribute();
        if (attrName != null)
        {
            Object value = getFirstName();

            if (value != null)
            {
                Attribute attr = new BasicAttribute(attrName, value);

                attribs.put(attr);
            }
        }

        // Set the Lastname.
        attrName = LDAPSecurityConstants.getLastNameAttribute();
        if (attrName != null)
        {
            Object value = getLastName();

            if (value != null)
            {
                Attribute attr = new BasicAttribute(attrName, value);

                attribs.put(attr);
            }
        }

        // Set the E-Mail.
        attrName = LDAPSecurityConstants.getEmailAttribute();
        if (attrName != null)
        {
            Object value = getEmail();

            if (value != null)
            {
                Attribute attr = new BasicAttribute(attrName, value);

                attribs.put(attr);
            }
        }

        // Set the Password
        attrName = LDAPSecurityConstants.getPasswordAttribute();
        if (attrName != null)
        {
            Object value = getPassword();

            if (value != null)
            {
                Attribute attr = new BasicAttribute(attrName, value);

                attribs.put(attr);
            }
        }
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

     * defined TestCase for Add Test.
     *
     * @return the BasicAttributes
     */
    private BasicAttributes getUserAttributes() {
        BasicAttribute basicattribute = new BasicAttribute("objectclass"); //$NON-NLS-1$
        basicattribute.add("top"); //$NON-NLS-1$
        basicattribute.add("person"); //$NON-NLS-1$
        basicattribute.add("organizationalPerson"); //$NON-NLS-1$
        basicattribute.add("inetOrgPerson"); //$NON-NLS-1$
        BasicAttributes attrs = new BasicAttributes(true);
        attrs.put(basicattribute);
        BasicAttribute attr;
        PropertyIterator iter = getArguments().iterator();

        while (iter.hasNext()) {
            Argument item = (Argument) iter.next().getObjectValue();
            attr = getBasicAttribute(item.getName(), item.getValue());
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

     *
     * @return the BasicAttributes
     */
    private ModificationItem[] getUserModAttributes() {
        ModificationItem[] mods = new ModificationItem[getArguments().getArguments().size()];
        BasicAttribute attr;
        PropertyIterator iter = getArguments().iterator();
        int count = 0;
        while (iter.hasNext()) {
            Argument item = (Argument) iter.next().getObjectValue();
            attr = getBasicAttribute(item.getName(), item.getValue());
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

     * @return the BasicAttributes
     */
    private ModificationItem[] getModificationItem() {
        ModificationItem[] mods = new ModificationItem[2];
        // replace (update) attribute
        Attribute mod0 = new BasicAttribute("userpassword", "secret"); //$NON-NLS-1$ //$NON-NLS-2$
        // add mobile phone number attribute
        Attribute mod1 = new BasicAttribute("mobile", "123-456-1234"); //$NON-NLS-1$ //$NON-NLS-2$

        mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, mod0);
        mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE, mod1);

        return mods;
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

     *
     * @return the BasicAttributes
     */
    private BasicAttributes getBasicAttributes() {
        BasicAttributes basicattributes = new BasicAttributes();
        BasicAttribute basicattribute = new BasicAttribute("objectclass"); //$NON-NLS-1$
        basicattribute.add("top"); //$NON-NLS-1$
        basicattribute.add("person"); //$NON-NLS-1$
        basicattribute.add("organizationalPerson"); //$NON-NLS-1$
        basicattribute.add("inetOrgPerson"); //$NON-NLS-1$
        basicattributes.put(basicattribute);
        String s1 = "User"; //$NON-NLS-1$
        String s3 = "Test"; //$NON-NLS-1$
        String s5 = "user"; //$NON-NLS-1$
        String s6 = "test"; //$NON-NLS-1$
        counter += 1;
        basicattributes.put(new BasicAttribute("givenname", s1)); //$NON-NLS-1$
        basicattributes.put(new BasicAttribute("sn", s3)); //$NON-NLS-1$
        basicattributes.put(new BasicAttribute("cn", "TestUser" + counter)); //$NON-NLS-1$ //$NON-NLS-2$
        basicattributes.put(new BasicAttribute("uid", s5)); //$NON-NLS-1$
        basicattributes.put(new BasicAttribute("userpassword", s6)); //$NON-NLS-1$
        setProperty(new StringProperty(ADD, "cn=TestUser" + counter)); //$NON-NLS-1$
        return basicattributes;
    }
View Full Code Here

Examples of javax.naming.directory.BasicAttribute

     * This will create the Basic Attribute for the given name value pair.
     *
     * @return the BasicAttribute
     */
    private BasicAttribute getBasicAttribute(String name, String value) {
        BasicAttribute attr = new BasicAttribute(name, value);
        return attr;
    }
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.