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
-
-
-
Method Detail
-
getSubjects
public List<String> getSubjects()
- Specified by:
getSubjects
in interfaceRegistryStorageFacade
-
getSubjectVersions
public List<SubjectVersion> getSubjectVersions(int contentId)
- Specified by:
getSubjectVersions
in interfaceRegistryStorageFacade
-
deleteSubject
public List<Integer> deleteSubject(String subject) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
deleteSubject
in interfaceRegistryStorageFacade
- Returns:
- List of schema versions in the deleted subject
- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getSchemaContent
public SchemaContent getSchemaContent(int globalId) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
getSchemaContent
in interfaceRegistryStorageFacade
- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getSchema
public Schema getSchema(String subject, String versionString) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
- Specified by:
getSchema
in interfaceRegistryStorageFacade
- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
getVersions
public List<Integer> getVersions(String subject) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
getVersions
in interfaceRegistryStorageFacade
- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getSchema
public Schema getSchema(String subject, SchemaContent schema) throws ArtifactNotFoundException, RegistryStorageException
- Specified by:
getSchema
in interfaceRegistryStorageFacade
- Throws:
ArtifactNotFoundException
RegistryStorageException
-
createSchema
public CompletionStage<Long> createSchema(String subject, String schema, String schemaType) throws ArtifactAlreadyExistsException, ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageFacade
Create a new schema in the given subject.- Specified by:
createSchema
in interfaceRegistryStorageFacade
- Returns:
- globalId as a future
- Throws:
ArtifactAlreadyExistsException
ArtifactNotFoundException
RegistryStorageException
-
deleteSchema
public int deleteSchema(String subject, String versionString) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
- Specified by:
deleteSchema
in interfaceRegistryStorageFacade
- Returns:
- schema version
- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
createOrUpdateArtifactRule
public void createOrUpdateArtifactRule(String subject, RuleType type, RuleConfigurationDto dto)
- Specified by:
createOrUpdateArtifactRule
in interfaceRegistryStorageFacade
-
createOrUpdateGlobalRule
public void createOrUpdateGlobalRule(RuleType type, RuleConfigurationDto dto)
- Specified by:
createOrUpdateGlobalRule
in interfaceRegistryStorageFacade
-
testCompatibilityBySubjectName
public CompatibilityCheckResponse testCompatibilityBySubjectName(String subject, String version, SchemaContent request)
- Specified by:
testCompatibilityBySubjectName
in 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:
parseVersionString
in interfaceRegistryStorageFacade
-
getGlobalRule
public RuleConfigurationDto getGlobalRule(RuleType ruleType)
- Specified by:
getGlobalRule
in interfaceRegistryStorageFacade
-
deleteGlobalRule
public void deleteGlobalRule(RuleType ruleType)
- Specified by:
deleteGlobalRule
in interfaceRegistryStorageFacade
-
deleteArtifactRule
public void deleteArtifactRule(String subject, RuleType ruleType)
- Specified by:
deleteArtifactRule
in interfaceRegistryStorageFacade
-
getArtifactRule
public RuleConfigurationDto getArtifactRule(String subject, RuleType ruleType)
- Specified by:
getArtifactRule
in interfaceRegistryStorageFacade
-
-