Package io.apicurio.registry.storage
Interface RegistryStorage
-
- All Known Implementing Classes:
AbstractRegistryStorage,AbstractSqlRegistryStorage,EventSourcedRegistryStorage,InMemoryRegistryStorage,RegistryStorageDecorator,RegistryStorageLimitsEnforcer
public interface RegistryStorageThe artifactStore layer for the registry.- Author:
- eric.wittmann@gmail.com, Ales Justin
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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.default booleanisAlive()Is the artifactStore alive?default booleanisReady()Is the artifactStore ready?List<LogConfigurationDto>listLogConfigurations()Returns the list of log configuration persisted in the storagevoidremoveLogConfiguration(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 artifactvoidsetLogConfiguration(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.
-
-
-
Method Detail
-
storageName
String storageName()
The storage name
-
supportsMultiTenancy
boolean supportsMultiTenancy()
Returns true if the storage implementation supports multitenancy. If the storage supports multitenancy, it will get the tenant information from theTenantContext- Returns:
- if multitenancy is supported
-
isReady
default boolean isReady()
Is the artifactStore ready?By default we check if it can access list of global rules.
- Returns:
- true if yes, false if no
-
isAlive
default boolean isAlive()
Is the artifactStore alive?By default it's true.
- Returns:
- true if yes, false if no
-
updateArtifactState
void updateArtifactState(String groupId, String artifactId, ArtifactState state) throws ArtifactNotFoundException, RegistryStorageException
Update artifact state.- Parameters:
groupId- (optional)artifactId-state-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
updateArtifactState
void updateArtifactState(String groupId, String artifactId, String version, ArtifactState state) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Update artifact state.- Parameters:
groupId- (optional)artifactId-version-state-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
createArtifact
ArtifactMetaDataDto createArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content) throws ArtifactAlreadyExistsException, RegistryStorageException
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.- Parameters:
groupId- (optional)artifactId-version- (optional)artifactType-content-- Throws:
ArtifactAlreadyExistsExceptionRegistryStorageException
-
createArtifactWithMetadata
ArtifactMetaDataDto createArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData) throws ArtifactAlreadyExistsException, RegistryStorageException
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.- Parameters:
groupId- (optional)artifactId-version- (optional)artifactType-content-metaData-- Throws:
ArtifactAlreadyExistsExceptionRegistryStorageException
-
deleteArtifact
List<String> deleteArtifact(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Deletes an artifact by its group and unique id. Returns list of artifact versions.- Parameters:
groupId- (optional)artifactId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
deleteArtifacts
void deleteArtifacts(String groupId) throws RegistryStorageException
Deletes all artifacts in the given group. DOES NOT delete the group.- Parameters:
groupId- (optional)- Throws:
RegistryStorageException
-
getArtifact
StoredArtifactDto getArtifact(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Gets the most recent version of the value of the artifact with the given group and ID.- Parameters:
groupId- (optional)artifactId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactByContentId
ContentHandle getArtifactByContentId(long contentId) throws ContentNotFoundException, RegistryStorageException
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.- Parameters:
contentId-- Throws:
ContentNotFoundExceptionRegistryStorageException
-
getArtifactByContentHash
ContentHandle getArtifactByContentHash(String contentHash) throws ContentNotFoundException, RegistryStorageException
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.- Parameters:
contentHash-- Throws:
ContentNotFoundExceptionRegistryStorageException
-
getArtifactVersionsByContentId
List<ArtifactMetaDataDto> getArtifactVersionsByContentId(long contentId)
Get artifact metadata for a given contentId- Parameters:
contentId-- Returns:
-
updateArtifact
ArtifactMetaDataDto updateArtifact(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
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.- Parameters:
groupId- (optional)artifactId-version- (optional)artifactType-content-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
updateArtifactWithMetadata
ArtifactMetaDataDto updateArtifactWithMetadata(String groupId, String artifactId, String version, ArtifactType artifactType, ContentHandle content, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, RegistryStorageException
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.- Parameters:
groupId- (optional)artifactId-version- (optional)artifactType-content-metaData-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactIds
Set<String> getArtifactIds(Integer limit)
Get all artifact ids. --- Note: This should only be used in older APIs such as the registry V1 REST API and the Confluent API ---- Parameters:
limit- the limit of artifacts- Returns:
- all artifact ids
-
searchArtifacts
ArtifactSearchResultsDto searchArtifacts(Set<SearchFilter> filters, OrderBy orderBy, OrderDirection orderDirection, int offset, int limit)
Search artifacts by given criteria- 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
ArtifactMetaDataDto getArtifactMetaData(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
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".- Parameters:
groupId- (optional)artifactId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactVersionMetaData
ArtifactVersionMetaDataDto getArtifactVersionMetaData(String groupId, String artifactId, boolean canonical, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
Gets the metadata of the version that matches content.- Parameters:
groupId- (optional)artifactId-canonical-content-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactMetaData
ArtifactMetaDataDto getArtifactMetaData(long globalId) throws ArtifactNotFoundException, RegistryStorageException
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".- Parameters:
globalId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
updateArtifactMetaData
void updateArtifactMetaData(String groupId, String artifactId, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, RegistryStorageException
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?- Parameters:
groupId- (optional)artifactId-metaData-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactRules
List<RuleType> getArtifactRules(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Gets a list of rules configured for a specific Artifact (by group and ID). This will return only the names of the rules.- Parameters:
groupId- (optional)artifactId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
createArtifactRule
void createArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleAlreadyExistsException, RegistryStorageException
Creates an artifact rule for a specific Artifact. If the named rule already exists for the artifact, then this should fail.- Parameters:
groupId- (optional)artifactId-rule-config-- Throws:
ArtifactNotFoundExceptionRuleAlreadyExistsExceptionRegistryStorageException
-
deleteArtifactRules
void deleteArtifactRules(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Deletes all rules stored/configured for the artifact.- Parameters:
groupId- (optional)artifactId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactRule
RuleConfigurationDto getArtifactRule(String groupId, String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Gets all of the information for a single rule configured on a given artifact.- Parameters:
groupId- (optional)artifactId-rule-- Throws:
ArtifactNotFoundExceptionRuleNotFoundExceptionRegistryStorageException
-
updateArtifactRule
void updateArtifactRule(String groupId, String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Updates the configuration information for a single rule on a given artifact.- Parameters:
groupId- (optional)artifactId-rule-config-- Throws:
ArtifactNotFoundExceptionRuleNotFoundExceptionRegistryStorageException
-
deleteArtifactRule
void deleteArtifactRule(String groupId, String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
Deletes a single stored/configured rule for a given artifact.- Parameters:
groupId- (optional)artifactId-rule-- Throws:
ArtifactNotFoundExceptionRuleNotFoundExceptionRegistryStorageException
-
getArtifactVersions
List<String> getArtifactVersions(String groupId, String artifactId) throws ArtifactNotFoundException, RegistryStorageException
Gets a sorted set of all artifact versions that exist for a given artifact.- Parameters:
groupId- (optional)artifactId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
searchVersions
VersionSearchResultsDto searchVersions(String groupId, String artifactId, int offset, int limit) throws ArtifactNotFoundException, RegistryStorageException
Fetch the versions of the given artifact- Parameters:
groupId- (optional)artifactId- the artifact used to fetch versionslimit- the result size limitoffset- the number of versions to skip- Returns:
- the artifact versions, limited
- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactVersion
StoredArtifactDto getArtifactVersion(long globalId) throws ArtifactNotFoundException, RegistryStorageException
Gets the stored artifact content for the artifact version with the given unique global ID.- Parameters:
globalId-- Throws:
ArtifactNotFoundExceptionRegistryStorageException
-
getArtifactVersion
StoredArtifactDto getArtifactVersion(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Gets the stored value for a single version of a given artifact.- Parameters:
groupId- (optional)artifactId-version-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
deleteArtifactVersion
void deleteArtifactVersion(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
Deletes a single version of a given artifact.- Parameters:
groupId- (optional)artifactId-version-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
getArtifactVersionMetaData
ArtifactVersionMetaDataDto getArtifactVersionMetaData(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
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.- Parameters:
groupId- (optional)artifactId-version-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
updateArtifactVersionMetaData
void updateArtifactVersionMetaData(String groupId, String artifactId, String version, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
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.- Parameters:
groupId- (optional)artifactId-version-metaData-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
deleteArtifactVersionMetaData
void deleteArtifactVersionMetaData(String groupId, String artifactId, String version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
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.- Parameters:
groupId- (optional)artifactId-version-- Throws:
ArtifactNotFoundExceptionVersionNotFoundExceptionRegistryStorageException
-
getGlobalRules
List<RuleType> getGlobalRules() throws RegistryStorageException
Gets a list of all global rule names.- Throws:
RegistryStorageException
-
createGlobalRule
void createGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleAlreadyExistsException, RegistryStorageException
Creates a single global rule. Duplicates (by name) are not allowed. Stores the rule name and configuration.- Parameters:
rule-config-- Throws:
RuleAlreadyExistsExceptionRegistryStorageException
-
deleteGlobalRules
void deleteGlobalRules() throws RegistryStorageExceptionDeletes all of the globally configured rules.- Throws:
RegistryStorageException
-
getGlobalRule
RuleConfigurationDto getGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
Gets all information about a single global rule.- Parameters:
rule-- Throws:
RuleNotFoundExceptionRegistryStorageException
-
updateGlobalRule
void updateGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleNotFoundException, RegistryStorageException
Updates the configuration settings for a single global rule.- Parameters:
rule-config-- Throws:
RuleNotFoundExceptionRegistryStorageException
-
deleteGlobalRule
void deleteGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
Deletes a single global rule.- Parameters:
rule-- Throws:
RuleNotFoundExceptionRegistryStorageException
-
getLogConfiguration
LogConfigurationDto getLogConfiguration(String logger) throws RegistryStorageException, LogConfigurationNotFoundException
Returns the log configuration persisted in the storage for the given logger- Parameters:
logger-- Throws:
RegistryStorageExceptionLogConfigurationNotFoundException
-
setLogConfiguration
void setLogConfiguration(LogConfigurationDto logConfiguration) throws RegistryStorageException
Persists the given log configuration- Parameters:
logConfiguration-- Throws:
RegistryStorageException
-
removeLogConfiguration
void removeLogConfiguration(String logger) throws RegistryStorageException, LogConfigurationNotFoundException
Removes the persisted log configuration for the given logger- Parameters:
logger-- Throws:
RegistryStorageExceptionLogConfigurationNotFoundException
-
listLogConfigurations
List<LogConfigurationDto> listLogConfigurations() throws RegistryStorageException
Returns the list of log configuration persisted in the storage- Throws:
RegistryStorageException
-
createGroup
void createGroup(GroupMetaDataDto group) throws GroupAlreadyExistsException, RegistryStorageException
Creates a new empty group and stores it's metadata. When creating an artifact the group is automatically created in it does not exist.- Parameters:
group-- Throws:
GroupAlreadyExistsExceptionRegistryStorageException
-
updateGroupMetaData
void updateGroupMetaData(GroupMetaDataDto group) throws GroupNotFoundException, RegistryStorageException
Updates the metadata of an existent group.- Parameters:
group-- Throws:
RegistryStorageExceptionGroupNotFoundException
-
deleteGroup
void deleteGroup(String groupId) throws GroupNotFoundException, RegistryStorageException
Deletes a group intified by the given groupId and DELETES ALL resources related to this group- Parameters:
groupId- (optional)- Throws:
GroupNotFoundExceptionRegistryStorageException
-
getGroupIds
List<String> getGroupIds(Integer limit) throws RegistryStorageException
Get all groupIds- Parameters:
limit-- Throws:
RegistryStorageException
-
getGroupMetaData
GroupMetaDataDto getGroupMetaData(String groupId) throws GroupNotFoundException, RegistryStorageException
Get the metadata information for a group identified by the given groupId- Parameters:
groupId- (optional)- Throws:
GroupNotFoundExceptionRegistryStorageException
-
exportData
void exportData(Function<Entity,Void> handler) throws RegistryStorageException
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.- Parameters:
handler-- Throws:
RegistryStorageException
-
importData
void importData(EntityInputStream entities) throws RegistryStorageException
Called to import previously exported data into the registry.- Parameters:
entities-- Throws:
RegistryStorageException
-
countArtifacts
long countArtifacts() throws RegistryStorageExceptionCounts the total number of artifacts- Returns:
- artifacts count
- Throws:
RegistryStorageException
-
countArtifactVersions
long countArtifactVersions(String groupId, String artifactId) throws RegistryStorageException
Counts the total number of versions for one artifact- Returns:
- Throws:
RegistryStorageException
-
countTotalArtifactVersions
long countTotalArtifactVersions() throws RegistryStorageExceptionCounts the total number of versions for all artifacts- Returns:
- Throws:
RegistryStorageException
-
createRoleMapping
void createRoleMapping(String principalId, String role, String principalName) throws RegistryStorageException
Creates a role mapping for a user.- Parameters:
principalId-role-principalName-- Throws:
RegistryStorageException
-
getRoleMappings
List<RoleMappingDto> getRoleMappings() throws RegistryStorageException
Gets the list of all the role mappings in the registry.- Throws:
RegistryStorageException
-
getRoleMapping
RoleMappingDto getRoleMapping(String principalId) throws RegistryStorageException
Gets the details of a single role mapping.- Parameters:
principalId-- Throws:
RegistryStorageException
-
getRoleForPrincipal
String getRoleForPrincipal(String principalId) throws RegistryStorageException
Gets the role for a single user. This returns null if there is no role mapped for the given principal.- Parameters:
principalId-- Throws:
RegistryStorageException
-
updateRoleMapping
void updateRoleMapping(String principalId, String role) throws RegistryStorageException
Updates a single role mapping.- Parameters:
principalId-role-- Throws:
RegistryStorageException
-
deleteRoleMapping
void deleteRoleMapping(String principalId) throws RegistryStorageException
Deletes a single role mapping.- Parameters:
principalId-- Throws:
RegistryStorageException
-
deleteAllUserData
void deleteAllUserData()
Deletes ALL user (tenant) data. Does not delete global data, such as log configuration.
-
createDownload
String createDownload(DownloadContextDto context) throws RegistryStorageException
Called to create a single-use download "link". This can then be consumed using "consumeDownload()". Used to support browser flows for features like /admin/export.- Parameters:
context-- Throws:
RegistryStorageException
-
consumeDownload
DownloadContextDto consumeDownload(String downloadId) throws RegistryStorageException
Called to consume a download from the DB (single-use) and return its context info.- Parameters:
downloadId-- Throws:
RegistryStorageException
-
deleteAllExpiredDownloads
void deleteAllExpiredDownloads() throws RegistryStorageExceptionCalled to delete any expired rows in the downloads table. This is basically cleaning up any single-use download links that were never "clicked".- Throws:
RegistryStorageException
-
-