class RepositoryConnectController implements IConnectedRepositoryInstance {

  public RepositoryMeta createRepository( String id, Map<String, Object> items ) {
    RepositoriesMeta repositoriesMeta = getRepositoriesMeta();

    RepositoryMeta repositoryMeta;
    try {
      repositoryMeta = pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class );
      repositoryMeta.populate( items, repositoriesMeta );

      if ( repositoryMeta.getName() != null ) {
        Repository repository =
          pluginRegistry.loadClass( RepositoryPluginType.class, repositoryMeta.getId(), Repository.class );
        repository.init( repositoryMeta );
        repositoriesMeta.addRepository( repositoryMeta );
        repositoriesMeta.writeData();
        setCurrentRepository( repositoryMeta );
        if ( !testRepository( repository ) ) {
          return null;
        }
        ( (AbstractRepository) repository ).create();
      }
    } catch ( KettleException ke ) {
      log.logError( "Unable to load repository type", ke );
      return null;
    }
    return repositoryMeta;
  }

  public  RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier );
  public  RepositoryConnectController();

}