Package org.mandas.docker.client.builder
Interface DockerClientBuilder<B extends DockerClientBuilder<B>>
-
- Type Parameters:
B- the type of the builder
- All Known Implementing Classes:
BaseDockerClientBuilder,JerseyDockerClientBuilder,ResteasyDockerClientBuilder
public interface DockerClientBuilder<B extends DockerClientBuilder<B>>DockerClientBuilderis an interface which has to be implemented from clients when they need to use a JAXRS client implementation other than the provided Jersey- Author:
- Dimitris Mandalidis
- See Also:
BaseDockerClientBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDockerClientBuilder.EntityProcessing
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BapiVersion(String apiVersion)Set the Docker API version that will be used in the HTTP requests to Docker daemon.DefaultDockerClientbuild()BconnectionPoolSize(int connectionPoolSize)Set the size of the connection pool for connections to Docker.BconnectTimeoutMillis(long connectTimeoutMillis)Set the timeout in milliseconds until a connection to Docker is established.BdockerCertificates(DockerCertificatesStore dockerCertificatesStore)Provide certificates to secure the connection to Docker.BentityProcessing(DockerClientBuilder.EntityProcessing entityProcessing)Allows setting transfer encoding.BfromEnv()Sets or overwritesuri()anddockerCertificates(DockerCertificatesStore)according to the values present in DOCKER_HOST and DOCKER_CERT_PATH environment variables.Bheader(String name, Object value)Adds additional headers to be sent in all requests to the Docker Remote API.BreadTimeoutMillis(long readTimeoutMillis)Set the SO_TIMEOUT in milliseconds.BregistryAuthSupplier(RegistryAuthSupplier registryAuthSupplier)URIuri()Buri(String uri)Buri(URI uri)BuseProxy(boolean useProxy)Allows connecting to Docker Daemon using HTTP proxy.
-
-
-
Method Detail
-
uri
URI uri()
- Returns:
- the URI of the Docker engine
-
fromEnv
B fromEnv() throws DockerCertificateException
Sets or overwritesuri()anddockerCertificates(DockerCertificatesStore)according to the values present in DOCKER_HOST and DOCKER_CERT_PATH environment variables.- Returns:
- Modifies a builder that can be used to further customize and then build the client.
- Throws:
DockerCertificateException- if we could not build a DockerCertificates object
-
build
DefaultDockerClient build()
-
header
B header(String name, Object value)
Adds additional headers to be sent in all requests to the Docker Remote API.- Parameters:
name- the header namevalue- the header value- Returns:
- this
-
registryAuthSupplier
B registryAuthSupplier(RegistryAuthSupplier registryAuthSupplier)
-
connectionPoolSize
B connectionPoolSize(int connectionPoolSize)
Set the size of the connection pool for connections to Docker. Note that due to a known issue, DefaultDockerClient maintains two separate connection pools, each of which is capped at this size. Therefore, the maximum number of concurrent connections to Docker may be up to 2 * connectionPoolSize.- Parameters:
connectionPoolSize- connection pool size- Returns:
- Builder
-
useProxy
B useProxy(boolean useProxy)
Allows connecting to Docker Daemon using HTTP proxy.- Parameters:
useProxy- tells if Docker Client has to connect to docker daemon using HTTP Proxy- Returns:
- Builder
-
apiVersion
B apiVersion(String apiVersion)
Set the Docker API version that will be used in the HTTP requests to Docker daemon.- Parameters:
apiVersion- String for Docker API version- Returns:
- Builder
-
connectTimeoutMillis
B connectTimeoutMillis(long connectTimeoutMillis)
Set the timeout in milliseconds until a connection to Docker is established. A timeout value of zero is interpreted as an infinite timeout.- Parameters:
connectTimeoutMillis- connection timeout to Docker daemon in milliseconds- Returns:
- Builder
-
readTimeoutMillis
B readTimeoutMillis(long readTimeoutMillis)
Set the SO_TIMEOUT in milliseconds. This is the maximum period of inactivity between receiving two consecutive data packets from Docker.- Parameters:
readTimeoutMillis- read timeout to Docker daemon in milliseconds- Returns:
- Builder
-
dockerCertificates
B dockerCertificates(DockerCertificatesStore dockerCertificatesStore)
Provide certificates to secure the connection to Docker.- Parameters:
dockerCertificatesStore- DockerCertificatesStore object- Returns:
- Builder
-
entityProcessing
B entityProcessing(DockerClientBuilder.EntityProcessing entityProcessing)
Allows setting transfer encoding. CHUNKED does not send the content-length header while BUFFERED does.By default ApacheConnectorProvider uses CHUNKED mode. Some Docker API end-points seems to fail when no content-length is specified but a body is sent.
- Parameters:
entityProcessing- is the requested entity processing to use when calling docker daemon (tcp protocol).- Returns:
- Builder
-
-