Package land.oras
Class ContainerRef
A referer of a container on a
Registry.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanforRegistry(String registry) Return a copy of reference for a registry other registryforRegistry(Registry registry) Return a copy of reference for a registry other registryReturn a container ref for the target repositoryforTarget(OCI<ContainerRef> target) Return a container ref for the target repositoryGet the algorithmGet the API registrygetApiRegistry(@Nullable Registry target) Get the API registrygetBlobsPath(@Nullable Registry registry) Return the blobs URLgetBlobsUploadDigestPath(Registry registry) Return the blobs upload URL with the digest for single POST uploadgetBlobsUploadPath(Registry registry) Return the blobs upload URL for POST upload to get the upload location@Nullable StringGet the digestgetEffectiveRegistry(Registry target) Get the effective registry based on given target This methods will perform HEAD request to determine the first unqualified search registry that contains the container reference if the reference is unqualified, otherwise return the registry of the reference.Get the full repository name including the namespace if anygetFullRepository(@Nullable Registry registry) Get the full repository name including the namespace if anyReturn the manifests URLgetManifestsPath(@Nullable Registry registry) Return the manifests URL@Nullable StringGet the namespace@Nullable StringgetNamespace(@Nullable Registry target) Get the effective namespace based on given registry tragetgetReferrersPath(@Nullable ArtifactType artifactType) Return the referrers URL for this container referrergetReferrersPath(@Nullable Registry registry, @Nullable ArtifactType artifactType) Return the referrers URL for this container referrerCreate a new container referenceReturn the catalog repositories URLgetRepositoriesPath(@Nullable Registry target) Return the catalog repositories URLGet the repositoryReturn the tag URLgetTagsPath(@Nullable Registry target) Return the tag URLgetTarget(OCI<ContainerRef> target) Get the target repository for the refinthashCode()booleanCheck if access to this container reference is blocked by the registry configurationbooleanisInsecure(Registry registry) Check if access to this container reference is insecure by the registry configurationbooleanWhether the container reference is unqualified without registrystatic ContainerRefParse the container name into registry, repository and tag.toString()withDigest(String digest) Return the ref with the digest
-
Field Details
-
LOG
public static final org.slf4j.Logger LOGThe logger for this class.
-
-
Method Details
-
getRegistry
Create a new container reference- Returns:
- The new container reference
-
isUnqualified
public boolean isUnqualified()Whether the container reference is unqualified without registry- Returns:
- True if unqualified
-
getFullRepository
Get the full repository name including the namespace if any- Parameters:
registry- The registry- Returns:
- The full repository name
-
getFullRepository
Get the full repository name including the namespace if any- Returns:
- The full repository name
-
getApiRegistry
Get the API registry- Parameters:
target- The target registry- Returns:
- The API registry
-
getApiRegistry
Get the API registry- Returns:
- The API registry
-
getNamespace
Get the namespace- Returns:
- The namespace
-
getNamespace
Get the effective namespace based on given registry traget- Parameters:
target- The target registry- Returns:
- The effective namespace
-
getRepository
Get the repository- Specified by:
getRepositoryin classRef<ContainerRef>- Returns:
- The repository
-
getDigest
Get the digest- Returns:
- The digest
-
withDigest
Description copied from class:RefReturn the ref with the digest- Specified by:
withDigestin classRef<ContainerRef>- Parameters:
digest- The digest- Returns:
- The ref
-
getAlgorithm
Description copied from class:RefGet the algorithm- Specified by:
getAlgorithmin classRef<ContainerRef>- Returns:
- The algorithm
-
getRepositoriesPath
Return the catalog repositories URL- Parameters:
target- The target registry- Returns:
- The tag URL
-
getRepositoriesPath
Return the catalog repositories URL- Returns:
- The tag URL
-
getTagsPath
Return the tag URL- Parameters:
target- The target registry- Returns:
- The tag URL
-
getTagsPath
Return the tag URL- Returns:
- The tag URL
-
getReferrersPath
Return the referrers URL for this container referrer- Parameters:
artifactType- The optional artifact typeregistry- The optional registry- Returns:
- The referrers URL
-
getReferrersPath
Return the referrers URL for this container referrer- Parameters:
artifactType- The optional artifact type- Returns:
- The referrers URL
-
getManifestsPath
Return the manifests URL- Parameters:
registry- The registry- Returns:
- The manifests URL
-
getManifestsPath
Return the manifests URL- Returns:
- The manifests URL
-
getBlobsUploadDigestPath
Return the blobs upload URL with the digest for single POST upload- Parameters:
registry- The registry- Returns:
- The blobs upload URL
-
getBlobsUploadPath
Return the blobs upload URL for POST upload to get the upload location- Parameters:
registry- The registry- Returns:
- The blobs upload URL
-
getBlobsPath
Return the blobs URL- Parameters:
registry- The registry- Returns:
- The blobs URL
-
parse
Parse the container name into registry, repository and tag.- Parameters:
name- The full name of the container to parse with any components.- Returns:
- The container object with the registry, repository and tag.
-
getEffectiveRegistry
Get the effective registry based on given target This methods will perform HEAD request to determine the first unqualified search registry that contains the container reference if the reference is unqualified, otherwise return the registry of the reference. This only works with Manifests and Index but now direct blob access. SeeforRegistry(String)so set correct registry when getting blobs outside high level API likeRegistry.pullArtifact(ContainerRef, Path, boolean).- Parameters:
target- The target registry- Returns:
- The effective registry
-
forRegistry
Return a copy of reference for a registry other registry- Parameters:
registry- The registry- Returns:
- The container reference
-
isInsecure
Check if access to this container reference is insecure by the registry configuration- Parameters:
registry- The registry- Returns:
- True if access to this container reference is insecure, false otherwise
-
isBlocked
Check if access to this container reference is blocked by the registry configuration- Parameters:
registry- The registry- Returns:
- True if access to this container reference is blocked, false otherwise
-
forTarget
Description copied from class:RefReturn a container ref for the target repository- Specified by:
forTargetin classRef<ContainerRef>- Parameters:
target- The target repository- Returns:
- The container ref
-
forTarget
Description copied from class:RefReturn a container ref for the target repository- Specified by:
forTargetin classRef<ContainerRef>- Parameters:
target- The target repository- Returns:
- The container ref
-
getTarget
Description copied from class:RefGet the target repository for the ref- Specified by:
getTargetin classRef<ContainerRef>- Parameters:
target- The target repository- Returns:
- The target repository
-
forRegistry
Return a copy of reference for a registry other registry- Parameters:
registry- The registry- Returns:
- The container reference
-
equals
-
hashCode
public int hashCode() -
toString
-