Package land.oras

Class Registry.Builder

java.lang.Object
land.oras.Registry.Builder
Enclosing class:
Registry

public static class Registry.Builder extends Object
Builder for the registry
  • Method Details

    • defaults

      public Registry.Builder defaults()
      Return a new builder with default authentication using existing host auth
      Returns:
      The builder
    • defaults

      public Registry.Builder defaults(String registry)
      Return a new builder with default authentication using existing host auth and registry url
      Parameters:
      registry - The registry URL (ex: localhost:5000)
      Returns:
      The builder
    • from

      public Registry.Builder from(Registry registry)
      Return a new builder with the same configuration as the given registry
      Parameters:
      registry - The registry to copy the configuration from
      Returns:
      The builder
    • defaults

      public Registry.Builder defaults(String username, String password)
      Set username and password authentication
      Parameters:
      username - The username
      password - The password
      Returns:
      The builder
    • defaults

      public Registry.Builder defaults(String registry, String username, String password)
      Set username and password authentication
      Parameters:
      registry - The registry URL (ex: localhost:5000)
      username - The username
      password - The password
      Returns:
      The builder
    • insecure

      public Registry.Builder insecure()
      Set insecure communication and no authentification
      Returns:
      The builder
    • insecure

      public Registry.Builder insecure(String registry)
      Set insecure communication and no authentification
      Parameters:
      registry - The registry (ex: localhost:5000)
      Returns:
      The builder
    • insecure

      public Registry.Builder insecure(String registry, String username, String password)
      Return a new insecure builder with username and password authentication
      Parameters:
      registry - The registry (ex: localhost:5000)
      username - The username
      password - The password
      Returns:
      The builder
    • withRegistry

      public Registry.Builder withRegistry(String registry)
      Set the registry URL
      Parameters:
      registry - The registry URL
      Returns:
      The builder
    • withAuthProvider

      public Registry.Builder withAuthProvider(AuthProvider authProvider)
      Set the auth provider
      Parameters:
      authProvider - The auth provider
      Returns:
      The builder
    • withParallelism

      public Registry.Builder withParallelism(int parallelism)
      Set the maximum number of concurrent downloads when pulling an artifact with multiple layers. Default is 4.
      Parameters:
      parallelism - The maximum number of parallel uploads/download
      Returns:
      The builder
    • withExecutorService

      public Registry.Builder withExecutorService(ExecutorService executorService)
      Set the executor service to use for parallel uploads/downloads. By default it uses a parallelism level given by withParallelism() and a fixed thread pool. Only uses for layers upload/download, not for manifest or index upload/download.
      Parameters:
      executorService - The executor service
      Returns:
      The builder
    • withInsecure

      public Registry.Builder withInsecure(boolean insecure)
      Set the insecure flag
      Parameters:
      insecure - Insecure
      Returns:
      The builder
    • withSkipTlsVerify

      public Registry.Builder withSkipTlsVerify(boolean skipTlsVerify)
      Set the skip TLS verify flag
      Parameters:
      skipTlsVerify - Skip TLS verify
      Returns:
      The builder
    • withMeterRegistry

      public Registry.Builder withMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Set the meter registry for metrics. Following Micrometer best practices for libraries, a SimpleMeterRegistry is used by default when no registry is provided.
      Parameters:
      meterRegistry - The meter registry
      Returns:
      The builder
    • builder

      public static Registry.Builder builder()
      Return a new builder
      Returns:
      The builder
    • build

      public Registry build()
      Build the registry
      Returns:
      The registry