Produced by Araxis Merge on 5/28/2019 3:27:11 PM Eastern Daylight 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 | CV_src.zip\CVHuiCore\src\gov\va\med\foundations\utilities | LdapUtilities.java | Wed May 1 18:46:24 2019 UTC |
2 | CV_src.zip\CVHuiCore\src\gov\va\med\foundations\utilities | LdapUtilities.java | Sat May 25 18:30:12 2019 UTC |
Description | Between Files 1 and 2 |
|
---|---|---|
Text Blocks | Lines | |
Unchanged | 2 | 228 |
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 | * Janus 4 .0 (c) | |
3 | * Copyrig ht (c) 201 1 Hawaii R esource Gr oup LLC. A ll Rights Reserved. | |
4 | * Develop ed for the Pacific T elehealth & Technolo gy Hui and the Pacif ic Joint I nformation Technolog y Center | |
5 | * Contrib utors: | |
6 | * Hon orable Sen ator Danie l K. Inouy e | |
7 | * VA Pacific Is lands Heal th Care Sy stem | |
8 | * Tri pler Army Medical Ce nter | |
9 | */ | |
10 | ||
11 | ||
12 | /** | |
13 | * Janus 4 .0 (c) | |
14 | * Copyrig ht (c) 201 1 Hawaii R esource Gr oup LLC. A ll Rights Reserved. | |
15 | * Develop ed for Pac ific Teleh ealth & Te chnology H ui/JITC | |
16 | */ | |
17 | ||
18 | /* | |
19 | * Created on Jul 18 , 2003 | |
20 | * | |
21 | * To chan ge the tem plate for this gener ated file go to | |
22 | * Window> Preference s>Java>Cod e Generati on>Code an d Comments | |
23 | */ | |
24 | package go v.va.med.f oundations .utilities ; | |
25 | ||
26 | import org .apache.lo g4j.Logger ; | |
27 | ||
28 | import jav ax.naming. Context; | |
29 | import jav ax.naming. NamingExce ption; | |
30 | import jav ax.naming. directory. *; | |
31 | import jav a.util.Has htable; | |
32 | ||
33 | /** | |
34 | * @author DNS.URL | |
35 | * | |
36 | * To chan ge the tem plate for this gener ated type comment go to | |
37 | * Window> Preference s>Java>Cod e Generati on>Code an d Comments | |
38 | */ | |
39 | public cla ss LdapUti lities { | |
40 | ||
41 | /* * | |
42 | * The logge r used by this class | |
43 | * / | |
44 | pr ivate stat ic final L ogger logg er = Logge r.getLogge r(LdapUtil ities.clas s); | |
45 | ||
46 | // Initial c ontext imp lementatio n | |
47 | pu blic stati c final St ring INIT_ CONTEXT = "com.sun.j ndi.ldap.L dapCtxFact ory"; | |
48 | ||
49 | /* * | |
50 | * | |
51 | * / | |
52 | pr otected Ld apUtilitie s() { | |
53 | supe r(); | |
54 | // T ODO Auto-g enerated c onstructor stub | |
55 | } | |
56 | ||
57 | pu blic stati c String g etOidRepli caId(Strin g oidHostU rl) | |
58 | thro ws Foundat ionsExcept ion { | |
59 | retu rn LdapUti lities.get AttributeV alue(oidHo stUrl, "", "orclrepl icaid"); | |
60 | } | |
61 | ||
62 | pu blic stati c String g etAttribut eValue( | |
63 | Stri ng oidHost Url, | |
64 | Stri ng locatio n, | |
65 | Stri ng attrNam e) | |
66 | thro ws Foundat ionsExcept ion { | |
67 | { | |
68 | String attrValue = ""; | |
69 | ||
70 | try { | |
71 | ||
72 | // Hasht able for e nvironment al informa tion | |
73 | Hashtabl e<String, String> en v = new Ha shtable<St ring, Stri ng>(); | |
74 | ||
75 | // Speci fy which c lass to us e for our JNDI provi der | |
76 | env.put( Context.IN ITIAL_CONT EXT_FACTOR Y, INIT_CO NTEXT); | |
77 | ||
78 | // Speci fy host an d port to use for di rectory se rvice | |
79 | env.put( Context.PR OVIDER_URL , oidHostU rl); | |
80 | ||
81 | // Get a reference to a dire ctory cont ext | |
82 | DirConte xt ctx = n ew Initial DirContext (env); | |
83 | ||
84 | // SearchCo ntrols con straints = null; | |
85 | Attribut es attrs = | |
86 | ctx.getAtt ributes(lo cation, ne w String[] { attrNam e }); | |
87 | ||
88 | if (attr s != null) { | |
89 | Attribute attr = att rs.get(att rName); | |
90 | if (attr ! = null) { | |
91 | at trValue = attr.get() .toString( ); | |
92 | } else { | |
93 | at trValue = ""; | |
94 | } | |
95 | } else { | |
96 | attrValue = ""; | |
97 | } | |
98 | } catc h (NamingE xception e ) { | |
99 | StringBu ffer errSt r = | |
100 | new String Buffer().a ppend( | |
101 | "E rror tryin g read " + attrName + " at "). append( | |
102 | oi dHostUrl); | |
103 | ||
104 | if (logg er.isDebug Enabled()) { | |
105 | logger.deb ug(errStr) ; | |
106 | } | |
107 | throw ne w Foundati onsExcepti on(errStr. toString() , e); | |
108 | } | |
109 | ||
110 | return attrValue ; | |
111 | } | |
112 | ||
113 | } | |
114 | ||
115 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.