/** * Creates an artifact key query that will match any key equal to the * provided key * @param key the input key to test for equality in the query */ public ArtifactKeyQuery(IArtifactKey key) { super(IArtifactKey.class, createMatchExpression(key)); } }
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; }
/** * Creates an artifact key query that will match any key equal to the * provided key * @param key the input key to test for equality in the query */ public ArtifactKeyQuery(IArtifactKey key) { super(IArtifactKey.class, createMatchExpression(key)); } }
/** * Pass the id and/or version range to match IArtifactKeys against. * Passing null results in matching any id/version * @param classifier The artifact key classifier, or <code>null</code> * @param id The artifact key id, or <code>null</code> * @param range A version range, or <code>null</code> */ public ArtifactKeyQuery(String classifier, String id, VersionRange range) { super(IArtifactKey.class, createMatchExpression(classifier, id, range)); }
/** * Pass the id and/or version range to match IArtifactKeys against. * Passing null results in matching any id/version * @param classifier The artifact key classifier, or <code>null</code> * @param id The artifact key id, or <code>null</code> * @param range A version range, or <code>null</code> */ public ArtifactKeyQuery(String classifier, String id, VersionRange range) { super(IArtifactKey.class, createMatchExpression(classifier, id, range)); }