@@ -70,55 +70,55 @@ public class DockerClient implements Closeable {
7070
7171
7272 public DockerClient () {
73- this (Config .createDefaultConfigBuilder ().build ());
73+ this (DockerClientConfig .createDefaultConfigBuilder ().build ());
7474 }
7575
7676 public DockerClient (String serverUrl ) {
7777 this (configWithServerUrl (serverUrl ));
7878 }
7979
8080
81- private static Config configWithServerUrl (String serverUrl ) {
82- return Config .createDefaultConfigBuilder ()
81+ private static DockerClientConfig configWithServerUrl (String serverUrl ) {
82+ return DockerClientConfig .createDefaultConfigBuilder ()
8383 .withUri (serverUrl )
8484 .build ();
8585 }
8686
8787
88- public DockerClient (Config config ) {
89- this (config , new DefaultCommandFactory ());
88+ public DockerClient (DockerClientConfig dockerClientConfig ) {
89+ this (dockerClientConfig , new DefaultCommandFactory ());
9090 }
9191
92- public DockerClient (Config config , CommandFactory cmdFactory ) {
92+ public DockerClient (DockerClientConfig dockerClientConfig , CommandFactory cmdFactory ) {
9393 this .cmdFactory = cmdFactory ;
9494
95- HttpClient httpClient = getPoolingHttpClient (config );
95+ HttpClient httpClient = getPoolingHttpClient (dockerClientConfig );
9696 ClientConfig clientConfig = new DefaultClientConfig ();
9797 client = new ApacheHttpClient4 (new ApacheHttpClient4Handler (httpClient ,
9898 null , false ), clientConfig );
9999
100- if (config .getReadTimeout () != null ) {
101- client .setReadTimeout (config .getReadTimeout ());
100+ if (dockerClientConfig .getReadTimeout () != null ) {
101+ client .setReadTimeout (dockerClientConfig .getReadTimeout ());
102102 }
103103
104104 client .addFilter (new JsonClientFilter ());
105105
106- if (config .isLoggingFilterEnabled ())
106+ if (dockerClientConfig .isLoggingFilterEnabled ())
107107 client .addFilter (new SelectiveLoggingFilter ());
108108
109- WebResource webResource = client .resource (config .getUri ());
109+ WebResource webResource = client .resource (dockerClientConfig .getUri ());
110110
111- if (config .getVersion () != null ) {
112- baseResource = webResource .path ("v" + config .getVersion ());
111+ if (dockerClientConfig .getVersion () != null ) {
112+ baseResource = webResource .path ("v" + dockerClientConfig .getVersion ());
113113 } else {
114114 baseResource = webResource ;
115115 }
116116 }
117117
118118
119- private HttpClient getPoolingHttpClient (Config config ) {
119+ private HttpClient getPoolingHttpClient (DockerClientConfig dockerClientConfig ) {
120120 SchemeRegistry schemeRegistry = new SchemeRegistry ();
121- schemeRegistry .register (new Scheme ("http" , config .getUri ().getPort (),
121+ schemeRegistry .register (new Scheme ("http" , dockerClientConfig .getUri ().getPort (),
122122 PlainSocketFactory .getSocketFactory ()));
123123 schemeRegistry .register (new Scheme ("https" , 443 , SSLSocketFactory
124124 .getSocketFactory ()));
@@ -162,11 +162,11 @@ public AuthConfig authConfig() throws DockerException {
162162 private static AuthConfig authConfigFromProperties () throws DockerException {
163163 final AuthConfig a = new AuthConfig ();
164164
165- // TODO This should probably come from the Config used to create the DockerClient.
166- Config defaultConfig = Config .createDefaultConfigBuilder ().build ();
167- a .setUsername (defaultConfig .getUsername ());
168- a .setPassword (defaultConfig .getPassword ());
169- a .setEmail (defaultConfig .getEmail ());
165+ // TODO This should probably come from the DockerClientConfig used to create the DockerClient.
166+ DockerClientConfig defaultDockerClientConfig = DockerClientConfig .createDefaultConfigBuilder ().build ();
167+ a .setUsername (defaultDockerClientConfig .getUsername ());
168+ a .setPassword (defaultDockerClientConfig .getPassword ());
169+ a .setEmail (defaultDockerClientConfig .getEmail ());
170170
171171 if (a .getUsername () == null ) {
172172 throw new IllegalStateException ("username is null" );
0 commit comments