forked from Apicurio/apicurio-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: skip disabled artifact versions when looking for latest (Apicur…
…io#2862) * feat: skip disabled artifact versions when looking for latest version * docs: regenerate configuration list * chore: update my @author tag to avoid javadoc warnings
- Loading branch information
Showing
139 changed files
with
1,118 additions
and
831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
* Immutable. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@JsonAutoDetect(isGetterVisibility = NONE) | ||
@NoArgsConstructor // required for Jackson | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
* Immutable. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@JsonAutoDetect(isGetterVisibility = NONE) | ||
@NoArgsConstructor // required for Jackson | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@JsonAutoDetect(isGetterVisibility = NONE) | ||
@NoArgsConstructor // required for Jackson | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; | ||
|
||
/** | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
* @author Carles Arnal '[email protected]' | ||
*/ | ||
@JsonAutoDetect(isGetterVisibility = NONE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; | ||
|
||
/** | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@JsonAutoDetect(isGetterVisibility = NONE) | ||
@AllArgsConstructor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; | ||
|
||
/** | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@JsonAutoDetect(isGetterVisibility = NONE) | ||
@NoArgsConstructor // required for Jackson | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
public final class ContentTypes { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
public class Errors { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
* The compatibility resource allows the user to test schemas for compatibility against specific versions of a subject’s schema. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Path("/apis/ccompat/v6/compatibility") | ||
@Consumes({JSON, OCTET_STREAM, COMPAT_SCHEMA_REGISTRY_V1, COMPAT_SCHEMA_REGISTRY_STABLE_LATEST}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
* The config resource allows you to inspect the cluster-level configuration values as well as subject overrides. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Path("/apis/ccompat/v6/config") | ||
@Consumes({JSON, OCTET_STREAM, COMPAT_SCHEMA_REGISTRY_V1, COMPAT_SCHEMA_REGISTRY_STABLE_LATEST}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ | |
* We <b>DO NOT</b> support this endpoint. Fails with 404. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Path("/apis/ccompat/v6/mode") | ||
@Consumes({JSON, OCTET_STREAM, COMPAT_SCHEMA_REGISTRY_V1, COMPAT_SCHEMA_REGISTRY_STABLE_LATEST}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
* This <a href="https://docs.confluent.io/5.5.0/schema-registry/develop/api.html#schemas">API specification</a> is owned by Confluent. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Path("/apis/ccompat/v6/schemas") | ||
@Consumes({JSON, OCTET_STREAM, COMPAT_SCHEMA_REGISTRY_V1, COMPAT_SCHEMA_REGISTRY_STABLE_LATEST}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
* | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Path("/apis/ccompat/v6/subjects/{subject}/versions") | ||
@Consumes({JSON, OCTET_STREAM, COMPAT_SCHEMA_REGISTRY_V1, COMPAT_SCHEMA_REGISTRY_STABLE_LATEST}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
* This <a href="https://docs.confluent.io/5.5.0/schema-registry/develop/api.html#subjects">API specification</a> is owned by Confluent. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Path("/apis/ccompat/v6/subjects") | ||
@Consumes({JSON, OCTET_STREAM, COMPAT_SCHEMA_REGISTRY_V1, COMPAT_SCHEMA_REGISTRY_STABLE_LATEST}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
public abstract class AbstractResource { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
|
||
@ApplicationScoped | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class}) | ||
@Logged | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* We <b>DO NOT</b> support this endpoint. Fails with 404. | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class}) | ||
@Logged | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class}) | ||
@Logged | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class}) | ||
@Logged | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class}) | ||
@Logged | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ | |
* | ||
* | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
public interface RegistryStorageFacade { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,9 +66,11 @@ | |
import javax.enterprise.context.ApplicationScoped; | ||
import javax.inject.Inject; | ||
|
||
import static io.apicurio.registry.storage.RegistryStorage.ArtifactRetrievalBehavior.DEFAULT; | ||
|
||
/** | ||
* @author Ales Justin | ||
* @author Jakub Senko '[email protected]' | ||
* @author Jakub Senko <em>[email protected]</em> | ||
* @author Carles Arnal | ||
*/ | ||
@ApplicationScoped | ||
|
@@ -170,9 +172,6 @@ public Schema getSchema(String subject, String versionString) throws ArtifactNot | |
return parseVersionString(subject, versionString, | ||
version -> { | ||
ArtifactVersionMetaDataDto artifactVersionMetaDataDto = storage.getArtifactVersionMetaData(null, subject, version); | ||
if (ArtifactState.DISABLED.equals(artifactVersionMetaDataDto.getState())) { | ||
throw new VersionNotFoundException(null, subject, version); | ||
} | ||
StoredArtifactDto storedArtifact = storage.getArtifactVersion(null, subject, version); | ||
return converter.convert(subject, storedArtifact, artifactVersionMetaDataDto.getType()); | ||
}); | ||
|
@@ -398,8 +397,12 @@ public <T> T parseVersionString(String subject, String versionString, Function<S | |
} | ||
|
||
private String getLatestArtifactVersionForSubject(String subject) { | ||
ArtifactMetaDataDto latest = storage.getArtifactMetaData(null, subject); | ||
return latest.getVersion(); | ||
try { | ||
ArtifactMetaDataDto latest = storage.getArtifactMetaData(null, subject); | ||
return latest.getVersion(); | ||
} catch (ArtifactNotFoundException ex) { | ||
throw new VersionNotFoundException(null, subject, "latest"); | ||
} | ||
} | ||
|
||
@Override | ||
|
@@ -437,10 +440,9 @@ public List<Long> getContentIdsReferencingArtifact(String subject, String versio | |
version -> storage.getContentIdsReferencingArtifact(null, subject, version)); | ||
} | ||
|
||
|
||
private boolean doesArtifactExist(String artifactId) { | ||
try { | ||
storage.getArtifact(null, artifactId); | ||
storage.getArtifact(null, artifactId, DEFAULT); | ||
return true; | ||
} catch (ArtifactNotFoundException ignored) { | ||
return false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
/** | ||
* Periodically cleanup data of tenants marked as deleted. | ||
* | ||
* @author Jakub Senko <[email protected]> | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
@ApplicationScoped | ||
public class DownloadReaper { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/main/java/io/apicurio/registry/faulttolerance/FaultToleranceConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package io.apicurio.registry.faulttolerance; | ||
|
||
/** | ||
* @author Jakub Senko <[email protected]> | ||
* @author Jakub Senko <em>[email protected]</em> | ||
*/ | ||
public interface FaultToleranceConstants { | ||
|
||
|
Oops, something went wrong.