Class DockerLogin
java.lang.Object
net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
net.ssehub.easy.instantiation.docker.instantiators.AbstractDockerInstantiator
net.ssehub.easy.instantiation.docker.instantiators.DockerLogin
- All Implemented Interfaces:
net.ssehub.easy.instantiation.core.model.vilTypes.IVilType
Instantiator to log into a docker registry.
- Author:
- Monika Staciwa
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class net.ssehub.easy.instantiation.docker.instantiators.AbstractDockerInstantiator
FAIL_ON_ERROR, SKIP_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidaddConfig(com.github.dockerjava.api.model.AuthConfig config) Adds an auth config.(package private) static voidclear()Clears an existing authentication configuration.(package private) static booleanClears an existing authentication configuration.static booleandockerLogin(String registry, String user, String password) Logs into the given docker registry.(package private) static com.github.dockerjava.api.model.AuthConfiggetAuthConfig(String registryAddress) Returns the auth configuration for the given registry address.(package private) static com.github.dockerjava.api.model.AuthConfigurationsReturns the known/validated auth configs.Methods inherited from class net.ssehub.easy.instantiation.docker.instantiators.AbstractDockerInstantiator
createClient, handleThrowable, skipMethods inherited from class net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator
determineTargetPath, toString
-
Field Details
-
authConfig
-
-
Constructor Details
-
DockerLogin
public DockerLogin()
-
-
Method Details
-
getAuthConfigs
static com.github.dockerjava.api.model.AuthConfigurations getAuthConfigs()Returns the known/validated auth configs.- Returns:
- the known/validated auth configs, null for none
-
getAuthConfig
Returns the auth configuration for the given registry address.- Parameters:
registryAddress- the address- Returns:
- the auth configuration or null for none
-
addConfig
static void addConfig(com.github.dockerjava.api.model.AuthConfig config) Adds an auth config.- Parameters:
config- the config to add
-
clear
Clears an existing authentication configuration.- Parameters:
registryAddress- the registry to clear the authentication for- Returns:
trueif successful
-
clear
static void clear()Clears an existing authentication configuration. -
dockerLogin
public static boolean dockerLogin(String registry, String user, String password) throws net.ssehub.easy.instantiation.core.model.common.VilException Logs into the given docker registry. Stores the authentication configuration if successful and applies it automatically.- Parameters:
registry- the registry addressuser- the user namepassword- the password- Returns:
trueif successful- Throws:
net.ssehub.easy.instantiation.core.model.common.VilException- in case of artifact / parameter problems
-