class CreateIndexServiceImpl extends ComponentSupport implements CreateIndexService {

  @TransactionalStoreBlob
  @Nullable
  public TempBlob buildIndexYaml(final Repository repository) {
    StorageFacet storageFacet = repository.facet(StorageFacet.class);
    HelmFacet helmFacet = repository.facet(HelmFacet.class);
    StorageTx tx = UnitOfWork.currentTx();

    ChartIndex index = new ChartIndex();

    for (Asset asset : helmFacet.browseComponentAssets(tx, AssetKind.HELM_PACKAGE)) {
      parseAssetIntoChartEntry(index, asset);
    }

    index.setApiVersion(API_VERSION);
    index.setGenerated(new DateTime());
    return indexYamlBuilder.build(index, storageFacet);
  }

  @Inject public  CreateIndexServiceImpl(final IndexYamlBuilder indexYamlBuilder);

}