@@ -179,7 +179,7 @@ public ServicePolicies getServicePoliciesIfUpdated(final long lastKnownVersion,
179179
180180 ret = null ;
181181 } else if (response .getStatus () == HttpStatus .SC_OK ) {
182- ret = JsonUtilsV2 .readResponse (response , ServicePolicies .class );
182+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , ServicePolicies .class );
183183 } else if (response .getStatus () == HttpStatus .SC_NOT_FOUND ) {
184184 ret = null ;
185185
@@ -257,7 +257,7 @@ public RangerRoles getRolesIfUpdated(final long lastKnownRoleVersion, final long
257257
258258 ret = null ;
259259 } else if (response .getStatus () == HttpStatus .SC_OK ) {
260- ret = JsonUtilsV2 .readResponse (response , RangerRoles .class );
260+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , RangerRoles .class );
261261 } else if (response .getStatus () == HttpStatus .SC_NOT_FOUND ) {
262262 ret = null ;
263263
@@ -327,7 +327,7 @@ public RangerRole createRole(final RangerRole request) throws Exception {
327327 } else if (response == null ) {
328328 throw new Exception ("unknown error during createRole. roleName=" + request .getName ());
329329 } else {
330- ret = JsonUtilsV2 .readResponse (response , RangerRole .class );
330+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , RangerRole .class );
331331 }
332332
333333 LOG .debug ("<== RangerAdminRESTClient.createRole({})" , request );
@@ -430,7 +430,7 @@ public List<String> getAllRoles(final String execUser) throws Exception {
430430
431431 throw new Exception ("HTTP " + response .getStatus () + " Error: " + resp .getMessage ());
432432 } else {
433- ret = JsonUtilsV2 .readResponse (response , TYPE_LIST_STRING );
433+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , TYPE_LIST_STRING );
434434 }
435435 } else {
436436 throw new Exception ("unknown error during getAllRoles." );
@@ -482,7 +482,7 @@ public List<String> getUserRoles(final String execUser) throws Exception {
482482
483483 throw new Exception ("HTTP " + response .getStatus () + " Error: " + resp .getMessage ());
484484 } else {
485- ret = JsonUtilsV2 .readResponse (response , TYPE_LIST_STRING );
485+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , TYPE_LIST_STRING );
486486 }
487487 } else {
488488 throw new Exception ("unknown error during getUserRoles. execUser=" + execUser );
@@ -538,7 +538,7 @@ public RangerRole getRole(final String execUser, final String roleName) throws E
538538
539539 throw new Exception ("HTTP " + response .getStatus () + " Error: " + resp .getMessage ());
540540 } else {
541- ret = JsonUtilsV2 .readResponse (response , RangerRole .class );
541+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , RangerRole .class );
542542 }
543543 } else {
544544 throw new Exception ("unknown error during getPrincipalsForRole. roleName=" + roleName );
@@ -791,7 +791,7 @@ public ServiceTags getServiceTagsIfUpdated(final long lastKnownVersion, final lo
791791
792792 ret = null ;
793793 } else if (response .getStatus () == HttpStatus .SC_OK ) {
794- ret = JsonUtilsV2 .readResponse (response , ServiceTags .class );
794+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , ServiceTags .class );
795795 } else if (response .getStatus () == HttpStatus .SC_NOT_FOUND ) {
796796 ret = null ;
797797
@@ -851,7 +851,7 @@ public List<String> getTagTypes(String pattern) throws Exception {
851851 List <String > ret ;
852852
853853 if (response != null && response .getStatus () == HttpStatus .SC_OK ) {
854- ret = JsonUtilsV2 .readResponse (response , TYPE_LIST_STRING );
854+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , TYPE_LIST_STRING );
855855 } else {
856856 RESTResponse resp = RESTResponse .fromClientResponse (response );
857857
@@ -919,7 +919,7 @@ public RangerUserStore getUserStoreIfUpdated(long lastKnownUserStoreVersion, lon
919919
920920 ret = null ;
921921 } else if (response .getStatus () == HttpStatus .SC_OK ) {
922- ret = JsonUtilsV2 .readResponse (response , RangerUserStore .class );
922+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , RangerUserStore .class );
923923 } else if (response .getStatus () == HttpStatus .SC_NOT_FOUND ) {
924924 ret = null ;
925925
@@ -996,7 +996,7 @@ public ServiceGdsInfo getGdsInfoIfUpdated(long lastKnownVersion, long lastActiva
996996 LOG .debug ("No change in GdsInfo: secureMode={}, response={}, serviceName={}, lastKnownGdsVersion={}, lastActivationTimeInMillis={}" ,
997997 isSecureMode , resp , serviceName , lastKnownVersion , lastActivationTimeInMillis );
998998 } else if (response .getStatus () == HttpStatus .SC_OK ) {
999- ret = JsonUtilsV2 .readResponse (response , ServiceGdsInfo .class );
999+ ret = JsonUtilsV2 .jsonToObj (response . getEntity ( String . class ) , ServiceGdsInfo .class );
10001000 } else if (response .getStatus () == HttpStatus .SC_NOT_FOUND ) {
10011001 ret = null ;
10021002
0 commit comments