@@ -15,6 +15,7 @@ public class DefaultProfile implements IClientProfile {
1515 private String regionId = null ;
1616 private FormatType acceptFormat = null ;
1717 private ICredentialProvider icredential = null ;
18+ private volatile AlibabaCloudCredentialsProvider credentialsProvider = null ;
1819 private Credential credential ;
1920 private String certPath ;
2021 private HttpClientConfig httpClientConfig = HttpClientConfig .getDefault ();
@@ -50,6 +51,10 @@ public synchronized static DefaultProfile getProfile() {
5051 return profile ;
5152 }
5253
54+ /**
55+ * @deprecated : Use DefaultAcsClient(IClientProfile profile, AlibabaCloudCredentialsProvider credentialsProvider) instead of this
56+ */
57+ @ Deprecated
5358 public synchronized static DefaultProfile getProfile (String regionId , ICredentialProvider icredential ) {
5459 profile = new DefaultProfile (regionId , icredential );
5560 return profile ;
@@ -72,15 +77,15 @@ public synchronized static DefaultProfile getProfile(String regionId) {
7277 }
7378
7479 /**
75- * @Deprecated : Use addEndpoint(String regionId, String product, String endpoint) instead of this
80+ * @deprecated : Use addEndpoint(String regionId, String product, String endpoint) instead of this
7681 */
7782 @ Deprecated
7883 public synchronized static void addEndpoint (String endpointName , String regionId , String product , String domain ) {
7984 addEndpoint (endpointName , regionId , product , domain , true );
8085 }
8186
8287 /**
83- * @Deprecated : Use addEndpoint(String regionId, String product, String endpoint) instead of this
88+ * @deprecated : Use addEndpoint(String regionId, String product, String endpoint) instead of this
8489 */
8590 @ Deprecated
8691 public synchronized static void addEndpoint (String endpointName , String regionId , String product , String domain ,
@@ -104,6 +109,11 @@ public synchronized FormatType getFormat() {
104109 return acceptFormat ;
105110 }
106111
112+ @ Override
113+ public AlibabaCloudCredentialsProvider getCredentialsProvider () {
114+ return credentialsProvider ;
115+ }
116+
107117 @ Override
108118 public synchronized Credential getCredential () {
109119 if (null == credential && null != icredential ) {
@@ -118,12 +128,17 @@ public ISigner getSigner() {
118128 return null ;
119129 }
120130
131+
132+ /**
133+ * @deprecated : Use DefaultAcsClient(IClientProfile profile, AlibabaCloudCredentialsProvider credentialsProvider) instead of this
134+ */
121135 @ Override
136+ @ Deprecated
122137 public void setCredentialsProvider (AlibabaCloudCredentialsProvider credentialsProvider ) {
123- if (credential ! = null ) {
124- return ;
138+ if (credential = = null ) {
139+ credential = new CredentialsBackupCompatibilityAdaptor ( credentialsProvider ) ;
125140 }
126- credential = new CredentialsBackupCompatibilityAdaptor ( credentialsProvider ) ;
141+ this . credentialsProvider = credentialsProvider ;
127142 }
128143
129144 @ Override
0 commit comments