Class RegistryStorageFacadeImpl
- java.lang.Object
-
- io.apicurio.registry.ccompat.store.RegistryStorageFacadeImpl
-
- All Implemented Interfaces:
RegistryStorageFacade
@ApplicationScoped public class RegistryStorageFacadeImpl extends Object implements RegistryStorageFacade
- Author:
- Ales Justin, Jakub Senko 'jsenko@redhat.com'
-
-
Constructor Summary
Constructors Constructor Description RegistryStorageFacadeImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateOrUpdateArtifactRule(String subject, RuleType type, RuleConfigurationDto dto)voidcreateOrUpdateGlobalRule(RuleType type, RuleConfigurationDto dto)LongcreateSchema(String subject, String schema, String schemaType)Create a new schema in the given subject.voiddeleteArtifactRule(String subject, RuleType ruleType)voiddeleteGlobalRule(RuleType ruleType)intdeleteSchema(String subject, String versionString)List<Integer>deleteSubject(String subject)RuleConfigurationDtogetArtifactRule(String subject, RuleType ruleType)RuleConfigurationDtogetGlobalRule(RuleType ruleType)SchemagetSchema(String subject, SchemaContent schema)SchemagetSchema(String subject, String versionString)SchemaInfogetSchemaById(int contentId)List<String>getSubjects()List<SubjectVersion>getSubjectVersions(int contentId)List<Integer>getVersions(String subject)<T> TparseVersionString(String subject, String versionString, Function<String,T> then)Given a version string: - if it's an integer, use that; - if it's a string "latest", find out and use the subject's (artifact's) latest version; - otherwise throw an IllegalArgumentException.CompatibilityCheckResponsetestCompatibilityBySubjectName(String subject, String version, SchemaContent request)
-
-
-
Method Detail
-
getSubjects
public List<String> getSubjects()
- Specified by:
getSubjectsin interfaceRegistryStorageFacade
-
getSubjectVersions
public List<SubjectVersion> getSubjectVersions(int contentId)
- Specified by:
getSubjectVersionsin interfaceRegistryStorageFacade
-
deleteSubject
public List<Integer> deleteSubject(String subject) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
deleteSubjectin interfaceRegistryStorageFacade- Returns:
- List of schema versions in the deleted subject
- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getSchemaById
public SchemaInfo getSchemaById(int contentId) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
getSchemaByIdin interfaceRegistryStorageFacade- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getSchema
public Schema getSchema(String subject, String versionString) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
- Specified by:
getSchemain interfaceRegistryStorageFacade- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
getVersions
public List<Integer> getVersions(String subject) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
getVersionsin interfaceRegistryStorageFacade- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getSchema
public Schema getSchema(String subject, SchemaContent schema) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
getSchemain interfaceRegistryStorageFacade- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
createSchema
public Long createSchema(String subject, String schema, String schemaType) throws ArtifactAlreadyExistsException, ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageFacadeCreate a new schema in the given subject.- Specified by:
createSchemain interfaceRegistryStorageFacade- Returns:
- contentId
- Throws:
ArtifactAlreadyExistsExceptionArtifactNotFoundExceptionRegistryStorageException
-
deleteSchema
public int deleteSchema(String subject, String versionString) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
- Specified by:
deleteSchemain interfaceRegistryStorageFacade- Returns:
- schema version
- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
createOrUpdateArtifactRule
public void createOrUpdateArtifactRule(String subject, RuleType type, RuleConfigurationDto dto)
- Specified by:
createOrUpdateArtifactRulein interfaceRegistryStorageFacade
-
createOrUpdateGlobalRule
public void createOrUpdateGlobalRule(RuleType type, RuleConfigurationDto dto)
- Specified by:
createOrUpdateGlobalRulein interfaceRegistryStorageFacade
-
testCompatibilityBySubjectName
public CompatibilityCheckResponse testCompatibilityBySubjectName(String subject, String version, SchemaContent request)
- Specified by:
testCompatibilityBySubjectNamein interfaceRegistryStorageFacade
-
parseVersionString
public <T> T parseVersionString(String subject, String versionString, Function<String,T> then)
Given a version string: - if it's an integer, use that; - if it's a string "latest", find out and use the subject's (artifact's) latest version; - otherwise throw an IllegalArgumentException. On success, call the "then" function with the parsed version (MUST NOT be null) and return it's result. Optionally provide an "else" function that will receive the exception that would be otherwise thrown.- Specified by:
parseVersionStringin interfaceRegistryStorageFacade
-
getGlobalRule
public RuleConfigurationDto getGlobalRule(RuleType ruleType)
- Specified by:
getGlobalRulein interfaceRegistryStorageFacade
-
deleteGlobalRule
public void deleteGlobalRule(RuleType ruleType)
- Specified by:
deleteGlobalRulein interfaceRegistryStorageFacade
-
deleteArtifactRule
public void deleteArtifactRule(String subject, RuleType ruleType)
- Specified by:
deleteArtifactRulein interfaceRegistryStorageFacade
-
getArtifactRule
public RuleConfigurationDto getArtifactRule(String subject, RuleType ruleType)
- Specified by:
getArtifactRulein interfaceRegistryStorageFacade
-
-