Produced by Araxis Merge on 12/13/2018 10:35:28 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\persistent\ldap | LdapGroupDaoImpl.java | Fri Dec 7 17:36:34 2018 UTC |
| 2 | v12.5_iter_7_build 51.zip\TRM_Upgrade\src\main\java\gov\va\med\fw\persistent\ldap | LdapGroupDaoImpl.java | Wed Dec 12 22:13:29 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 206 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /********* ********** ********** ********** ********** ********** ********* | |
| 2 | * Copyrii ght 2008 V HA. All ri ghts reser ved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | package go v.va.med.f w.persiste nt.ldap; | |
| 5 | ||
| 6 | import jav a.util.Ite rator; | |
| 7 | import jav a.util.Lis t; | |
| 8 | ||
| 9 | import org .springfra mework.lda p.core.Dir ContextAda pter; | |
| 10 | import org .springfra mework.lda p.core.Dir ContextOpe rations; | |
| 11 | import org .springfra mework.lda p.core.Dis tinguished Name; | |
| 12 | import org .springfra mework.lda p.core.Lda pOperation s; | |
| 13 | import org .springfra mework.ste reotype.Re pository; | |
| 14 | ||
| 15 | import gov .va.med.fw .model.lda p.LdapCons tants; | |
| 16 | import gov .va.med.fw .model.lda p.LdapGrou p; | |
| 17 | import gov .va.med.fw .security. Role; | |
| 18 | ||
| 19 | /** | |
| 20 | * Data Ac cess Objec t implemen tation for Ldap Grou p. | |
| 21 | * | |
| 22 | * CISS ci ss_framewo rk Jun 23, 2008 | |
| 23 | * | |
| 24 | * @author
|
|
| 25 | */ | |
| 26 | @Repositor y | |
| 27 | public cla ss LdapGro upDaoImpl implements LdapGroup Dao, LdapC onstants { | |
| 28 | ||
| 29 | Ld apOperatio ns ldapWri teOperatio ns; | |
| 30 | pr ivate List <String> e nvironment OuList; | |
| 31 | ||
| 32 | pr ivate Dist inguishedN ame buildD n(String c n) { | |
| 33 | Dist inguishedN ame dn = n ew Disting uishedName (); | |
| 34 | ||
| 35 | for (Iterator i = enviro nmentOuLis t.iterator (); i.hasN ext();) { | |
| 36 | String orgUnit = (String) i.next(); | |
| 37 | ||
| 38 | /* | |
| 39 | * Whe n a brand new user i s being ad ded to ohr s groups t hey will | |
| 40 | * als o be added to the CI SS User gr oup so the ou for Ro les needs to | |
| 41 | * be changed to CISS Role s rather t han OHRS R oles | |
| 42 | */ | |
| 43 | if (cn .equalsIgn oreCase(Ro le.DEFAULT _CCHT_APP_ ROLE) | |
| 44 | && orgUnit .equalsIgn oreCase(OH RS_ROLES)) | |
| 45 | dn.add(" ou", CISS_ ROLES); | |
| 46 | else | |
| 47 | dn.add(" ou", orgUn it); | |
| 48 | } | |
| 49 | ||
| 50 | dn.a dd(CN, cn) ; | |
| 51 | retu rn dn; | |
| 52 | } | |
| 53 | ||
| 54 | pr ivate Dist inguishedN ame buildD nSetSamAcc ountName(L dapGroup g roup) { | |
| 55 | Dist inguishedN ame dn = n ew Disting uishedName (); | |
| 56 | ||
| 57 | for (Iterator i = enviro nmentOuLis t.iterator (); i.hasN ext();) { | |
| 58 | String ou = (Str ing) i.nex t(); | |
| 59 | dn.add ("ou", ou) ; | |
| 60 | // app end to the sAM accou nt name if using the test or d ev Ldap ou | |
| 61 | if (ou .startsWit h(DEV_GROU PS) || ou. startsWith (TEST_GROU PS)) | |
| 62 | group.se tSamAccoun tName(buil dEnvironme ntSamAccou ntName(gro up.getSamA ccountName (), | |
| 63 | ou )); | |
| 64 | } | |
| 65 | ||
| 66 | dn.a dd(CN, gro up.getCnNa me()); | |
| 67 | retu rn dn; | |
| 68 | } | |
| 69 | ||
| 70 | pr ivate Stri ng buildEn vironmentS amAccountN ame(String sAM, Stri ng ou) { | |
| 71 | Stri ng envStri ng = ou.re place(" ", "_"); | |
| 72 | retu rn (sAM + "_" + envS tring.subs tring(0, e nvString.i ndexOf(GRO UPS)).toUp perCase()) ; | |
| 73 | } | |
| 74 | ||
| 75 | pr ivate DirC ontextOper ations set Attributes (DirContex tOperation s adapter, LdapGroup group) { | |
| 76 | adap ter.setAtt ributeValu es(OBJECT_ CLASS, new String[] { TOP, GRO UP }); | |
| 77 | adap ter.setAtt ributeValu e(CN, grou p.getCnNam e()); | |
| 78 | adap ter.setAtt ributeValu e("groupTy pe", "-214 7483640"); | |
| 79 | adap ter.setAtt ributeValu e("sAMAcco untName", group.getS amAccountN ame()); | |
| 80 | if ( group.getM embers() ! = null) { | |
| 81 | adapte r.setAttri buteValues (MEMBER, g roup.getMe mbers().to Array(new String[0]) ); | |
| 82 | } | |
| 83 | retu rn adapter ; | |
| 84 | } | |
| 85 | ||
| 86 | pu blic void setLdapWri teOperatio ns(LdapOpe rations ld apWriteOpe rations) { | |
| 87 | this .ldapWrite Operations = ldapWri teOperatio ns; | |
| 88 | } | |
| 89 | ||
| 90 | ||
| 91 | pu blic void setEnviron mentOuList (List<Stri ng> enviro nmentOuLis t) { | |
| 92 | this .environme ntOuList = environme ntOuList; | |
| 93 | } | |
| 94 | ||
| 95 | pu blic void create(Lda pGroup gro up) { | |
| 96 | ldap WriteOpera tions.bind (buildDnSe tSamAccoun tName(grou p), setAtt ributes( | |
| 97 | new DirC ontextAdap ter(), gro up), null) ; | |
| 98 | } | |
| 99 | ||
| 100 | pu blic void delete(Lda pGroup gro up) { | |
| 101 | ldap WriteOpera tions.unbi nd(buildDn (group.get CnName())) ; | |
| 102 | } | |
| 103 | ||
| 104 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.