@@ -41,6 +41,7 @@ synchronized boolean switchRegion(RegionReqInfo regionReqInfo) {
4141 }
4242 }
4343
44+ @ Override
4445 String getRegion (RegionReqInfo regionReqInfo ) {
4546 if (currentRegion == null ) {
4647 return "" ;
@@ -49,6 +50,7 @@ String getRegion(RegionReqInfo regionReqInfo) {
4950 }
5051 }
5152
53+ @ Override
5254 List <String > getSrcUpHost (RegionReqInfo regionReqInfo ) throws QiniuException {
5355 if (currentRegion == null ) {
5456 return null ;
@@ -57,6 +59,7 @@ List<String> getSrcUpHost(RegionReqInfo regionReqInfo) throws QiniuException {
5759 }
5860 }
5961
62+ @ Override
6063 List <String > getAccUpHost (RegionReqInfo regionReqInfo ) throws QiniuException {
6164 if (currentRegion == null ) {
6265 return null ;
@@ -65,6 +68,7 @@ List<String> getAccUpHost(RegionReqInfo regionReqInfo) throws QiniuException {
6568 }
6669 }
6770
71+ @ Override
6872 String getIovipHost (RegionReqInfo regionReqInfo ) throws QiniuException {
6973 if (currentRegion == null ) {
7074 return null ;
@@ -73,6 +77,7 @@ String getIovipHost(RegionReqInfo regionReqInfo) throws QiniuException {
7377 }
7478 }
7579
80+ @ Override
7681 String getRsHost (RegionReqInfo regionReqInfo ) throws QiniuException {
7782 if (currentRegion == null ) {
7883 return null ;
@@ -81,6 +86,7 @@ String getRsHost(RegionReqInfo regionReqInfo) throws QiniuException {
8186 }
8287 }
8388
89+ @ Override
8490 String getRsfHost (RegionReqInfo regionReqInfo ) throws QiniuException {
8591 if (currentRegion == null ) {
8692 return null ;
@@ -89,6 +95,7 @@ String getRsfHost(RegionReqInfo regionReqInfo) throws QiniuException {
8995 }
9096 }
9197
98+ @ Override
9299 String getApiHost (RegionReqInfo regionReqInfo ) throws QiniuException {
93100 if (currentRegion == null ) {
94101 return null ;
@@ -97,6 +104,7 @@ String getApiHost(RegionReqInfo regionReqInfo) throws QiniuException {
97104 }
98105 }
99106
107+ @ Override
100108 Region getCurrentRegion (RegionReqInfo regionReqInfo ) {
101109 if (currentRegion == null ) {
102110 return null ;
@@ -109,11 +117,18 @@ Region getCurrentRegion(RegionReqInfo regionReqInfo) {
109117
110118 @ Override
111119 boolean isValid () {
112- if (currentRegion == null ) {
120+ if (regionList . size () == 0 ) {
113121 return false ;
114122 }
115- // 只判断当前的
116- return currentRegion .isValid ();
123+
124+ boolean valid = true ;
125+ for (Region region : regionList ) {
126+ if (region == null || !region .isValid ()) {
127+ valid = false ;
128+ break ;
129+ }
130+ }
131+ return valid ;
117132 }
118133
119134 private void updateCurrentRegion () {
0 commit comments