Skip to content

Commit ce3aec5

Browse files
committed
renamed interface
1 parent 853bd7b commit ce3aec5

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

client/src/main/java/io/split/client/HttpClientDynamicCredentials.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77

88
class HttpClientDynamicCredentials implements org.apache.hc.client5.http.auth.CredentialsProvider {
99

10-
private final ProxyRuntimeStorage _proxyRuntimeStorage;
10+
private final ProxyRuntimeProvider _proxyRuntimeProvider;
1111

12-
public HttpClientDynamicCredentials (ProxyRuntimeStorage proxyRuntimeStorage) {
13-
_proxyRuntimeStorage = proxyRuntimeStorage;
12+
public HttpClientDynamicCredentials (ProxyRuntimeProvider proxyRuntimeProvider) {
13+
_proxyRuntimeProvider = proxyRuntimeProvider;
1414
}
1515

1616
@Override
1717
public Credentials getCredentials(AuthScope authScope, HttpContext context) {
1818

1919
// This Provider is invoked every time a request is made.
2020
// This should invoke a user-custom provider responsible for:
21-
return new BearerToken(_proxyRuntimeStorage.getJwtToken());
21+
return new BearerToken(_proxyRuntimeProvider.getJwtToken());
2222
}
2323

2424
}

client/src/main/java/io/split/client/ProxyRuntimeStorage.java renamed to client/src/main/java/io/split/client/ProxyRuntimeProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.split.client;
22

3-
public interface ProxyRuntimeStorage
3+
public interface ProxyRuntimeProvider
44
{
55
/**
66
* Get the additional headers needed for all http operations

client/src/main/java/io/split/client/SplitClientConfig.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static class HttpScheme {
9191
private final HttpHost _proxy;
9292
private final String _proxyUsername;
9393
private final String _proxyPassword;
94-
private final ProxyRuntimeStorage _proxyRuntimeStorage;
94+
private final ProxyRuntimeProvider _proxyRuntimeProvider;
9595
private final ProxyMTLSAuth _proxyMtlsAuth;
9696

9797
// To be set during startup
@@ -126,7 +126,7 @@ private SplitClientConfig(String endpoint,
126126
HttpHost proxy,
127127
String proxyUsername,
128128
String proxyPassword,
129-
ProxyRuntimeStorage proxyRuntimeStorage,
129+
ProxyRuntimeProvider proxyRuntimeProvider,
130130
ProxyMTLSAuth proxyMtlsAuth,
131131
int eventsQueueSize,
132132
long eventSendIntervalInMillis,
@@ -181,7 +181,7 @@ private SplitClientConfig(String endpoint,
181181
_proxy = proxy;
182182
_proxyUsername = proxyUsername;
183183
_proxyPassword = proxyPassword;
184-
_proxyRuntimeStorage = proxyRuntimeStorage;
184+
_proxyRuntimeProvider = proxyRuntimeProvider;
185185
_proxyMtlsAuth = proxyMtlsAuth;
186186
_eventsQueueSize = eventsQueueSize;
187187
_eventSendIntervalInMillis = eventSendIntervalInMillis;
@@ -314,8 +314,8 @@ public String proxyPassword() {
314314
return _proxyPassword;
315315
}
316316

317-
public ProxyRuntimeStorage proxyRuntimeStorage() {
318-
return _proxyRuntimeStorage;
317+
public ProxyRuntimeProvider proxyRuntimeStorage() {
318+
return _proxyRuntimeProvider;
319319
}
320320

321321
public ProxyMTLSAuth proxyMTLSAuth() {
@@ -463,7 +463,7 @@ public static final class Builder {
463463
private String _proxyScheme = HttpScheme.HTTP;
464464
private String _proxyUsername;
465465
private String _proxyPassword;
466-
private ProxyRuntimeStorage _proxyRuntimeStorage;
466+
private ProxyRuntimeProvider _proxyRuntimeProvider;
467467
private ProxyMTLSAuth _proxyMtlsAuth;
468468
private int _eventsQueueSize = 500;
469469
private long _eventSendIntervalInMillis = 30 * (long)1000;
@@ -813,11 +813,11 @@ public Builder proxyPassword(String proxyPassword) {
813813
/**
814814
* Set the token for authentication against the proxy (if proxy settings are enabled). (Optional).
815815
*
816-
* @param proxyRuntimeStorage
816+
* @param proxyRuntimeProvider
817817
* @return this builder
818818
*/
819-
public Builder proxyRuntimeStorage(ProxyRuntimeStorage proxyRuntimeStorage) {
820-
_proxyRuntimeStorage = proxyRuntimeStorage;
819+
public Builder proxyRuntimeStorage(ProxyRuntimeProvider proxyRuntimeProvider) {
820+
_proxyRuntimeProvider = proxyRuntimeProvider;
821821
return this;
822822
}
823823

@@ -1161,19 +1161,19 @@ private void verifyProxy() {
11611161
throw new IllegalArgumentException("Proxy scheme must be either http or https.");
11621162
}
11631163

1164-
if (_proxyUsername == null && _proxyRuntimeStorage == null && _proxyMtlsAuth == null) {
1164+
if (_proxyUsername == null && _proxyRuntimeProvider == null && _proxyMtlsAuth == null) {
11651165
return;
11661166
}
11671167

1168-
if (_proxyUsername != null && _proxyRuntimeStorage != null) {
1168+
if (_proxyUsername != null && _proxyRuntimeProvider != null) {
11691169
throw new IllegalArgumentException("Proxy user and Proxy token params are updated, set only one param.");
11701170
}
11711171

11721172
if (_proxyUsername != null && _proxyMtlsAuth != null) {
11731173
throw new IllegalArgumentException("Proxy user and Proxy mTLS params are updated, set only one param.");
11741174
}
11751175

1176-
if (_proxyRuntimeStorage != null && _proxyMtlsAuth != null) {
1176+
if (_proxyRuntimeProvider != null && _proxyMtlsAuth != null) {
11771177
throw new IllegalArgumentException("Proxy token and Proxy mTLS params are updated, set only one param.");
11781178
}
11791179

@@ -1223,7 +1223,7 @@ public SplitClientConfig build() {
12231223
proxy(),
12241224
_proxyUsername,
12251225
_proxyPassword,
1226-
_proxyRuntimeStorage,
1226+
_proxyRuntimeProvider,
12271227
_proxyMtlsAuth,
12281228
_eventsQueueSize,
12291229
_eventSendIntervalInMillis,

client/src/test/java/io/split/client/SplitClientConfigTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public void checkProxyParams() {
273273
Assert.assertEquals("user", config.proxyUsername());
274274
Assert.assertEquals("pass", config.proxyPassword());
275275

276-
ProxyRuntimeStorage proxyRuntimeStorage = new ProxyRuntimeStorage() {
276+
ProxyRuntimeProvider proxyRuntimeProvider = new ProxyRuntimeProvider() {
277277
@Override
278278
public String getJwtToken() {
279279
return "my-token";
@@ -283,9 +283,9 @@ public String getJwtToken() {
283283
config = SplitClientConfig.builder()
284284
.proxyHost("proxy-host")
285285
.proxyPort(8888)
286-
.proxyRuntimeStorage(proxyRuntimeStorage)
286+
.proxyRuntimeStorage(proxyRuntimeProvider)
287287
.build();
288-
Assert.assertEquals(proxyRuntimeStorage, config.proxyRuntimeStorage());
288+
Assert.assertEquals(proxyRuntimeProvider, config.proxyRuntimeStorage());
289289

290290
config = SplitClientConfig.builder()
291291
.proxyHost("proxy-host")
@@ -307,7 +307,7 @@ public void cannotUseInvalidHttpScheme() {
307307

308308
@Test(expected = IllegalArgumentException.class)
309309
public void cannotUseProxyTokenAndProxyUsername() {
310-
ProxyRuntimeStorage proxyRuntimeStorage = new ProxyRuntimeStorage() {
310+
ProxyRuntimeProvider proxyRuntimeProvider = new ProxyRuntimeProvider() {
311311
@Override
312312
public String getJwtToken() {
313313
return "my-token";
@@ -319,7 +319,7 @@ public String getJwtToken() {
319319
.proxyPort(8888)
320320
.proxyUsername("user")
321321
.proxyPassword("pass")
322-
.proxyRuntimeStorage(proxyRuntimeStorage)
322+
.proxyRuntimeStorage(proxyRuntimeProvider)
323323
.build();
324324
}
325325

@@ -336,7 +336,7 @@ public void cannotUseProxyUserAndProxyMtls() {
336336

337337
@Test(expected = IllegalArgumentException.class)
338338
public void cannotUseProxyTokenAndProxyMtls() {
339-
ProxyRuntimeStorage proxyRuntimeStorage = new ProxyRuntimeStorage() {
339+
ProxyRuntimeProvider proxyRuntimeProvider = new ProxyRuntimeProvider() {
340340
@Override
341341
public String getJwtToken() {
342342
return "my-token";
@@ -346,7 +346,7 @@ public String getJwtToken() {
346346
SplitClientConfig.builder()
347347
.proxyHost("proxy-host")
348348
.proxyPort(8888)
349-
.proxyRuntimeStorage(proxyRuntimeStorage)
349+
.proxyRuntimeStorage(proxyRuntimeProvider)
350350
.proxyMtlsAuth(new ProxyMTLSAuth.Builder().proxyP12File("path/to/file").proxyP12FilePassKey("pass-key").build())
351351
.build();
352352
}

0 commit comments

Comments
 (0)