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

public class DockerLogin extends AbstractDockerInstantiator
Instantiator to log into a docker registry.
Author:
Monika Staciwa
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static Map<String,com.github.dockerjava.api.model.AuthConfig>
     

    Fields inherited from class net.ssehub.easy.instantiation.docker.instantiators.AbstractDockerInstantiator

    FAIL_ON_ERROR, SKIP_ID
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    addConfig(com.github.dockerjava.api.model.AuthConfig config)
    Adds an auth config.
    (package private) static void
    Clears an existing authentication configuration.
    (package private) static boolean
    clear(String registryAddress)
    Clears an existing authentication configuration.
    static boolean
    dockerLogin(String registry, String user, String password)
    Logs into the given docker registry.
    (package private) static com.github.dockerjava.api.model.AuthConfig
    getAuthConfig(String registryAddress)
    Returns the auth configuration for the given registry address.
    (package private) static com.github.dockerjava.api.model.AuthConfigurations
    Returns the known/validated auth configs.

    Methods inherited from class net.ssehub.easy.instantiation.docker.instantiators.AbstractDockerInstantiator

    createClient, handleThrowable, skip

    Methods inherited from class net.ssehub.easy.instantiation.core.model.defaultInstantiators.AbstractFileInstantiator

    determineTargetPath, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • authConfig

      private static Map<String,com.github.dockerjava.api.model.AuthConfig> 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

      static com.github.dockerjava.api.model.AuthConfig getAuthConfig(String registryAddress)
      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

      static boolean clear(String registryAddress)
      Clears an existing authentication configuration.
      Parameters:
      registryAddress - the registry to clear the authentication for
      Returns:
      true if 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 address
      user - the user name
      password - the password
      Returns:
      true if successful
      Throws:
      net.ssehub.easy.instantiation.core.model.common.VilException - in case of artifact / parameter problems