Package edu.monash.merc.dto

Examples of edu.monash.merc.dto.LDAPUser


  public String searchParty() {

    String authcateId = null;
    try {
      LDAPUser user = this.ldapService.searchLdapUser(party);

      // get researcher nla id from rm ws
      authcateId = user.getUid();
      System.out.println("authcateId: " + authcateId);

      String nlaId = this.partyActivitySvc.getNlaId(authcateId);
      System.out.println("nlaId: " + nlaId);
View Full Code Here


            }

            NamingEnumeration<SearchResult> answer = dir.search(baseDn, filter, ctls);
            while (answer.hasMore()) {
                SearchResult st = (SearchResult) answer.next();
                LDAPUser usr = new LDAPUser();

                Attributes atts = st.getAttributes();

                Attribute mailAtt = atts.get(mailAttrName);
                if (mailAtt != null) {
                    usr.setMail((String) mailAtt.get());
                }

                Attribute cnAtt = atts.get(cnAttrName);
                if (cnAtt != null) {
                    usr.setDisplayName((String) cnAtt.get());
                }

                Attribute uidAtt = atts.get(uidAttrName);
                if (uidAtt != null) {
                    usr.setUid((String) uidAtt.get());
                }

                Attribute ptitleAtt = atts.get(personalTitleAttrName);
                if (ptitleAtt != null) {
                    usr.setTitle((String) ptitleAtt.get());
                }

                Attribute genderAtt = atts.get(genderAttrName);
                if (genderAtt != null) {
                    usr.setGender((String) genderAtt.get());
                }

                Attribute surNameAtt = atts.get(snAttrName);
                if (surNameAtt != null) {
                    usr.setLastName((String) surNameAtt.get());
                }

                Attribute firstNameAtt = atts.get(givennameAttrName);
                if (firstNameAtt != null) {
                    usr.setFirstName((String) firstNameAtt.get());
                }

                return usr;
            }
        } catch (NamingException nex) {
View Full Code Here

            String displayName = cnAtt != null ? (String) cnAtt.get() : "none";

            Attribute genderNameAtt = atts.get(genderAttrName);
            String gender = genderNameAtt != null ? (String) genderNameAtt.get() : "male";

            LDAPUser usr = new LDAPUser();
            usr.setUid(uid);
            usr.setDisplayName(displayName);
            usr.setGender(gender);
            usr.setMail(mail);
            return usr;
        } catch (NamingException e) {
            logger.error(e.getMessage());
            return null;
        } finally {
View Full Code Here

        ldap.initEnv(ldapProp);

        String usrdn = ldap.findUserDn("xiyu");
        System.out.println("user dn: " + usrdn);

        LDAPUser luser = ldap.findUserInfo("Virginia.Gutierre@monash.edu");
        if (luser != null) {
            System.out.println("title: " + luser.getTitle());
            System.out.println("display name: " + luser.getDisplayName());
            System.out.println("authencate id: " + luser.getUid());
            System.out.println("last name: " + luser.getLastName());
            System.out.println("frist name: " + luser.getFirstName());
            System.out.println("gender : " + luser.getGender());
            System.out.println("mail: " + luser.getMail());
        }
        LDAPUser usr = ldap.validateLdapUser("mercsaka", "merc27jira");
        if (usr == null) {
            System.out.println("user is not found");
        } else {
            System.out.println("display name: " + usr.getDisplayName());
            System.out.println("frist name: " + usr.getFirstName());
            System.out.println("last name: " + usr.getLastName());
            System.out.println("gender : " + usr.getGender());
            System.out.println("mail: " + usr.getMail());
        }

        // ldap.login("mercsaka", "merc27jira");
    }
View Full Code Here

TOP

Related Classes of edu.monash.merc.dto.LDAPUser

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.