@Override public void open() throws RepositoryConnectionException { if (remoteRepo == null) { remoteRepo = RepositoryResolver.load(remoteRepoLocation); } }
@Override public void open() throws RepositoryConnectionException { if (remoteRepo == null) { remoteRepo = RepositoryResolver.load(remoteRepoLocation); } }
@Override public void open() throws RepositoryConnectionException { if (remoteRepository == null) { remoteRepository = RepositoryResolver.load(remoteRepoURI); } }
@Override public void open() throws RepositoryConnectionException { if (remoteRepository == null) { remoteRepository = RepositoryResolver.load(remoteRepoURI); } }
Repository openRemote() { Repository repository; try { repository = RepositoryResolver.load(remote); } catch (RepositoryConnectionException e) { throw new IllegalStateException("Unable to open pull request issuer repository", e); } return repository; } }
@Override public Repository load(final String repoId) throws Exception { try { RepositoryInfo repoInfo = manager.get(repoId); URI repoLocation = repoInfo.getLocation(); // RepositoryResolver.load returns an open repository or fails Repository repo = RepositoryResolver.load(repoLocation); checkState(repo.isOpen()); return repo; } catch (Exception e) { LOGGER.log( Level.WARNING, format( "Error loading GeoGig repository instance for id %s", repoId), e); throw e; } } };
public void run(Connection cx, PGStorageTableManager tableManager, ProgressListener progress) throws SQLException { List<String> repoNames = PGStorage.listRepos(cx, env.getTables()); progress.setDescription(String.format("Upgrading commit graph for all %,d repositories...", repoNames.size())); Collections.sort(repoNames); int i = 0; for (String repoName : repoNames) { progress.setProgressIndicator( p -> String.format("Upgrading graph for repository %s", repoName)); URI repoURI = env.connectionConfig.toURI(repoName); Repository repo; try { repo = RepositoryResolver.load(repoURI); } catch (RepositoryConnectionException e) { throw new IllegalStateException("Unable to connnect to repo " + repoName, e); } try { progress.setProgress(++i); rebuildGraph(repo); } finally { repo.close(); } } progress.setProgressIndicator(ProgressListener.DEFAULT_PROGRES_INDICATOR); }
@Override public Repository open(URI repositoryLocation) throws RepositoryConnectionException { String name = getName(repositoryLocation); // get a handle to the RepositoryManager RepositoryManager repoMgr = RepositoryManager.get(); // get the repo by name RepositoryInfo info = repoMgr.getByRepoName(name); if (info != null) { // get the native RepositoryResolver for the location and open it directly // Using the RepositryManager to get the repo would cause the repo to be managed by the // RepositoryManager, // when this repo should be managed by the DataStore. The DataStore will close this repo // instance when // GeoServer decides to dispose the DataStore. Repository repo = RepositoryResolver.load(info.getLocation()); checkState( repo.isOpen(), "RepositoryManager returned a closed repository for %s", name); return repo; } else { // didn't find a repo RepositoryConnectionException rce = new RepositoryConnectionException( "No GeoGig repository found with NAME or ID: " + name); throw rce; } }
RepositoryResolver.load(repoUri.get()).command(ResolveRepositoryName.class).call(); RepositoryImportRepo info = new RepositoryImportRepo(); info.setName(repoName);
"Unable to resolve URI of newly created repository."); final String repoName = RepositoryResolver.load(repoUri.get()) .command(ResolveRepositoryName.class).call(); RepositoryInitRepo info = new RepositoryInitRepo();
RepositoryResolver.load(repoUri.get()).command(ResolveRepositoryName.class).call(); RepositoryInitRepo info = new RepositoryInitRepo(); info.setName(repoName);