Produced by Araxis Merge on 6/9/2017 3:49:48 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 | Fri Jun 9 19:49:48 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-client\src\main\java\gov\va\nvap\service\auth | ServicePermissionDAO.java | Fri Apr 21 20:03:26 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 73 |
| 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 | * To chan ge this te mplate, ch oose Tools | Templat es | |||||
| 3 | * and ope n the temp late in th e editor. | |||||
| 4 | */ | |||||
| 5 | package go v.va.nvap. service.au th; | |||||
| 6 | ||||||
| 7 | import jav a.util.Arr ayList; | |||||
| 8 | import jav a.util.Lis t; | |||||
| 9 | import jav ax.persist ence.Entit yManager; | |||||
| 10 | import jav ax.persist ence.NoRes ultExcepti on; | |||||
| 11 | import jav ax.persist ence.Persi stenceCont ext; | |||||
| 12 | import jav ax.persist ence.Query ; | |||||
| 13 | ||||||
| 14 | /** | |||||
| 15 | * | |||||
| 16 | * @author 564685 | |||||
| 17 | */ | |||||
| 18 | public cla ss Service Permission DAO { | |||||
| 19 | ||||||
| 20 | @Persi stenceCont ext(name = "VapEntit yManager") | |||||
| 21 | privat e EntityMa nager em; | |||||
| 22 | ||||||
| 23 | public void setE ntityManag er(EntityM anager ent ityManager ) { | |||||
| 24 | th is.em = en tityManage r; | |||||
| 25 | } | |||||
| 26 | ||||||
| 27 | public long crea te(final S ervicePerm ission sp) | |||||
| 28 | throws E xception { | |||||
| 29 | Se rvicePermi ssion exis tCheck = t his.checkA uthorizati on(sp.getC n()); | |||||
| 30 | if (existChec k != null) { | |||||
| 31 | return - 1; | |||||
| 32 | } | |||||
| 33 | tr y { | |||||
| 34 | this.em. persist(sp ); | |||||
| 35 | } catch (fin al Excepti on ex) { | |||||
| 36 | throw ex ; | |||||
| 37 | } | |||||
| 38 | re turn sp.ge tId(); | |||||
| 39 | } | |||||
| 40 | ||||||
| 41 | public ServicePe rmission f indService Permission (final Lon g id) { | |||||
| 42 | re turn this. em.find(Se rvicePermi ssion.clas s, id); | |||||
| 43 | } | |||||
| 44 | ||||||
| 45 | public ServicePe rmission c heckAuthor ization(fi nal String cn) { | |||||
| 46 | tr y { | |||||
| 47 | final Qu ery q = th is.em | |||||
| 48 | .createNam edQuery("S ervicePerm ission.che ckAuthoriz ation"); | |||||
| 49 | q.setPar ameter("cn ", cn); | |||||
| 50 | return ( ServicePer mission) q .getSingle Result(); | |||||
| 51 | } catch (fin al NoResul tException nre) { | |||||
| 52 | return n ull; | |||||
| 53 | } | |||||
| 54 | } | |||||
| 55 | ||||||
| 56 | public List<Serv icePermiss ion> getSe rvicePermi ssions() { | |||||
| 57 | tr y { | |||||
| 58 | final Qu ery q = th is.em | |||||
| 59 | .createNam edQuery("S ervicePerm ission.get ServicePer missions") ; | |||||
| 60 | return ( List<Servi cePermissi on>) q.get ResultList (); | |||||
| 61 | } catch (fin al NoResul tException nre) { | |||||
| 62 | return n ew ArrayLi st<Service Permission >(); | |||||
| 63 | } | |||||
| 64 | } | |||||
| 65 | ||||||
| 66 | public void setS tatus(Stri ng cn, Boo lean statu s) { | |||||
| 67 | fi nal Query q = this.e m | |||||
| 68 | .cre ateNamedQu ery("Servi cePermissi on.setStat us"); | |||||
| 69 | q. setParamet er("cn", c n); | |||||
| 70 | q. setParamet er("enable d", status ); | |||||
| 71 | q. executeUpd ate(); | |||||
| 72 | } | |||||
| 73 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.