Class RegistryStorageDecorator
- java.lang.Object
-
- io.apicurio.registry.storage.decorator.RegistryStorageDecorator
-
- All Implemented Interfaces:
RegistryStorage
- Direct Known Subclasses:
EventSourcedRegistryStorage,RegistryStorageLimitsEnforcer
public abstract class RegistryStorageDecorator extends Object implements RegistryStorage
- Author:
- Fabian Martinez
-
-
Field Summary
Fields Modifier and Type Field Description protected RegistryStoragedelegate
-
Constructor Summary
Constructors Constructor Description RegistryStorageDecorator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description DownloadContextDtoconsumeDownload(String downloadId)Called to consume a download from the DB (single-use) and return its context info.longcountArtifacts()Counts the total number of artifactslongcountArtifactVersions(String groupId, String artifactId)Counts the total number of versions for one artifactlongcountTotalArtifactVersions()Counts the total number of versions for all artifactsArtifactMetaDataDtocreateArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content)Creates a new artifact (from the given value) in the artifactStore.voidcreateArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config)Creates an artifact rule for a specific Artifact.ArtifactMetaDataDtocreateArtifactWithMetadata(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.StringcreateDownload(DownloadContextDto context)Called to create a single-use download "link".voidcreateGlobalRule(RuleType rule, RuleConfigurationDto config)Creates a single global rule.voidcreateGroup(GroupMetaDataDto group)Creates a new empty group and stores it's metadata.voidcreateRoleMapping(String principalId, String role, String principalName)Creates a role mapping for a user.voiddeleteAllExpiredDownloads()Called to delete any expired rows in the downloads table.voiddeleteAllUserData()Deletes ALL user (tenant) data.List<String>deleteArtifact(String groupId, String artifactId)Deletes an artifact by its group and unique id.voiddeleteArtifactRule(String groupId, String artifactId, RuleType rule)Deletes a single stored/configured rule for a given artifact.voiddeleteArtifactRules(String groupId, String artifactId)Deletes all rules stored/configured for the artifact.voiddeleteArtifacts(String groupId)Deletes all artifacts in the given group.voiddeleteArtifactVersion(String groupId, String artifactId, String version)Deletes a single version of a given artifact.voiddeleteArtifactVersionMetaData(String groupId, String artifactId, String version)Deletes the user-editable meta-data for a singel version of a given artifact.voiddeleteGlobalRule(RuleType rule)Deletes a single global rule.voiddeleteGlobalRules()Deletes all of the globally configured rules.voiddeleteGroup(String groupId)Deletes a group intified by the given groupId and DELETES ALL resources related to this groupvoiddeleteRoleMapping(String principalId)Deletes a single role mapping.voidexportData(Function<Entity,Void> handler)Called to export all data in the registry.StoredArtifactDtogetArtifact(String groupId, String artifactId)Gets the most recent version of the value of the artifact with the given group and ID.ContentHandlegetArtifactByContentHash(String contentHash)Gets some artifact content by the SHA-256 hash of that content.ContentHandlegetArtifactByContentId(long contentId)Gets some artifact content by the unique contentId.Set<String>getArtifactIds(Integer limit)Get all artifact ids.ArtifactMetaDataDtogetArtifactMetaData(long globalId)Gets the stored meta-data for an artifact by global ID.ArtifactMetaDataDtogetArtifactMetaData(String groupId, String artifactId)Gets the stored meta-data for an artifact by group and ID.RuleConfigurationDtogetArtifactRule(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).StoredArtifactDtogetArtifactVersion(long globalId)Gets the stored artifact content for the artifact version with the given unique global ID.StoredArtifactDtogetArtifactVersion(String groupId, String artifactId, String version)Gets the stored value for a single version of a given artifact.ArtifactVersionMetaDataDtogetArtifactVersionMetaData(String groupId, String artifactId, boolean canonical, ContentHandle content)Gets the metadata of the version that matches content.ArtifactVersionMetaDataDtogetArtifactVersionMetaData(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 contentIdRuleConfigurationDtogetGlobalRule(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 groupIdsGroupMetaDataDtogetGroupMetaData(String groupId)Get the metadata information for a group identified by the given groupIdLogConfigurationDtogetLogConfiguration(String logger)Returns the log configuration persisted in the storage for the given loggerStringgetRoleForPrincipal(String principalId)Gets the role for a single user.RoleMappingDtogetRoleMapping(String principalId)Gets the details of a single role mapping.List<RoleMappingDto>getRoleMappings()Gets the list of all the role mappings in the registry.voidimportData(EntityInputStream entities)Called to import previously exported data into the registry.booleanisAlive()Is the artifactStore alive?abstract booleanisEnabled()booleanisReady()Is the artifactStore ready?List<LogConfigurationDto>listLogConfigurations()Returns the list of log configuration persisted in the storageabstract intorder()voidremoveLogConfiguration(String logger)Removes the persisted log configuration for the given loggerArtifactSearchResultsDtosearchArtifacts(Set<SearchFilter> filters, OrderBy orderBy, OrderDirection orderDirection, int offset, int limit)Search artifacts by given criteriaVersionSearchResultsDtosearchVersions(String groupId, String artifactId, int offset, int limit)Fetch the versions of the given artifactvoidsetDelegate(RegistryStorage delegate)voidsetLogConfiguration(LogConfigurationDto logConfiguration)Persists the given log configurationStringstorageName()The storage namebooleansupportsMultiTenancy()Returns true if the storage implementation supports multitenancy.ArtifactMetaDataDtoupdateArtifact(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.voidupdateArtifactMetaData(String groupId, String artifactId, EditableArtifactMetaDataDto metaData)Updates the stored meta-data for an artifact by group and ID.voidupdateArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config)Updates the configuration information for a single rule on a given artifact.voidupdateArtifactState(String groupId, String artifactId, ArtifactState state)Update artifact state.voidupdateArtifactState(String groupId, String artifactId, String version, ArtifactState state)Update artifact state.voidupdateArtifactVersionMetaData(String groupId, String artifactId, String version, EditableArtifactMetaDataDto metaData)Updates the user-editable meta-data for a single version of a given artifact.ArtifactMetaDataDtoupdateArtifactWithMetadata(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.voidupdateGlobalRule(RuleType rule, RuleConfigurationDto config)Updates the configuration settings for a single global rule.voidupdateGroupMetaData(GroupMetaDataDto group)Updates the metadata of an existent group.voidupdateRoleMapping(String principalId, String role)Updates a single role mapping.
-
-
-
Field Detail
-
delegate
protected RegistryStorage delegate
-
-
Method Detail
-
isEnabled
public abstract boolean isEnabled()
-
order
public abstract int order()
-
setDelegate
public void setDelegate(RegistryStorage delegate)
- Parameters:
delegate-
-
storageName
public String storageName()
Description copied from interface:RegistryStorageThe storage name- Specified by:
storageNamein interfaceRegistryStorage- See Also:
RegistryStorage.storageName()
-
supportsMultiTenancy
public boolean supportsMultiTenancy()
Description copied from interface:RegistryStorageReturns true if the storage implementation supports multitenancy. If the storage supports multitenancy, it will get the tenant information from theTenantContext- Specified by:
supportsMultiTenancyin interfaceRegistryStorage- Returns:
- if multitenancy is supported
- See Also:
RegistryStorage.supportsMultiTenancy()
-
isReady
public boolean isReady()
Description copied from interface:RegistryStorageIs the artifactStore ready?By default we check if it can access list of global rules.
- Specified by:
isReadyin interfaceRegistryStorage- Returns:
- true if yes, false if no
- See Also:
RegistryStorage.isReady()
-
isAlive
public boolean isAlive()
Description copied from interface:RegistryStorageIs the artifactStore alive?By default it's true.
- Specified by:
isAlivein interfaceRegistryStorage- Returns:
- true if yes, false if no
- See Also:
RegistryStorage.isAlive()
-
updateArtifactState
public void updateArtifactState(String groupId, String artifactId, ArtifactState state) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdate artifact state.- Specified by:
updateArtifactStatein interfaceRegistryStorage- Parameters:
groupId-artifactId-state-- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateArtifactState(java.lang.String, java.lang.String, io.apicurio.registry.types.ArtifactState)
-
updateArtifactState
public void updateArtifactState(String groupId, String artifactId, String version, ArtifactState state) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdate artifact state.- Specified by:
updateArtifactStatein interfaceRegistryStorage- Parameters:
groupId-artifactId-version-state-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateArtifactState(java.lang.String, java.lang.String, java.lang.String, io.apicurio.registry.types.ArtifactState)
-
createArtifact
public ArtifactMetaDataDto createArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content) throws ArtifactAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorageCreates 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:
createArtifactin interfaceRegistryStorage- Parameters:
groupId-artifactId-version-artifactType-content-- Returns:
- Throws:
ArtifactAlreadyExistsExceptionRegistryStorageException- See Also:
RegistryStorage.createArtifact(java.lang.String, java.lang.String, java.lang.String, io.apicurio.registry.types.ArtifactType, io.apicurio.registry.content.ContentHandle)
-
createArtifactWithMetadata
public ArtifactMetaDataDto createArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData) throws ArtifactAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorageCreates 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:
createArtifactWithMetadatain interfaceRegistryStorage- Parameters:
groupId-artifactId-version-artifactType-content-metaData-- Returns:
- Throws:
ArtifactAlreadyExistsExceptionRegistryStorageException- 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:RegistryStorageDeletes an artifact by its group and unique id. Returns list of artifact versions.- Specified by:
deleteArtifactin interfaceRegistryStorage- Parameters:
groupId-artifactId-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.deleteArtifact(java.lang.String, java.lang.String)
-
deleteArtifacts
public void deleteArtifacts(String groupId) throws RegistryStorageException
Description copied from interface:RegistryStorageDeletes all artifacts in the given group. DOES NOT delete the group.- Specified by:
deleteArtifactsin interfaceRegistryStorage- Parameters:
groupId-- Throws:
RegistryStorageException- See Also:
RegistryStorage.deleteArtifacts(java.lang.String)
-
getArtifact
public StoredArtifactDto getArtifact(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets the most recent version of the value of the artifact with the given group and ID.- Specified by:
getArtifactin interfaceRegistryStorage- Parameters:
groupId-artifactId-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifact(java.lang.String, java.lang.String)
-
getArtifactByContentId
public ContentHandle getArtifactByContentId(long contentId) throws ContentNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets 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:
getArtifactByContentIdin interfaceRegistryStorage- Parameters:
contentId-- Returns:
- Throws:
ContentNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactByContentId(long)
-
getArtifactByContentHash
public ContentHandle getArtifactByContentHash(String contentHash) throws ContentNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets 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:
getArtifactByContentHashin interfaceRegistryStorage- Parameters:
contentHash-- Returns:
- Throws:
ContentNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactByContentHash(java.lang.String)
-
getArtifactVersionsByContentId
public List<ArtifactMetaDataDto> getArtifactVersionsByContentId(long contentId)
Description copied from interface:RegistryStorageGet artifact metadata for a given contentId- Specified by:
getArtifactVersionsByContentIdin interfaceRegistryStorage- Parameters:
contentId-- Returns:
- See Also:
RegistryStorage.getArtifactVersionsByContentId(long)
-
updateArtifact
public ArtifactMetaDataDto updateArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdates 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:
updateArtifactin interfaceRegistryStorage- Parameters:
groupId-artifactId-version-artifactType-content-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateArtifact(java.lang.String, java.lang.String, java.lang.String, io.apicurio.registry.types.ArtifactType, io.apicurio.registry.content.ContentHandle)
-
updateArtifactWithMetadata
public ArtifactMetaDataDto updateArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdates 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:
updateArtifactWithMetadatain interfaceRegistryStorage- Parameters:
groupId-artifactId-version-artifactType-content-metaData-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateArtifactWithMetadata(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)
-
getArtifactIds
public Set<String> getArtifactIds(Integer limit)
Description copied from interface:RegistryStorageGet 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:
getArtifactIdsin interfaceRegistryStorage- Parameters:
limit-- Returns:
- See Also:
RegistryStorage.getArtifactIds(java.lang.Integer)
-
searchArtifacts
public ArtifactSearchResultsDto searchArtifacts(Set<SearchFilter> filters, OrderBy orderBy, OrderDirection orderDirection, int offset, int limit)
Description copied from interface:RegistryStorageSearch artifacts by given criteria- Specified by:
searchArtifactsin interfaceRegistryStorage- Parameters:
filters-orderBy-orderDirection-offset-limit-- Returns:
- See Also:
RegistryStorage.searchArtifacts(java.util.Set, io.apicurio.registry.storage.dto.OrderBy, io.apicurio.registry.storage.dto.OrderDirection, int, int)
-
getArtifactMetaData
public ArtifactMetaDataDto getArtifactMetaData(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets 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:
getArtifactMetaDatain interfaceRegistryStorage- Parameters:
groupId-artifactId-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactMetaData(java.lang.String, java.lang.String)
-
getArtifactVersionMetaData
public ArtifactVersionMetaDataDto getArtifactVersionMetaData(String groupId, String artifactId, boolean canonical, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets the metadata of the version that matches content.- Specified by:
getArtifactVersionMetaDatain interfaceRegistryStorage- Parameters:
groupId-artifactId-canonical-content-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactVersionMetaData(java.lang.String, java.lang.String, boolean, io.apicurio.registry.content.ContentHandle)
-
getArtifactMetaData
public ArtifactMetaDataDto getArtifactMetaData(long globalId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets 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:
getArtifactMetaDatain interfaceRegistryStorage- Parameters:
globalId-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactMetaData(long)
-
updateArtifactMetaData
public void updateArtifactMetaData(String groupId, String artifactId, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdates 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:
updateArtifactMetaDatain interfaceRegistryStorage- Parameters:
groupId-artifactId-metaData-- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateArtifactMetaData(java.lang.String, java.lang.String, io.apicurio.registry.storage.dto.EditableArtifactMetaDataDto)
-
getArtifactRules
public List<RuleType> getArtifactRules(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets a list of rules configured for a specific Artifact (by group and ID). This will return only the names of the rules.- Specified by:
getArtifactRulesin interfaceRegistryStorage- Parameters:
groupId-artifactId-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactRules(java.lang.String, java.lang.String)
-
createArtifactRule
public void createArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorageCreates an artifact rule for a specific Artifact. If the named rule already exists for the artifact, then this should fail.- Specified by:
createArtifactRulein interfaceRegistryStorage- Parameters:
groupId-artifactId-rule-config-- Throws:
ArtifactNotFoundExceptionRuleAlreadyExistsExceptionRegistryStorageException- See Also:
RegistryStorage.createArtifactRule(java.lang.String, java.lang.String, io.apicurio.registry.types.RuleType, io.apicurio.registry.storage.dto.RuleConfigurationDto)
-
deleteArtifactRules
public void deleteArtifactRules(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageDeletes all rules stored/configured for the artifact.- Specified by:
deleteArtifactRulesin interfaceRegistryStorage- Parameters:
groupId-artifactId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.deleteArtifactRules(java.lang.String, java.lang.String)
-
getArtifactRule
public RuleConfigurationDto getArtifactRule(String groupId, String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets all of the information for a single rule configured on a given artifact.- Specified by:
getArtifactRulein interfaceRegistryStorage- Parameters:
groupId-artifactId-rule-- Returns:
- Throws:
ArtifactNotFoundExceptionRuleNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactRule(java.lang.String, java.lang.String, io.apicurio.registry.types.RuleType)
-
updateArtifactRule
public void updateArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdates the configuration information for a single rule on a given artifact.- Specified by:
updateArtifactRulein interfaceRegistryStorage- Parameters:
groupId-artifactId-rule-config-- Throws:
ArtifactNotFoundExceptionRuleNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateArtifactRule(java.lang.String, java.lang.String, io.apicurio.registry.types.RuleType, io.apicurio.registry.storage.dto.RuleConfigurationDto)
-
deleteArtifactRule
public void deleteArtifactRule(String groupId, String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageDeletes a single stored/configured rule for a given artifact.- Specified by:
deleteArtifactRulein interfaceRegistryStorage- Parameters:
groupId-artifactId-rule-- Throws:
ArtifactNotFoundExceptionRuleNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.deleteArtifactRule(java.lang.String, java.lang.String, io.apicurio.registry.types.RuleType)
-
getArtifactVersions
public List<String> getArtifactVersions(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets a sorted set of all artifact versions that exist for a given artifact.- Specified by:
getArtifactVersionsin interfaceRegistryStorage- Parameters:
groupId-artifactId-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactVersions(java.lang.String, java.lang.String)
-
searchVersions
public VersionSearchResultsDto searchVersions(String groupId, String artifactId, int offset, int limit) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageFetch the versions of the given artifact- Specified by:
searchVersionsin interfaceRegistryStorage- Parameters:
groupId-artifactId-offset-limit-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.searchVersions(java.lang.String, java.lang.String, int, int)
-
getArtifactVersion
public StoredArtifactDto getArtifactVersion(long globalId) throws ArtifactNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets the stored artifact content for the artifact version with the given unique global ID.- Specified by:
getArtifactVersionin interfaceRegistryStorage- Parameters:
globalId-- Returns:
- Throws:
ArtifactNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactVersion(long)
-
getArtifactVersion
public StoredArtifactDto getArtifactVersion(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets the stored value for a single version of a given artifact.- Specified by:
getArtifactVersionin interfaceRegistryStorage- Parameters:
groupId-artifactId-version-- Returns:
- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactVersion(java.lang.String, java.lang.String, java.lang.String)
-
deleteArtifactVersion
public void deleteArtifactVersion(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageDeletes a single version of a given artifact.- Specified by:
deleteArtifactVersionin interfaceRegistryStorage- Parameters:
groupId-artifactId-version-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.deleteArtifactVersion(java.lang.String, java.lang.String, java.lang.String)
-
getArtifactVersionMetaData
public ArtifactVersionMetaDataDto getArtifactVersionMetaData(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets 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:
getArtifactVersionMetaDatain interfaceRegistryStorage- Parameters:
groupId-artifactId-version-- Returns:
- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getArtifactVersionMetaData(java.lang.String, java.lang.String, java.lang.String)
-
updateArtifactVersionMetaData
public void updateArtifactVersionMetaData(String groupId, String artifactId, String version, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdates 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:
updateArtifactVersionMetaDatain interfaceRegistryStorage- Parameters:
groupId-artifactId-version-metaData-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateArtifactVersionMetaData(java.lang.String, java.lang.String, java.lang.String, io.apicurio.registry.storage.dto.EditableArtifactMetaDataDto)
-
deleteArtifactVersionMetaData
public void deleteArtifactVersionMetaData(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageDeletes 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:
deleteArtifactVersionMetaDatain interfaceRegistryStorage- Parameters:
groupId-artifactId-version-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.deleteArtifactVersionMetaData(java.lang.String, java.lang.String, java.lang.String)
-
getGlobalRules
public List<RuleType> getGlobalRules() throws RegistryStorageException
Description copied from interface:RegistryStorageGets a list of all global rule names.- Specified by:
getGlobalRulesin interfaceRegistryStorage- Returns:
- Throws:
RegistryStorageException- See Also:
RegistryStorage.getGlobalRules()
-
createGlobalRule
public void createGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorageCreates a single global rule. Duplicates (by name) are not allowed. Stores the rule name and configuration.- Specified by:
createGlobalRulein interfaceRegistryStorage- Parameters:
rule-config-- Throws:
RuleAlreadyExistsExceptionRegistryStorageException- See Also:
RegistryStorage.createGlobalRule(io.apicurio.registry.types.RuleType, io.apicurio.registry.storage.dto.RuleConfigurationDto)
-
deleteGlobalRules
public void deleteGlobalRules() throws RegistryStorageExceptionDescription copied from interface:RegistryStorageDeletes all of the globally configured rules.- Specified by:
deleteGlobalRulesin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.deleteGlobalRules()
-
getGlobalRule
public RuleConfigurationDto getGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGets all information about a single global rule.- Specified by:
getGlobalRulein interfaceRegistryStorage- Parameters:
rule-- Returns:
- Throws:
RuleNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getGlobalRule(io.apicurio.registry.types.RuleType)
-
updateGlobalRule
public void updateGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdates the configuration settings for a single global rule.- Specified by:
updateGlobalRulein interfaceRegistryStorage- Parameters:
rule-config-- Throws:
RuleNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateGlobalRule(io.apicurio.registry.types.RuleType, io.apicurio.registry.storage.dto.RuleConfigurationDto)
-
deleteGlobalRule
public void deleteGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageDeletes a single global rule.- Specified by:
deleteGlobalRulein interfaceRegistryStorage- Parameters:
rule-- Throws:
RuleNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.deleteGlobalRule(io.apicurio.registry.types.RuleType)
-
getLogConfiguration
public LogConfigurationDto getLogConfiguration(String logger) throws RegistryStorageException, LogConfigurationNotFoundException
Description copied from interface:RegistryStorageReturns the log configuration persisted in the storage for the given logger- Specified by:
getLogConfigurationin interfaceRegistryStorage- Parameters:
logger-- Returns:
- Throws:
RegistryStorageExceptionLogConfigurationNotFoundException- See Also:
RegistryStorage.getLogConfiguration(java.lang.String)
-
setLogConfiguration
public void setLogConfiguration(LogConfigurationDto logConfiguration) throws RegistryStorageException
Description copied from interface:RegistryStoragePersists the given log configuration- Specified by:
setLogConfigurationin interfaceRegistryStorage- Parameters:
logConfiguration-- Throws:
RegistryStorageException- See Also:
RegistryStorage.setLogConfiguration(io.apicurio.registry.storage.dto.LogConfigurationDto)
-
removeLogConfiguration
public void removeLogConfiguration(String logger) throws RegistryStorageException, LogConfigurationNotFoundException
Description copied from interface:RegistryStorageRemoves the persisted log configuration for the given logger- Specified by:
removeLogConfigurationin interfaceRegistryStorage- Parameters:
logger-- Throws:
RegistryStorageExceptionLogConfigurationNotFoundException- See Also:
RegistryStorage.removeLogConfiguration(java.lang.String)
-
listLogConfigurations
public List<LogConfigurationDto> listLogConfigurations() throws RegistryStorageException
Description copied from interface:RegistryStorageReturns the list of log configuration persisted in the storage- Specified by:
listLogConfigurationsin interfaceRegistryStorage- Returns:
- Throws:
RegistryStorageException- See Also:
RegistryStorage.listLogConfigurations()
-
createGroup
public void createGroup(GroupMetaDataDto group) throws GroupAlreadyExistsException, RegistryStorageException
Description copied from interface:RegistryStorageCreates 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:
createGroupin interfaceRegistryStorage- Parameters:
group-- Throws:
GroupAlreadyExistsExceptionRegistryStorageException- See Also:
RegistryStorage.createGroup(io.apicurio.registry.storage.dto.GroupMetaDataDto)
-
updateGroupMetaData
public void updateGroupMetaData(GroupMetaDataDto group) throws GroupNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageUpdates the metadata of an existent group.- Specified by:
updateGroupMetaDatain interfaceRegistryStorage- Parameters:
group-- Throws:
GroupNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.updateGroupMetaData(io.apicurio.registry.storage.dto.GroupMetaDataDto)
-
deleteGroup
public void deleteGroup(String groupId) throws GroupNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageDeletes a group intified by the given groupId and DELETES ALL resources related to this group- Specified by:
deleteGroupin interfaceRegistryStorage- Parameters:
groupId-- Throws:
GroupNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.deleteGroup(java.lang.String)
-
getGroupIds
public List<String> getGroupIds(Integer limit) throws RegistryStorageException
Description copied from interface:RegistryStorageGet all groupIds- Specified by:
getGroupIdsin interfaceRegistryStorage- Parameters:
limit-- Returns:
- Throws:
RegistryStorageException- See Also:
RegistryStorage.getGroupIds(java.lang.Integer)
-
getGroupMetaData
public GroupMetaDataDto getGroupMetaData(String groupId) throws GroupNotFoundException, RegistryStorageException
Description copied from interface:RegistryStorageGet the metadata information for a group identified by the given groupId- Specified by:
getGroupMetaDatain interfaceRegistryStorage- Parameters:
groupId-- Returns:
- Throws:
GroupNotFoundExceptionRegistryStorageException- See Also:
RegistryStorage.getGroupMetaData(java.lang.String)
-
exportData
public void exportData(Function<Entity,Void> handler) throws RegistryStorageException
Description copied from interface:RegistryStorageCalled 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:
exportDatain interfaceRegistryStorage- Parameters:
handler-- Throws:
RegistryStorageException- See Also:
RegistryStorage.exportData(java.util.function.Function)
-
importData
public void importData(EntityInputStream entities) throws RegistryStorageException
Description copied from interface:RegistryStorageCalled to import previously exported data into the registry.- Specified by:
importDatain interfaceRegistryStorage- Parameters:
entities-- Throws:
RegistryStorageException- See Also:
RegistryStorage.importData(io.apicurio.registry.storage.impexp.EntityInputStream)
-
countArtifacts
public long countArtifacts() throws RegistryStorageExceptionDescription copied from interface:RegistryStorageCounts the total number of artifacts- Specified by:
countArtifactsin interfaceRegistryStorage- Returns:
- Throws:
RegistryStorageException- See Also:
RegistryStorage.countArtifacts()
-
countArtifactVersions
public long countArtifactVersions(String groupId, String artifactId) throws RegistryStorageException
Description copied from interface:RegistryStorageCounts the total number of versions for one artifact- Specified by:
countArtifactVersionsin interfaceRegistryStorage- Parameters:
groupId-artifactId-- Returns:
- Throws:
RegistryStorageException- See Also:
RegistryStorage.countArtifactVersions(java.lang.String, java.lang.String)
-
countTotalArtifactVersions
public long countTotalArtifactVersions() throws RegistryStorageExceptionDescription copied from interface:RegistryStorageCounts the total number of versions for all artifacts- Specified by:
countTotalArtifactVersionsin interfaceRegistryStorage- Returns:
- Throws:
RegistryStorageException- See Also:
RegistryStorage.countTotalArtifactVersions()
-
createRoleMapping
public void createRoleMapping(String principalId, String role, String principalName) throws RegistryStorageException
Description copied from interface:RegistryStorageCreates a role mapping for a user.- Specified by:
createRoleMappingin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.createRoleMapping(java.lang.String, java.lang.String, java.lang.String)
-
deleteRoleMapping
public void deleteRoleMapping(String principalId) throws RegistryStorageException
Description copied from interface:RegistryStorageDeletes a single role mapping.- Specified by:
deleteRoleMappingin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.deleteRoleMapping(java.lang.String)
-
getRoleMapping
public RoleMappingDto getRoleMapping(String principalId) throws RegistryStorageException
Description copied from interface:RegistryStorageGets the details of a single role mapping.- Specified by:
getRoleMappingin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.getRoleMapping(java.lang.String)
-
getRoleForPrincipal
public String getRoleForPrincipal(String principalId) throws RegistryStorageException
Description copied from interface:RegistryStorageGets the role for a single user. This returns null if there is no role mapped for the given principal.- Specified by:
getRoleForPrincipalin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.getRoleForPrincipal(java.lang.String)
-
getRoleMappings
public List<RoleMappingDto> getRoleMappings() throws RegistryStorageException
Description copied from interface:RegistryStorageGets the list of all the role mappings in the registry.- Specified by:
getRoleMappingsin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.getRoleMappings()
-
updateRoleMapping
public void updateRoleMapping(String principalId, String role) throws RegistryStorageException
Description copied from interface:RegistryStorageUpdates a single role mapping.- Specified by:
updateRoleMappingin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.updateRoleMapping(java.lang.String, java.lang.String)
-
deleteAllUserData
public void deleteAllUserData()
Description copied from interface:RegistryStorageDeletes ALL user (tenant) data. Does not delete global data, such as log configuration.- Specified by:
deleteAllUserDatain interfaceRegistryStorage- See Also:
RegistryStorage.deleteAllUserData()
-
createDownload
public String createDownload(DownloadContextDto context) throws RegistryStorageException
Description copied from interface:RegistryStorageCalled to create a single-use download "link". This can then be consumed using "consumeDownload()". Used to support browser flows for features like /admin/export.- Specified by:
createDownloadin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.createDownload(io.apicurio.registry.storage.dto.DownloadContextDto)
-
consumeDownload
public DownloadContextDto consumeDownload(String downloadId) throws RegistryStorageException
Description copied from interface:RegistryStorageCalled to consume a download from the DB (single-use) and return its context info.- Specified by:
consumeDownloadin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.consumeDownload(java.lang.String)
-
deleteAllExpiredDownloads
public void deleteAllExpiredDownloads() throws RegistryStorageExceptionDescription copied from interface:RegistryStorageCalled to delete any expired rows in the downloads table. This is basically cleaning up any single-use download links that were never "clicked".- Specified by:
deleteAllExpiredDownloadsin interfaceRegistryStorage- Throws:
RegistryStorageException- See Also:
RegistryStorage.deleteAllExpiredDownloads()
-
-