Produced by Araxis Merge on 12/5/2017 12:06:36 PM Central 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CacheWeb\src\gov\va\med\cache\rest | ClearCacheServlet.java | Mon Dec 4 21:34:08 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CacheWeb\src\gov\va\med\cache\rest | ClearCacheServlet.java | Mon Dec 4 21:58:04 2017 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 | * | |
| 3 | */ | |
| 4 | package go v.va.med.c ache.rest; | |
| 5 | ||
| 6 | import gov .va.med.im aging.stor age.cache. Cache; | |
| 7 | import gov .va.med.im aging.stor age.cache. CacheManag er; | |
| 8 | import gov .va.med.im aging.stor age.cache. exceptions .CacheExce ption; | |
| 9 | import gov .va.med.im aging.stor age.cache. impl.Cache ManagerImp l; | |
| 10 | ||
| 11 | import jav a.io.IOExc eption; | |
| 12 | ||
| 13 | import jav ax.managem ent.MBeanE xception; | |
| 14 | import jav ax.servlet .RequestDi spatcher; | |
| 15 | import jav ax.servlet .ServletEx ception; | |
| 16 | import jav ax.servlet .http.Http Servlet; | |
| 17 | import jav ax.servlet .http.Http ServletReq uest; | |
| 18 | import jav ax.servlet .http.Http ServletRes ponse; | |
| 19 | ||
| 20 | import org .apache.lo gging.log4 j.LogManag er; | |
| 21 | import org .apache.lo gging.log4 j.Logger; | |
| 22 | ||
| 23 | /** | |
| 24 | * @author
|
|
| 25 | * | |
| 26 | */ | |
| 27 | public cla ss ClearCa cheServlet | |
| 28 | extends Ht tpServlet | |
| 29 | { | |
| 30 | pr ivate stat ic final l ong serial VersionUID = 1L; | |
| 31 | pr ivate fina l Logger l ogger = Lo gManager.g etLogger(t his.getCla ss()); | |
| 32 | ||
| 33 | pr ivate stat ic final S tring CACH E_ERROR_ME SSAGE = | |
| 34 | "I c an feel my mind goin g Keith .. . would yo u like to hear a son g?"; | |
| 35 | pr ivate fina l static S tring GENE RIC_PISSY_ MESSAGE = | |
| 36 | "An exception occurred ' cause you didn't pro vide a cac he name." | |
| 37 | + ". .. and if you think I'm tellin g you how to specify the cache name then you've ju st " | |
| 38 | + "g ot another thing com in' there bubba. Th is is high ly technic al stuff h ere and no t for " | |
| 39 | + "m ere casual users. S o, if you don't know to put th e cache na me as the extra path info " | |
| 40 | + "t hen that i s just too bad. Oh yeah, the capitaliz ation bett er be righ t too!"; | |
| 41 | ||
| 42 | pr ivate fina l static S tring LESS _GENERIC_P ISSY_MESSA GE = | |
| 43 | "You 're gettin g warmer . .." | |
| 44 | + ". .. try som ething lik e http://l ocalhost:8 080/CacheW eb/ClearCa che/Imagin gExchangeC ache " | |
| 45 | + " and then m aybe I'll help you o ut."; | |
| 46 | ||
| 47 | pr ivate fina l static S tring SPEC IFIC_PISSY _MESSAGE = | |
| 48 | " is not a rea l cache na me" | |
| 49 | + ". .. try som ething lik e http://l ocalhost:8 080/CacheW eb/ClearCa che/Imagin gExchangeC ache " | |
| 50 | + " and then m aybe I'll help you o ut."; | |
| 51 | ||
| 52 | /* * | |
| 53 | * | |
| 54 | * / | |
| 55 | pu blic Clear CacheServl et() { } | |
| 56 | ||
| 57 | /* * | |
| 58 | * Get the C acheManage r implemen tation. L og the has hCode of t he cache m anager so that we ca n assure t hat the | |
| 59 | * instance used by th is web app is the sa me instanc e as used by the app lications. | |
| 60 | * | |
| 61 | * @return | |
| 62 | * @throws C acheExcept ion | |
| 63 | * @throws M BeanExcept ion | |
| 64 | * / | |
| 65 | pr ivate Cach eManager g etCacheMan ager() | |
| 66 | th rows MBean Exception, CacheExce ption | |
| 67 | { | |
| 68 | Cach eManager c acheManage r = CacheM anagerImpl .getSingle ton(); | |
| 69 | ||
| 70 | logg er.info("C acheManage r instance is " | |
| 71 | + (cac heManager == null ? "NULL" : ( cacheManag er.getClas s().getSim pleName() + "[" + ca cheManager .hashCode( ) + "]")) | |
| 72 | ); | |
| 73 | ||
| 74 | retu rn cacheMa nager; | |
| 75 | } | |
| 76 | ||
| 77 | @O verride | |
| 78 | pr otected vo id doGet(H ttpServlet Request re q, HttpSer vletRespon se resp) | |
| 79 | th rows Servl etExceptio n, IOExcep tion | |
| 80 | { | |
| 81 | Stri ng cacheNa me = req.g etPathInfo (); | |
| 82 | if(c acheName = = null || cacheName. length() < = 1) | |
| 83 | throw new Servle tException (GENERIC_P ISSY_MESSA GE); | |
| 84 | cach eName = ca cheName.su bstring(1) ; | |
| 85 | ||
| 86 | try | |
| 87 | { | |
| 88 | Cache cache = ge tCacheMana ger().getC ache(cache Name); | |
| 89 | if(cac he == null ) | |
| 90 | throw ne w ServletE xception(c acheName + SPECIFIC_ PISSY_MESS AGE); | |
| 91 | cache. clear(); | |
| 92 | Reques tDispatche r rd = req .getReques tDispatche r("/ClearC acheSucces sful.jsp") ; | |
| 93 | rd.inc lude(req, resp); | |
| 94 | } | |
| 95 | catc h(CacheExc eption cX) | |
| 96 | { | |
| 97 | throw new Servle tException (CACHE_ERR OR_MESSAGE , cX); | |
| 98 | } | |
| 99 | catc h (Excepti on e) | |
| 100 | { | |
| 101 | throw new Servle tException (LESS_GENE RIC_PISSY_ MESSAGE, e ); | |
| 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.