forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerClientConfig.java
More file actions
58 lines (42 loc) · 1.4 KB
/
Copy pathDockerClientConfig.java
File metadata and controls
58 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Created on 08.06.2016
*/
package com.github.dockerjava.core;
import java.net.URI;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.dockerjava.api.model.AuthConfig;
import com.github.dockerjava.api.model.AuthConfigurations;
/**
* Interface that describes the docker client configuration.
*
* @author Marcus Linke
*
*/
public interface DockerClientConfig {
URI getDockerHost();
RemoteApiVersion getApiVersion();
String getRegistryUsername();
String getRegistryPassword();
String getRegistryEmail();
String getRegistryUrl();
AuthConfig effectiveAuthConfig(String imageName);
AuthConfigurations getAuthConfigurations();
/**
* Returns an {@link SSLConfig} when secure connection is configured or null if not.
*/
SSLConfig getSSLConfig();
default ObjectMapper getObjectMapper() {
return DefaultObjectMapperHolder.INSTANCE.getObjectMapper();
}
}
enum DefaultObjectMapperHolder {
INSTANCE;
private final ObjectMapper objectMapper = new ObjectMapper()
// TODO .setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL)
// TODO .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
public ObjectMapper getObjectMapper() {
return objectMapper;
}
}