@@ -15,6 +15,7 @@ public class DefaultProfile implements IClientProfile {
15
15
private String regionId = null ;
16
16
private FormatType acceptFormat = null ;
17
17
private ICredentialProvider icredential = null ;
18
+ private volatile AlibabaCloudCredentialsProvider credentialsProvider = null ;
18
19
private Credential credential ;
19
20
private String certPath ;
20
21
private HttpClientConfig httpClientConfig = HttpClientConfig .getDefault ();
@@ -50,6 +51,10 @@ public synchronized static DefaultProfile getProfile() {
50
51
return profile ;
51
52
}
52
53
54
+ /**
55
+ * @deprecated : Use DefaultAcsClient(IClientProfile profile, AlibabaCloudCredentialsProvider credentialsProvider) instead of this
56
+ */
57
+ @ Deprecated
53
58
public synchronized static DefaultProfile getProfile (String regionId , ICredentialProvider icredential ) {
54
59
profile = new DefaultProfile (regionId , icredential );
55
60
return profile ;
@@ -72,15 +77,15 @@ public synchronized static DefaultProfile getProfile(String regionId) {
72
77
}
73
78
74
79
/**
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
76
81
*/
77
82
@ Deprecated
78
83
public synchronized static void addEndpoint (String endpointName , String regionId , String product , String domain ) {
79
84
addEndpoint (endpointName , regionId , product , domain , true );
80
85
}
81
86
82
87
/**
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
84
89
*/
85
90
@ Deprecated
86
91
public synchronized static void addEndpoint (String endpointName , String regionId , String product , String domain ,
@@ -104,6 +109,11 @@ public synchronized FormatType getFormat() {
104
109
return acceptFormat ;
105
110
}
106
111
112
+ @ Override
113
+ public AlibabaCloudCredentialsProvider getCredentialsProvider () {
114
+ return credentialsProvider ;
115
+ }
116
+
107
117
@ Override
108
118
public synchronized Credential getCredential () {
109
119
if (null == credential && null != icredential ) {
@@ -118,12 +128,17 @@ public ISigner getSigner() {
118
128
return null ;
119
129
}
120
130
131
+
132
+ /**
133
+ * @deprecated : Use DefaultAcsClient(IClientProfile profile, AlibabaCloudCredentialsProvider credentialsProvider) instead of this
134
+ */
121
135
@ Override
136
+ @ Deprecated
122
137
public void setCredentialsProvider (AlibabaCloudCredentialsProvider credentialsProvider ) {
123
- if (credential ! = null ) {
124
- return ;
138
+ if (credential = = null ) {
139
+ credential = new CredentialsBackupCompatibilityAdaptor ( credentialsProvider ) ;
125
140
}
126
- credential = new CredentialsBackupCompatibilityAdaptor ( credentialsProvider ) ;
141
+ this . credentialsProvider = credentialsProvider ;
127
142
}
128
143
129
144
@ Override
0 commit comments