class AptComponentDirector extends ComponentSupport implements ComponentDirector {

  @Override
  public void afterMove(final List<Map<String, String>> components, final Repository destination) {
    destination.facet(StorageFacet.class).txSupplier();
    UnitOfWork.begin(destination.facet(StorageFacet.class).txSupplier());
    try {
      AptHostedFacet hostedFacet = destination.facet(AptHostedFacet.class);
      hostedFacet.rebuildIndexes();
    }
    catch (IOException e) {
      log.error("Failed to update metadata, repository: {}", destination.getName(), e);
      throw new UncheckedIOException(e);
    }
    finally {
      UnitOfWork.end();
    }
  }

  @Inject public  AptComponentDirector(final BucketStore bucketStore,
                              final RepositoryManager repositoryManager);

}