001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*-
002 *
003 * Copyright © 2017 MicroBean.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
014 * implied.  See the License for the specific language governing
015 * permissions and limitations under the License.
016 */
017package org.microbean.helm.chart.resolver;
018
019import java.io.IOException;
020
021import java.net.URISyntaxException;
022
023import hapi.chart.ChartOuterClass.Chart;
024
025import org.microbean.development.annotation.Experimental;
026
027/**
028 * A resolver of <a href="https://docs.helm.sh/developing_charts/#charts">Helm charts</a>.
029 *
030 * @author <a href="https://about.me/lairdnelson"
031 * target="_parent">Laird Nelson</a>
032 */
033@Experimental
034public abstract class AbstractChartResolver {
035
036
037  /*
038   * Constructors.
039   */
040
041
042  /**
043   * Creates a new {@link AbstractChartResolver}.
044   */
045  protected AbstractChartResolver() {
046    super();
047  }
048
049
050  /*
051   * Instance methods.
052   */
053  
054
055  /**
056   * Uses the supplied {@code chartName} and {@code chartVersion}
057   * parameters to find an appropriate <a
058   * href="https://docs.helm.sh/developing_charts/#charts">Helm
059   * chart</a> and returns it in the form of a {@link Chart.Builder}
060   * object.
061   *
062   * <p>Implementations of this method may return {@code null}.</p>
063   *
064   * @param chartName the name of the chart to resolve; must not be
065   * {@code null}
066   *
067   * @param chartVersion the version of the chart to resolve; may be
068   * {@code null} which normally implies "latest" semantics
069   *
070   * @return the {@link Chart.Builder} representing a suitable Helm
071   * chart, or {@code null} if no such chart could be found
072   *
073   * @exception ChartResolverException if there was a problem with
074   * resolution
075   *
076   * @exception NullPointerException if {@code chartName} is {@code null}
077   *
078   * @exception IllegalArgumentException if either parameter value is
079   * incorrect in some way
080   */
081  public abstract Chart.Builder resolve(final String chartName, final String chartVersion) throws ChartResolverException;
082  
083}