Package land.oras
Class Registry.Builder
java.lang.Object
land.oras.Registry.Builder
- Enclosing class:
- Registry
Builder for the registry
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the registrystatic Registry.Builderbuilder()Return a new builderdefaults()Return a new builder with default authentication using existing host authReturn a new builder with default authentication using existing host auth and registry urlSet username and password authenticationSet username and password authenticationReturn a new builder with the same configuration as the given registryinsecure()Set insecure communication and no authentificationSet insecure communication and no authentificationReturn a new insecure builder with username and password authenticationwithAuthProvider(AuthProvider authProvider) Set the auth providerwithExecutorService(ExecutorService executorService) Set the executor service to use for parallel uploads/downloads.withInsecure(boolean insecure) Set the insecure flagwithMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) Set the meter registry for metrics.withParallelism(int parallelism) Set the maximum number of concurrent downloads when pulling an artifact with multiple layers.withRegistry(String registry) Set the registry URLwithSkipTlsVerify(boolean skipTlsVerify) Set the skip TLS verify flag
-
Method Details
-
defaults
Return a new builder with default authentication using existing host auth- Returns:
- The builder
-
defaults
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
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
Set username and password authentication- Parameters:
username- The usernamepassword- The password- Returns:
- The builder
-
defaults
Set username and password authentication- Parameters:
registry- The registry URL (ex: localhost:5000)username- The usernamepassword- The password- Returns:
- The builder
-
insecure
Set insecure communication and no authentification- Returns:
- The builder
-
insecure
Set insecure communication and no authentification- Parameters:
registry- The registry (ex: localhost:5000)- Returns:
- The builder
-
insecure
Return a new insecure builder with username and password authentication- Parameters:
registry- The registry (ex: localhost:5000)username- The usernamepassword- The password- Returns:
- The builder
-
withRegistry
Set the registry URL- Parameters:
registry- The registry URL- Returns:
- The builder
-
withAuthProvider
Set the auth provider- Parameters:
authProvider- The auth provider- Returns:
- The builder
-
withParallelism
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
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
Set the insecure flag- Parameters:
insecure- Insecure- Returns:
- The builder
-
withSkipTlsVerify
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, aSimpleMeterRegistryis used by default when no registry is provided.- Parameters:
meterRegistry- The meter registry- Returns:
- The builder
-
builder
Return a new builder- Returns:
- The builder
-
build
Build the registry- Returns:
- The registry
-