private IArtifactKey searchArtifact(String searchedId, Version searchedVersion, String classifier, IArtifactRepository repo) { //This is somewhat cheating since normally we should get the artifact key from the IUs that were representing the running system (e.g. we could get that info from the rollback repo) VersionRange range = searchedVersion != null ? new VersionRange(searchedVersion, true, searchedVersion, true) : null; ArtifactKeyQuery query = new ArtifactKeyQuery(classifier, searchedId, range); //TODO short-circuit the query when we find one? IQueryResult<IArtifactKey> keys = repo.query(query, null); if (!keys.isEmpty()) return keys.iterator().next(); return null; }
private IArtifactKey searchArtifact(String searchedId, Version searchedVersion, String classifier, IArtifactRepository repo) { //This is somewhat cheating since normally we should get the artifact key from the IUs that were representing the running system (e.g. we could get that info from the rollback repo) VersionRange range = searchedVersion != null ? new VersionRange(searchedVersion, true, searchedVersion, true) : null; ArtifactKeyQuery query = new ArtifactKeyQuery(classifier, searchedId, range); //TODO short-circuit the query when we find one? IQueryResult<IArtifactKey> keys = repo.query(query, null); if (!keys.isEmpty()) return keys.iterator().next(); return null; }