类 ChartRepositoryRepository
- java.lang.Object
-
- org.microbean.helm.chart.resolver.AbstractChartResolver
-
- org.microbean.helm.chart.repository.ChartRepositoryRepository
-
@Experimental public class ChartRepositoryRepository extends AbstractChartResolver
A repository ofChartRepositoryinstances, normally built from a Helmrepositories.yamlfile.- 作者:
- Laird Nelson
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceChartRepositoryRepository.ChartRepositoryFactoryA factory forChartRepositoryinstances.
-
构造器概要
构造器 构造器 说明 ChartRepositoryRepository(Set<? extends ChartRepository> chartRepositories)Creates a newChartRepositoryRepository.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static ChartRepositoryRepositoryfromHelmRepositoriesYaml()Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile typically located in the~/.helm/repositorydirectory.static ChartRepositoryRepositoryfromHelmRepositoriesYaml(boolean reifyHelmHomeIfNecessary)Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile typically located in the~/.helm/repositorydirectory.static ChartRepositoryRepositoryfromYaml(InputStream stream)Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.static ChartRepositoryRepositoryfromYaml(InputStream stream, boolean reifyHelmHomeIfNecessary)Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.static ChartRepositoryRepositoryfromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory)Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.static ChartRepositoryRepositoryfromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory, boolean reifyHelmHomeIfNecessary)Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.static ChartRepositoryRepositoryfromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory, boolean reifyHelmHomeIfNecessary, ChartRepositoryRepository.ChartRepositoryFactory factory)Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.static ChartRepositoryRepositoryfromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory, ChartRepositoryRepository.ChartRepositoryFactory factory)Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.Set<ChartRepository>getChartRepositories()Returns the non-nullimmutableSetofChartRepositoryinstances managed by thisChartRepositoryRepository.ChartRepositorygetChartRepository(String name)Returns theChartRepositorymanaged by thisChartRepositoryRepositorywith the suppliedname, ornullif there is no suchChartRepository.ChartOuterClass.Chart.Builderresolve(String chartName, String chartVersion)Uses the suppliedchartNameandchartVersionparameters to find an appropriate Helm chart and returns it in the form of aChartOuterClass.Chart.Builderobject.ChartOuterClass.Chart.Builderresolve(String repositoryName, String chartName, String chartVersion)Uses the suppliedrepositoryName,chartNameandchartVersionparameters to find an appropriate Helm chart and returns it in the form of aChartOuterClass.Chart.Builderobject.
-
-
-
构造器详细资料
-
ChartRepositoryRepository
public ChartRepositoryRepository(Set<? extends ChartRepository> chartRepositories)
Creates a newChartRepositoryRepository.- 参数:
chartRepositories- theSetofChartRepositoryinstances to be managed by thisChartRepositoryRepository; may benull; copied by value- 另请参阅:
getChartRepositories()
-
-
方法详细资料
-
getChartRepositories
public final Set<ChartRepository> getChartRepositories()
Returns the non-nullimmutableSetofChartRepositoryinstances managed by thisChartRepositoryRepository.- 返回:
- the non-
nullimmutableSetofChartRepositoryinstances managed by thisChartRepositoryRepository
-
getChartRepository
public ChartRepository getChartRepository(String name)
Returns theChartRepositorymanaged by thisChartRepositoryRepositorywith the suppliedname, ornullif there is no suchChartRepository.- 参数:
name- the name of theChartRepositoryto return; must not benull- 返回:
- the
ChartRepositorymanaged by thisChartRepositoryRepositorywith the suppliedname, ornull - 抛出:
NullPointerException- ifnameisnull
-
resolve
public ChartOuterClass.Chart.Builder resolve(String chartName, String chartVersion) throws ChartResolverException
Uses the suppliedchartNameandchartVersionparameters to find an appropriate Helm chart and returns it in the form of aChartOuterClass.Chart.Builderobject.Implementations of this method may return
null.This implementation splits the supplied slash-delimited
chartNameinto a chart repository name and a chart name, uses the chart repository name to locate a suitableChartRepository, and then callsChartRepository.resolve(String, String)with the chart name and the suppliedchartVersion, and returns the result.- 指定者:
resolve在类中AbstractChartResolver- 参数:
chartName- a slash-separatedStringwhose first component is a chart repository name and whose second component is a Helm chart name; must not benullchartVersion- the version of the chart to resolve; may benullin which case "latest" semantics are implied- 返回:
- a
ChartOuterClass.Chart.Builder, ornull - 抛出:
ChartResolverException- if there was a problem with resolution- 另请参阅:
resolve(String, String, String)
-
resolve
public ChartOuterClass.Chart.Builder resolve(String repositoryName, String chartName, String chartVersion) throws ChartResolverException
Uses the suppliedrepositoryName,chartNameandchartVersionparameters to find an appropriate Helm chart and returns it in the form of aChartOuterClass.Chart.Builderobject.This implementation uses the supplied
repositoryNameto locate a suitableChartRepository, and then callsChartRepository.resolve(String, String)with the chart name and the suppliedchartVersion, and returns the result.- 参数:
repositoryName- a chart repository name; must not benullchartName- a Helm chart name; must not benullchartVersion- the version of the Helm chart to select; may benullin which case "latest" semantics are implied- 返回:
- a
ChartOuterClass.Chart.Builder, ornull - 抛出:
ChartResolverException- if there was a problem with resolutionNullPointerException- ifrepositoryNameorchartNameisnull- 另请参阅:
getChartRepository(String),ChartRepository.getName(),ChartRepository.resolve(String, String)
-
fromHelmRepositoriesYaml
public static final ChartRepositoryRepository fromHelmRepositoriesYaml() throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile typically located in the~/.helm/repositorydirectory.This method never returns
null.- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the fileURISyntaxException- if there was an invalid URI in the file- 另请参阅:
fromHelmRepositoriesYaml(boolean)
-
fromHelmRepositoriesYaml
public static final ChartRepositoryRepository fromHelmRepositoriesYaml(boolean reifyHelmHomeIfNecessary) throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile typically located in the~/.helm/repositorydirectory.This method never returns
null.- 参数:
reifyHelmHomeIfNecessary- iftrueand, for whatever reason, the local Helm home directory structure needs to be partially or entirely created, then this method will attempt to reify it- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the file or reifying the local Helm home directory structureURISyntaxException- if there was an invalid URI in the file- 另请参阅:
fromYaml(InputStream, Path, Path, boolean, ChartRepositoryFactory)
-
fromYaml
public static final ChartRepositoryRepository fromYaml(InputStream stream) throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.- 参数:
stream- theInputStreamto read from; must not benull- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the fileURISyntaxException- if there was an invalid URI in the file- 另请参阅:
fromYaml(InputStream, Path, Path, boolean, ChartRepositoryFactory)
-
fromYaml
public static final ChartRepositoryRepository fromYaml(InputStream stream, boolean reifyHelmHomeIfNecessary) throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.- 参数:
stream- theInputStreamto read from; must not benullreifyHelmHomeIfNecessary- iftrueand, for whatever reason, the local Helm home directory structure needs to be partially or entirely created, then this method will attempt to reify it- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the file or reifying the local Helm home directory structureURISyntaxException- if there was an invalid URI in the file- 另请参阅:
fromYaml(InputStream, Path, Path, boolean, ChartRepositoryFactory)
-
fromYaml
public static final ChartRepositoryRepository fromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory) throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.- 参数:
stream- theInputStreamto read from; must not benullarchiveCacheDirectory- an absolutePathrepresenting a directory where Helm chart archives may be stored; ifnullthen aPathbeginning with the absolute directory represented by the value of thehelm.homesystem property, or the value of theHELM_HOMEenvironment variable, appended withcache/archivewill be used insteadindexCacheDirectory- an absolutePathrepresenting a directory that the suppliedcachedIndexPathparameter value will be considered to be relative to; will be ignored and hence may benullif the suppliedcachedIndexPathparameter value Path.isAbsolute()- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the fileURISyntaxException- if there was an invalid URI in the file- 另请参阅:
fromYaml(InputStream, Path, Path, boolean, ChartRepositoryFactory)
-
fromYaml
public static final ChartRepositoryRepository fromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory, boolean reifyHelmHomeIfNecessary) throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.- 参数:
stream- theInputStreamto read from; must not benullarchiveCacheDirectory- an absolutePathrepresenting a directory where Helm chart archives may be stored; ifnullthen aPathbeginning with the absolute directory represented by the value of thehelm.homesystem property, or the value of theHELM_HOMEenvironment variable, appended withcache/archivewill be used insteadindexCacheDirectory- an absolutePathrepresenting a directory that the suppliedcachedIndexPathparameter value will be considered to be relative to; will be ignored and hence may benullif the suppliedcachedIndexPathparameter value Path.isAbsolute()reifyHelmHomeIfNecessary- iftrueand, for whatever reason, the local Helm home directory structure needs to be partially or entirely created, then this method will attempt to reify it- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the file or reifying the local Helm home directory structureURISyntaxException- if there was an invalid URI in the file- 另请参阅:
fromYaml(InputStream, Path, Path, boolean, ChartRepositoryFactory)
-
fromYaml
public static final ChartRepositoryRepository fromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory, ChartRepositoryRepository.ChartRepositoryFactory factory) throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.- 参数:
stream- theInputStreamto read from; must not benullarchiveCacheDirectory- an absolutePathrepresenting a directory where Helm chart archives may be stored; ifnullthen aPathbeginning with the absolute directory represented by the value of thehelm.homesystem property, or the value of theHELM_HOMEenvironment variable, appended withcache/archivewill be used insteadindexCacheDirectory- an absolutePathrepresenting a directory that the suppliedcachedIndexPathparameter value will be considered to be relative to; will be ignored and hence may benullif the suppliedcachedIndexPathparameter value Path.isAbsolute()factory- aChartRepositoryRepository.ChartRepositoryFactorythat can createChartRepositoryinstances; may benullin which case theChartRepository(String, URI, Path, Path, Path)constructor will be used instead- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the fileURISyntaxException- if there was an invalid URI in the file- 另请参阅:
fromYaml(InputStream, Path, Path, boolean, ChartRepositoryFactory)
-
fromYaml
public static final ChartRepositoryRepository fromYaml(InputStream stream, Path archiveCacheDirectory, Path indexCacheDirectory, boolean reifyHelmHomeIfNecessary, ChartRepositoryRepository.ChartRepositoryFactory factory) throws IOException, URISyntaxException
Creates and returns a newChartRepositoryRepositoryfrom the contents of arepositories.yamlfile represented by the suppliedInputStream.- 参数:
stream- theInputStreamto read from; must not benullarchiveCacheDirectory- an absolutePathrepresenting a directory where Helm chart archives may be stored; ifnullthen aPathbeginning with the absolute directory represented by the value of thehelm.homesystem property, or the value of theHELM_HOMEenvironment variable, appended withcache/archivewill be used insteadindexCacheDirectory- an absolutePathrepresenting a directory that the suppliedcachedIndexPathparameter value will be considered to be relative to; will be ignored and hence may benullif the suppliedcachedIndexPathparameter value Path.isAbsolute()reifyHelmHomeIfNecessary- iftrueand, for whatever reason, the local Helm home directory structure needs to be partially or entirely created, then this method will attempt to reify itfactory- aChartRepositoryRepository.ChartRepositoryFactorythat can createChartRepositoryinstances; may benullin which case theChartRepository(String, URI, Path, Path, Path)constructor will be used instead- 返回:
- a new
ChartRepositoryRepository; nevernull - 抛出:
IOException- if there was a problem reading the file or reifying the local Helm home directory structureURISyntaxException- if there was an invalid URI in the file
-
-