-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
US2023090800967 adapter SDK 支持ak/sk的轮转
- Loading branch information
z30050892
committed
Sep 8, 2023
1 parent
e7aede3
commit 4ee280e
Showing
7 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
huaweicloud-sdk-java-dis/src/main/java/com/huaweicloud/dis/core/builder/AkSkHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.huaweicloud.dis.core.builder; | ||
|
||
public interface AkSkHolder { | ||
public String getAk(); | ||
|
||
public String getSk(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
huaweicloud-sdk-java-dis/src/main/java/com/huaweicloud/dis/core/util/AkSkUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.huaweicloud.dis.core.util; | ||
|
||
import com.huaweicloud.dis.core.builder.AkSkHolder; | ||
|
||
public class AkSkUtils { | ||
private static volatile AkSkUtils instance; | ||
|
||
private AkSkHolder akSkHolder; | ||
|
||
|
||
public AkSkHolder getAkSkHolder() { | ||
return akSkHolder; | ||
} | ||
|
||
public void setAkSkHolder(AkSkHolder akSkHolder) { | ||
this.akSkHolder = akSkHolder; | ||
} | ||
|
||
public static AkSkUtils getInstance(){ | ||
if(instance==null){ | ||
synchronized (AkSkUtils.class){ | ||
if(instance==null){ | ||
instance=new AkSkUtils(); | ||
} | ||
} | ||
} | ||
return instance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters