Package io.apicurio.registry.events
Class EventSourcedRegistryStorage
- java.lang.Object
-
- io.apicurio.registry.events.EventSourcedRegistryStorage
-
- All Implemented Interfaces:
RegistryStorage
public class EventSourcedRegistryStorage extends Object implements RegistryStorage
- Author:
- Fabian Martinez
-
-
Constructor Summary
Constructors Constructor Description EventSourcedRegistryStorage(RegistryStorage actualStorage, EventsService eventsService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<ArtifactMetaDataDto>
createArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content)
Creates a new artifact (from the given value) in the artifactStore.CompletionStage<Void>
createArtifactRuleAsync(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config)
CompletionStage<ArtifactMetaDataDto>
createArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData)
Creates a new artifact (from the given value including metadata) in the artifactStore.void
createGlobalRule(RuleType rule, RuleConfigurationDto config)
Creates a single global rule.void
createGroup(GroupMetaDataDto group)
Creates a new empty group and stores it's metadata.List<String>
deleteArtifact(String groupId, String artifactId)
Deletes an artifact by its group and unique id.void
deleteArtifactRule(String groupId, String artifactId, RuleType rule)
Deletes a single stored/configured rule for a given artifact.void
deleteArtifactRules(String groupId, String artifactId)
Deletes all rules stored/configured for the artifact.void
deleteArtifacts(String groupId)
Deletes all artifacts in the given group.void
deleteArtifactVersion(String groupId, String artifactId, String version)
Deletes a single version of a given artifact.void
deleteArtifactVersionMetaData(String groupId, String artifactId, String version)
Deletes the user-editable meta-data for a singel version of a given artifact.void
deleteGlobalRule(RuleType rule)
Deletes a single global rule.void
deleteGlobalRules()
Deletes all of the globally configured rules.void
deleteGroup(String groupId)
Deletes a group intified by the given groupId and DELETES ALL resources related to this groupvoid
exportData(Function<Entity,Void> handler)
Called to export all data in the registry.StoredArtifactDto
getArtifact(String groupId, String artifactId)
Gets the most recent version of the value of the artifact with the given group and ID.ContentHandle
getArtifactByContentHash(String contentHash)
Gets some artifact content by the SHA-256 hash of that content.ContentHandle
getArtifactByContentId(long contentId)
Gets some artifact content by the unique contentId.Set<String>
getArtifactIds(Integer limit)
Get all artifact ids.ArtifactMetaDataDto
getArtifactMetaData(long id)
Gets the stored meta-data for an artifact by global ID.ArtifactMetaDataDto
getArtifactMetaData(String groupId, String artifactId)
Gets the stored meta-data for an artifact by group and ID.RuleConfigurationDto
getArtifactRule(String groupId, String artifactId, RuleType rule)
Gets all of the information for a single rule configured on a given artifact.List<RuleType>
getArtifactRules(String groupId, String artifactId)
Gets a list of rules configured for a specific Artifact (by group and ID).StoredArtifactDto
getArtifactVersion(long id)
Gets the stored artifact content for the artifact version with the given unique global ID.StoredArtifactDto
getArtifactVersion(String groupId, String artifactId, String version)
Gets the stored value for a single version of a given artifact.ArtifactVersionMetaDataDto
getArtifactVersionMetaData(String groupId, String artifactId, boolean canonical, ContentHandle content)
Gets the metadata of the version that matches content.ArtifactVersionMetaDataDto
getArtifactVersionMetaData(String groupId, String artifactId, String version)
Gets the stored meta-data for a single version of an artifact.List<String>
getArtifactVersions(String groupId, String artifactId)
Gets a sorted set of all artifact versions that exist for a given artifact.List<ArtifactMetaDataDto>
getArtifactVersionsByContentId(long contentId)
Get artifact metadata for a given contentIdRuleConfigurationDto
getGlobalRule(RuleType rule)
Gets all information about a single global rule.List<RuleType>
getGlobalRules()
Gets a list of all global rule names.List<String>
getGroupIds(Integer limit)
Get all groupIdsGroupMetaDataDto
getGroupMetaData(String groupId)
Get the metadata information for a group identified by the given groupIdLogConfigurationDto
getLogConfiguration(String logger)
Returns the log configuration persisted in the storage for the given loggervoid
importData(EntityInputStream entities)
Called to import previously exported data into the registry.boolean
isAlive()
Is the artifactStore alive?boolean
isReady()
Is the artifactStore ready?List<LogConfigurationDto>
listLogConfigurations()
Returns the list of log configuration persisted in the storagevoid
removeLogConfiguration(String logger)
Removes the persisted log configuration for the given loggerArtifactSearchResultsDto
searchArtifacts(Set<SearchFilter> filters, OrderBy orderBy, OrderDirection orderDirection, int offset, int limit)
Search artifacts by given criteriaVersionSearchResultsDto
searchVersions(String groupId, String artifactId, int offset, int limit)
Fetch the versions of the given artifactvoid
setLogConfiguration(LogConfigurationDto logConfiguration)
Persists the given log configurationString
storageName()
The storage nameboolean
supportsMultiTenancy()
Returns true if the storage implementation supports multitenancy.CompletionStage<ArtifactMetaDataDto>
updateArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content)
Updates the artifact value by storing the given value as a new version of the artifact.void
updateArtifactMetaData(String groupId, String artifactId, EditableArtifactMetaDataDto metaData)
Updates the stored meta-data for an artifact by group and ID.void
updateArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config)
Updates the configuration information for a single rule on a given artifact.void
updateArtifactState(String groupId, String artifactId, ArtifactState state)
Update artifact state.void
updateArtifactState(String groupId, String artifactId, String version, ArtifactState state)
Update artifact state.void
updateArtifactVersionMetaData(String groupId, String artifactId, String version, EditableArtifactMetaDataDto metaData)
Updates the user-editable meta-data for a single version of a given artifact.CompletionStage<ArtifactMetaDataDto>
updateArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData)
Updates the artifact value by storing the given value and metadata as a new version of the artifact.void
updateGlobalRule(RuleType rule, RuleConfigurationDto config)
Updates the configuration settings for a single global rule.void
updateGroupMetaData(GroupMetaDataDto group)
Updates the metadata of an existent group.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.apicurio.registry.storage.RegistryStorage
createArtifactRule
-
-
-
-
Constructor Detail
-
EventSourcedRegistryStorage
public EventSourcedRegistryStorage(RegistryStorage actualStorage, EventsService eventsService)
-
-
Method Detail
-
storageName
public String storageName()
Description copied from interface:RegistryStorage
The storage name- Specified by:
storageName
in interfaceRegistryStorage
- See Also:
RegistryStorage.storageName()
-
supportsMultiTenancy
public boolean supportsMultiTenancy()
Description copied from interface:RegistryStorage
Returns true if the storage implementation supports multitenancy. If the storage supports multitenancy, it will get the tenant information from theTenantContext
- Specified by:
supportsMultiTenancy
in interfaceRegistryStorage
- Returns:
- if multitenancy is supported
- See Also:
RegistryStorage.supportsMultiTenancy()
-
isReady
public boolean isReady()
Description copied from interface:RegistryStorage
Is the artifactStore ready?By default we check if it can access list of global rules.
- Specified by:
isReady
in interfaceRegistryStorage
- Returns:
- true if yes, false if no
-
isAlive
public boolean isAlive()
Description copied from interface:RegistryStorage
Is the artifactStore alive?By default it's true.
- Specified by:
isAlive
in interfaceRegistryStorage
- Returns:
- true if yes, false if no
-
updateArtifactState
public void updateArtifactState(String groupId, String artifactId, ArtifactState state) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Update artifact state.- Specified by:
updateArtifactState
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
updateArtifactState
public void updateArtifactState(String groupId, String artifactId, String version, ArtifactState state) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Update artifact state.- Specified by:
updateArtifactState
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
createArtifact
public CompletionStage<ArtifactMetaDataDto> createArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content) throws ArtifactAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorage
Creates a new artifact (from the given value) in the artifactStore. The artifactId must be unique within the given artifact group. Returns a map of meta-data generated by the artifactStore layer, such as the generated, globally unique globalId of the new value. If the group did not exist previously it is created automatically.- Specified by:
createArtifact
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)version
- (optional)- Throws:
ArtifactAlreadyExistsException
RegistryStorageException
-
createArtifactWithMetadata
public CompletionStage<ArtifactMetaDataDto> createArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData) throws ArtifactAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorage
Creates a new artifact (from the given value including metadata) in the artifactStore. The artifactId must be unique within the given artifact group. Returns a map of meta-data generated by the artifactStore layer, such as the generated, globally unique globalId of the new value.- Specified by:
createArtifactWithMetadata
in interfaceRegistryStorage
- Parameters:
groupId
- (optional) (optional)version
- (optional)- Throws:
ArtifactAlreadyExistsException
RegistryStorageException
- See Also:
RegistryStorage.createArtifactWithMetadata(java.lang.String, java.lang.String, java.lang.String, io.apicurio.registry.types.ArtifactType, io.apicurio.registry.content.ContentHandle, io.apicurio.registry.storage.dto.EditableArtifactMetaDataDto)
-
deleteArtifact
public List<String> deleteArtifact(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Deletes an artifact by its group and unique id. Returns list of artifact versions.- Specified by:
deleteArtifact
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
deleteArtifacts
public void deleteArtifacts(String groupId) throws RegistryStorageException
Description copied from interface:RegistryStorage
Deletes all artifacts in the given group. DOES NOT delete the group.- Specified by:
deleteArtifacts
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
RegistryStorageException
-
getArtifact
public StoredArtifactDto getArtifact(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets the most recent version of the value of the artifact with the given group and ID.- Specified by:
getArtifact
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactByContentHash
public ContentHandle getArtifactByContentHash(String contentHash) throws ContentNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets some artifact content by the SHA-256 hash of that content. This method of getting content from storage does not allow extra meta-data to be returned, because the content hash only points to a piece of content/data - it is divorced from any artifact version.- Specified by:
getArtifactByContentHash
in interfaceRegistryStorage
- Throws:
ContentNotFoundException
RegistryStorageException
-
getArtifactByContentId
public ContentHandle getArtifactByContentId(long contentId) throws ContentNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets some artifact content by the unique contentId. This method of getting content from storage does not allow extra meta-data to be returned, because the contentId only points to a piece of content/data - it is divorced from any artifact version.- Specified by:
getArtifactByContentId
in interfaceRegistryStorage
- Throws:
ContentNotFoundException
RegistryStorageException
-
updateArtifact
public CompletionStage<ArtifactMetaDataDto> updateArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Updates the artifact value by storing the given value as a new version of the artifact. Previous value is NOT overwitten. Returns a map of meta-data generated by the artifactStore layer, such as the generated, globally unique globalId of the new value.- Specified by:
updateArtifact
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)version
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
updateArtifactWithMetadata
public CompletionStage<ArtifactMetaDataDto> updateArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Updates the artifact value by storing the given value and metadata as a new version of the artifact. Previous value is NOT overwitten. Returns a map of meta-data generated by the artifactStore layer, such as the generated, globally unique globalId of the new value.- Specified by:
updateArtifactWithMetadata
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)version
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactIds
public Set<String> getArtifactIds(Integer limit)
Description copied from interface:RegistryStorage
Get all artifact ids. --- Note: This should only be used in older APIs such as the registry V1 REST API and the Confluent API ---- Specified by:
getArtifactIds
in interfaceRegistryStorage
- Parameters:
limit
- the limit of artifacts- Returns:
- all artifact ids
-
searchArtifacts
public ArtifactSearchResultsDto searchArtifacts(Set<SearchFilter> filters, OrderBy orderBy, OrderDirection orderDirection, int offset, int limit)
Description copied from interface:RegistryStorage
Search artifacts by given criteria- Specified by:
searchArtifacts
in interfaceRegistryStorage
- Parameters:
filters
- the set of filters to apply when searchingorderBy
- the field to order byorderDirection
- the direction to order the resultsoffset
- the number of artifacts to skiplimit
- the result size limit
-
getArtifactMetaData
public ArtifactMetaDataDto getArtifactMetaData(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets the stored meta-data for an artifact by group and ID. This will include client-editable meta-data such as name and description, but also generated meta-data such as "modifedOn" and "globalId".- Specified by:
getArtifactMetaData
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactVersionMetaData
public ArtifactVersionMetaDataDto getArtifactVersionMetaData(String groupId, String artifactId, boolean canonical, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets the metadata of the version that matches content.- Specified by:
getArtifactVersionMetaData
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactMetaData
public ArtifactMetaDataDto getArtifactMetaData(long id) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets the stored meta-data for an artifact by global ID. This will include client-editable meta-data such as name and description, but also generated meta-data such as "modifedOn" and "globalId".- Specified by:
getArtifactMetaData
in interfaceRegistryStorage
- Throws:
ArtifactNotFoundException
RegistryStorageException
-
updateArtifactMetaData
public void updateArtifactMetaData(String groupId, String artifactId, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Updates the stored meta-data for an artifact by group and ID. Only the client-editable meta-data can be updated. Client editable meta-data includes e.g. name and description. TODO what if set to null?- Specified by:
updateArtifactMetaData
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactRules
public List<RuleType> getArtifactRules(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets a list of rules configured for a specific Artifact (by group and ID). This will return only the names of the rules.- Specified by:
getArtifactRules
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
createArtifactRuleAsync
public CompletionStage<Void> createArtifactRuleAsync(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleAlreadyExistsException, RegistryStorageException
- Specified by:
createArtifactRuleAsync
in interfaceRegistryStorage
- Throws:
ArtifactNotFoundException
RuleAlreadyExistsException
RegistryStorageException
-
deleteArtifactRules
public void deleteArtifactRules(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Deletes all rules stored/configured for the artifact.- Specified by:
deleteArtifactRules
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactRule
public RuleConfigurationDto getArtifactRule(String groupId, String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets all of the information for a single rule configured on a given artifact.- Specified by:
getArtifactRule
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RuleNotFoundException
RegistryStorageException
-
updateArtifactRule
public void updateArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Updates the configuration information for a single rule on a given artifact.- Specified by:
updateArtifactRule
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RuleNotFoundException
RegistryStorageException
-
deleteArtifactRule
public void deleteArtifactRule(String groupId, String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Deletes a single stored/configured rule for a given artifact.- Specified by:
deleteArtifactRule
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RuleNotFoundException
RegistryStorageException
-
getArtifactVersions
public List<String> getArtifactVersions(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets a sorted set of all artifact versions that exist for a given artifact.- Specified by:
getArtifactVersions
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
RegistryStorageException
-
searchVersions
public VersionSearchResultsDto searchVersions(String groupId, String artifactId, int offset, int limit) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Fetch the versions of the given artifact- Specified by:
searchVersions
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)artifactId
- the artifact used to fetch versionsoffset
- the number of versions to skiplimit
- the result size limit- Returns:
- the artifact versions, limited
- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactVersion
public StoredArtifactDto getArtifactVersion(long id) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets the stored artifact content for the artifact version with the given unique global ID.- Specified by:
getArtifactVersion
in interfaceRegistryStorage
- Throws:
ArtifactNotFoundException
RegistryStorageException
-
getArtifactVersion
public StoredArtifactDto getArtifactVersion(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets the stored value for a single version of a given artifact.- Specified by:
getArtifactVersion
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
deleteArtifactVersion
public void deleteArtifactVersion(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Deletes a single version of a given artifact.- Specified by:
deleteArtifactVersion
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
getArtifactVersionMetaData
public ArtifactVersionMetaDataDto getArtifactVersionMetaData(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets the stored meta-data for a single version of an artifact. This will return all meta-data for the version, including any user edited meta-data along with anything generated by the artifactStore.- Specified by:
getArtifactVersionMetaData
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
updateArtifactVersionMetaData
public void updateArtifactVersionMetaData(String groupId, String artifactId, String version, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Updates the user-editable meta-data for a single version of a given artifact. Only the client-editable meta-data can be updated. Client editable meta-data includes e.g. name and description.- Specified by:
updateArtifactVersionMetaData
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
deleteArtifactVersionMetaData
public void deleteArtifactVersionMetaData(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Deletes the user-editable meta-data for a singel version of a given artifact. Only the client-editable meta-data is deleted. Any meta-data generated by the artifactStore is preserved.- Specified by:
deleteArtifactVersionMetaData
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
-
getGlobalRules
public List<RuleType> getGlobalRules() throws RegistryStorageException
Description copied from interface:RegistryStorage
Gets a list of all global rule names.- Specified by:
getGlobalRules
in interfaceRegistryStorage
- Throws:
RegistryStorageException
-
createGlobalRule
public void createGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorage
Creates a single global rule. Duplicates (by name) are not allowed. Stores the rule name and configuration.- Specified by:
createGlobalRule
in interfaceRegistryStorage
- Throws:
RuleAlreadyExistsException
RegistryStorageException
-
deleteGlobalRules
public void deleteGlobalRules() throws RegistryStorageException
Description copied from interface:RegistryStorage
Deletes all of the globally configured rules.- Specified by:
deleteGlobalRules
in interfaceRegistryStorage
- Throws:
RegistryStorageException
-
getGlobalRule
public RuleConfigurationDto getGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Gets all information about a single global rule.- Specified by:
getGlobalRule
in interfaceRegistryStorage
- Throws:
RuleNotFoundException
RegistryStorageException
-
updateGlobalRule
public void updateGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Updates the configuration settings for a single global rule.- Specified by:
updateGlobalRule
in interfaceRegistryStorage
- Throws:
RuleNotFoundException
RegistryStorageException
-
deleteGlobalRule
public void deleteGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Deletes a single global rule.- Specified by:
deleteGlobalRule
in interfaceRegistryStorage
- Throws:
RuleNotFoundException
RegistryStorageException
-
getLogConfiguration
public LogConfigurationDto getLogConfiguration(String logger) throws RegistryStorageException, LogConfigurationNotFoundException
Description copied from interface:RegistryStorage
Returns the log configuration persisted in the storage for the given logger- Specified by:
getLogConfiguration
in interfaceRegistryStorage
- Throws:
RegistryStorageException
LogConfigurationNotFoundException
-
setLogConfiguration
public void setLogConfiguration(LogConfigurationDto logConfiguration) throws RegistryStorageException
Description copied from interface:RegistryStorage
Persists the given log configuration- Specified by:
setLogConfiguration
in interfaceRegistryStorage
- Throws:
RegistryStorageException
-
removeLogConfiguration
public void removeLogConfiguration(String logger) throws RegistryStorageException, LogConfigurationNotFoundException
Description copied from interface:RegistryStorage
Removes the persisted log configuration for the given logger- Specified by:
removeLogConfiguration
in interfaceRegistryStorage
- Throws:
RegistryStorageException
LogConfigurationNotFoundException
-
listLogConfigurations
public List<LogConfigurationDto> listLogConfigurations() throws RegistryStorageException
Description copied from interface:RegistryStorage
Returns the list of log configuration persisted in the storage- Specified by:
listLogConfigurations
in interfaceRegistryStorage
- Throws:
RegistryStorageException
-
createGroup
public void createGroup(GroupMetaDataDto group) throws GroupAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorage
Creates a new empty group and stores it's metadata. When creating an artifact the group is automatically created in it does not exist.- Specified by:
createGroup
in interfaceRegistryStorage
- Throws:
GroupAlreadyExistsException
RegistryStorageException
- See Also:
RegistryStorage.createGroup(io.apicurio.registry.storage.dto.GroupMetaDataDto)
-
updateGroupMetaData
public void updateGroupMetaData(GroupMetaDataDto group) throws GroupNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Updates the metadata of an existent group.- Specified by:
updateGroupMetaData
in interfaceRegistryStorage
- Throws:
RegistryStorageException
GroupNotFoundException
- See Also:
RegistryStorage.updateGroupMetaData(io.apicurio.registry.storage.dto.GroupMetaDataDto)
-
deleteGroup
public void deleteGroup(String groupId) throws GroupNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Deletes a group intified by the given groupId and DELETES ALL resources related to this group- Specified by:
deleteGroup
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
GroupNotFoundException
RegistryStorageException
- See Also:
RegistryStorage.deleteGroup(java.lang.String)
-
getGroupIds
public List<String> getGroupIds(Integer limit) throws RegistryStorageException
Description copied from interface:RegistryStorage
Get all groupIds- Specified by:
getGroupIds
in interfaceRegistryStorage
- Throws:
RegistryStorageException
- See Also:
RegistryStorage.getGroupIds(java.lang.Integer)
-
getGroupMetaData
public GroupMetaDataDto getGroupMetaData(String groupId) throws GroupNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorage
Get the metadata information for a group identified by the given groupId- Specified by:
getGroupMetaData
in interfaceRegistryStorage
- Parameters:
groupId
- (optional)- Throws:
GroupNotFoundException
RegistryStorageException
- See Also:
RegistryStorage.getGroupMetaData(java.lang.String)
-
getArtifactVersionsByContentId
public List<ArtifactMetaDataDto> getArtifactVersionsByContentId(long contentId)
Description copied from interface:RegistryStorage
Get artifact metadata for a given contentId- Specified by:
getArtifactVersionsByContentId
in interfaceRegistryStorage
- Returns:
- See Also:
RegistryStorage.getArtifactVersionsByContentId(long)
-
exportData
public void exportData(Function<Entity,Void> handler) throws RegistryStorageException
Description copied from interface:RegistryStorage
Called to export all data in the registry. Caller provides a handle to handle the data/entities. This should be used to stream the data from the storage to some output source (e.g. a HTTP response). It is important that the full dataset is *not* kept in memory.- Specified by:
exportData
in interfaceRegistryStorage
- Throws:
RegistryStorageException
- See Also:
RegistryStorage.exportData(java.util.function.Function)
-
importData
public void importData(EntityInputStream entities) throws RegistryStorageException
Description copied from interface:RegistryStorage
Called to import previously exported data into the registry.- Specified by:
importData
in interfaceRegistryStorage
- Throws:
RegistryStorageException
- See Also:
RegistryStorage.importData(io.apicurio.registry.storage.impexp.EntityInputStream)
-
-