checkTokenRetry 메소드 refactoring
This commit is contained in:
+6
-7
@@ -527,8 +527,8 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
// 이경우 정상으로 처리함
|
// 이경우 정상으로 처리함
|
||||||
} else if (status >= 200 && status <= 207) {
|
} else if (status >= 200 && status <= 207) {
|
||||||
if (useAdapterToken && StringUtils.equals(tokenErrorHttpStatusCode, "200")) {
|
if (useAdapterToken && StringUtils.equals(tokenErrorHttpStatusCode, "200")) {
|
||||||
needReissue = checkTokenRetry(responseMessage, tokenErrorCodeKey, tokenErrorCodeValues,
|
needReissue = checkTokenRetry(status, responseMessage, tokenErrorHttpStatusCode, tokenErrorCodeKey,
|
||||||
vo.getEncode());
|
tokenErrorCodeValues, vo.getEncode());
|
||||||
}
|
}
|
||||||
} else if (status == 302) {
|
} else if (status == 302) {
|
||||||
if (!StringUtils.contains(relayResponseHeaderKeys, "Location")) {
|
if (!StringUtils.contains(relayResponseHeaderKeys, "Location")) {
|
||||||
@@ -542,15 +542,14 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
|
|
||||||
if (status >= 400 && status < 500) {
|
if (status >= 400 && status < 500) {
|
||||||
if (useAdapterToken) {
|
if (useAdapterToken) {
|
||||||
needReissue = checkTokenRetry(responseMessage, tokenErrorCodeKey, tokenErrorCodeValues,
|
needReissue = checkTokenRetry(status, responseMessage, tokenErrorHttpStatusCode,
|
||||||
vo.getEncode());
|
tokenErrorCodeKey, tokenErrorCodeValues, vo.getEncode());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!needReissue) {
|
if (!needReissue) {
|
||||||
throw new Exception(errMsg);
|
throw new Exception(errMsg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
throw new Exception(errMsg);
|
throw new Exception(errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -882,8 +881,8 @@ public class HttpClient5AdapterServiceRest extends HttpClient5AdapterServiceSupp
|
|||||||
String.format("%s %s", AccessTokenVO.BEARER_TYPE, accessToken.getAccessToken()));
|
String.format("%s %s", AccessTokenVO.BEARER_TYPE, accessToken.getAccessToken()));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean checkTokenRetry(byte[] responseMessage, String tokenErrorCodeKey, String tokenErrorCodeValues,
|
protected boolean checkTokenRetry(int status, byte[] responseMessage, String tokenErrorHttpStatusCode,
|
||||||
String encode) {
|
String tokenErrorCodeKey, String tokenErrorCodeValues, String encode) {
|
||||||
if (responseMessage == null) {
|
if (responseMessage == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user