Package javax.naming.directory

Examples of javax.naming.directory.DirContext.bind()


                    Attribute firstName = new BasicAttribute(CN_ATTRIBUTE_NAME);
                    firstName.add(tenant.getAdminFirstName());
                    userAttributes.put(firstName);
                }
                String userRDN = userNameAttribute + "=" + tenant.getAdminName();
                organizationalUsersContext.bind(userRDN, null, userAttributes);
                userDN = userRDN + "," + dnOfUserContext;
                //return (userRDN + dnOfUserContext);
            } catch (NamingException e) {
                String errorMsg = "Error occurred while creating Admin entry";
                logger.error(errorMsg, e);
View Full Code Here


            adminGroupAttributes.put(membershipAttribute);

            try {
                DirContext groupContext = (DirContext) initialDirContext.lookup(dnOfGroupContext);
                String rdnOfAdminGroup = groupNameAttributeName + "=" + adminRoleName;
                groupContext.bind(rdnOfAdminGroup, null, adminGroupAttributes);

            } catch (NamingException e) {
                String errorMessage = "Error occurred while creating the admin group.";
                logger.error(errorMessage);
                throw new UserStoreException(errorMessage, e);
View Full Code Here

                BasicAttribute sn = new BasicAttribute("sn");
                sn.add(userName);
                basicAttributes.put(sn);
            }

            dirContext.bind("uid=" + userName, null, basicAttributes);

            if ((roleList != null) || (roleList.length != 0)) {
                //add user to role according to the group configuration in user-mgt.xml
                for (String role : roleList) {
                    if (("true".equals(READ_LDAP_USER_GROUPS)) &&
View Full Code Here

                            }
                            groupAttributes.put(memberAttribute);
                        }

                        groupContext = (DirContext) mainDirContext.lookup(GROUP_SEARCH_BASE);
                        groupContext.bind(groupNameAttributeName + "=" + roleName, null,
                                          groupAttributes);
                        //if permissions are assigned to role, add permission.
                        if (permissions != null) {
                            for (Permission permission : permissions) {
                                String resourceId = permission.getResourceId();
View Full Code Here

      }
      else
      {
        DirContext context = (DirContext) binding;
        if( isBind == true )
          context.bind(name.getSuffix(1), value, attributes);
        else
          context.rebind(name.getSuffix(1), value, attributes);
      }
    }
  }
View Full Code Here

            attributes = new BasicAttributes();
            attributes.put("name", "Drawings");
            attributes.put("isFolder", "false");
            attributes.put("contentType", "text/html");
            attributes.put("size", "1024");
            projectCtx.bind("readme.html", null, attributes);
            attributes.put("owner", "scott");
            // Documents subctx
            attributes = new BasicAttributes();
            attributes.put("name", "Documents");
            attributes.put("isFolder", "true");
View Full Code Here

            attributes = new BasicAttributes();
            attributes.put("name", "index.html");
            attributes.put("isFolder", "false");
            attributes.put("contentType", "text/html");
            attributes.put("size", "1234");
            dctx.bind("index.html", null, attributes);
            attributes.put("owner", "scott");
            // Documents/Private subctx
            attributes = new BasicAttributes();
            attributes.put("name", "Private");
            attributes.put("isFolder", "true");
View Full Code Here

            attributes.put("name", "passwords");
            attributes.put("isFolder", "false");
            attributes.put("contentType", "text/plain");
            attributes.put("size", "8173");
            attributes.put("owner", "scott");
            dctx.bind("passwords", null, attributes);
            // Documents/Public subctx
            attributes = new BasicAttributes();
            attributes.put("name", "Public");
            attributes.put("isFolder", "true");
            attributes.put("owner", "scott");
View Full Code Here

            attributes.put("name", "readme.txt");
            attributes.put("isFolder", "false");
            attributes.put("contentType", "text/plain");
            attributes.put("size", "13584");
            attributes.put("owner", "scott");
            dctx.bind("readme.txt", null, attributes);
            // Documents/Public/starksm subctx
            attributes = new BasicAttributes();
            attributes.put("name", "starksm");
            attributes.put("isFolder", "true");
            attributes.put("owner", "starksm");
View Full Code Here

            attributes.put("name", ".bashrc");
            attributes.put("isFolder", "false");
            attributes.put("contentType", "text/plain");
            attributes.put("size", "1167");
            attributes.put("owner", "starksm");
            dctx.bind(".bashrc", null, attributes);
            // Drawing subctx
            attributes = new BasicAttributes();
            attributes.put("name", "Drawings");
            attributes.put("isFolder", "true");
            attributes.put("owner", "scott");
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.