public abstract class AbstractMapRegistryStorage extends Object implements RegistryStorage
Modifier and Type | Field and Description |
---|---|
protected Map<String,Map<String,String>> |
artifactRules |
protected ContentCanonicalizerFactory |
ccFactory |
protected Map<Long,Map<String,String>> |
global |
protected Map<String,String> |
globalRules |
protected Map<String,Map<Long,Map<String,String>>> |
storage |
Constructor and Description |
---|
AbstractMapRegistryStorage() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterInit() |
CompletionStage<ArtifactMetaDataDto> |
createArtifact(String artifactId,
ArtifactType artifactType,
ContentHandle content)
Creates a new artifact (from the given value) in the storage.
|
void |
createArtifactRule(String artifactId,
RuleType rule,
RuleConfigurationDto config)
Creates an artifact rule for a specific Artifact.
|
protected abstract Map<String,Map<String,String>> |
createArtifactRulesMap() |
protected abstract Map<Long,Map<String,String>> |
createGlobalMap() |
void |
createGlobalRule(RuleType rule,
RuleConfigurationDto config)
Creates a single global rule.
|
protected abstract Map<String,String> |
createGlobalRulesMap() |
protected ArtifactMetaDataDto |
createOrUpdateArtifact(String artifactId,
ArtifactType artifactType,
ContentHandle content,
boolean create,
long globalId) |
protected abstract Map<String,Map<Long,Map<String,String>>> |
createStorageMap() |
SortedSet<Long> |
deleteArtifact(String artifactId)
Deletes an artifact by its unique id.
|
void |
deleteArtifactRule(String artifactId,
RuleType rule)
Deletes a single stored/configured rule for a given artifact.
|
void |
deleteArtifactRules(String artifactId)
Deletes all rules stored/configured for the artifact.
|
void |
deleteArtifactVersion(String artifactId,
long version)
Deletes a single version of a given artifact.
|
void |
deleteArtifactVersionMetaData(String artifactId,
long 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.
|
StoredArtifact |
getArtifact(String artifactId)
Gets the most recent version of the value of the artifact with the given ID.
|
Set<String> |
getArtifactIds()
Get all artifact ids.
|
ArtifactMetaDataDto |
getArtifactMetaData(long id)
Gets the stored meta-data for an artifact by global ID.
|
ArtifactMetaDataDto |
getArtifactMetaData(String artifactId)
Gets the stored meta-data for an artifact by ID.
|
ArtifactMetaDataDto |
getArtifactMetaData(String artifactId,
ContentHandle content)
Gets the metadata of the version that matches content, or 404
|
RuleConfigurationDto |
getArtifactRule(String artifactId,
RuleType rule)
Gets all of the information for a single rule configured on a given artifact.
|
List<RuleType> |
getArtifactRules(String artifactId)
Gets a list of rules configured for a specific Artifact (by ID).
|
StoredArtifact |
getArtifactVersion(long id)
Gets the most recent version of the content of the artifact with the given global ID.
|
StoredArtifact |
getArtifactVersion(String artifactId,
long version)
Gets the stored value for a single version of a given artifact.
|
ArtifactVersionMetaDataDto |
getArtifactVersionMetaData(String artifactId,
long version)
Gets the stored meta-data for a single version of an artifact.
|
SortedSet<Long> |
getArtifactVersions(String artifactId)
Gets a sorted set of all artifact versions that exist for a given artifact.
|
protected Map<String,String> |
getContentMap(long id) |
RuleConfigurationDto |
getGlobalRule(RuleType rule)
Gets all information about a single global rule.
|
List<RuleType> |
getGlobalRules()
Gets a list of all global rule names.
|
void |
init() |
protected BiFunction<String,Map<Long,Map<String,String>>,Map<Long,Map<String,String>>> |
lookupFn() |
protected abstract long |
nextGlobalId() |
protected BiFunction<String,Map<String,String>,Map<String,String>> |
rulesLookupFn() |
static StoredArtifact |
toStoredArtifact(Map<String,String> content) |
CompletionStage<ArtifactMetaDataDto> |
updateArtifact(String artifactId,
ArtifactType artifactType,
ContentHandle content)
Updates the artifact value by storing the given value as a new version of the artifact.
|
void |
updateArtifactMetaData(String artifactId,
EditableArtifactMetaDataDto metaData)
Updates the stored meta-data for an artifact by ID.
|
void |
updateArtifactRule(String artifactId,
RuleType rule,
RuleConfigurationDto config)
Updates the configuration information for a single rule on a given artifact.
|
void |
updateArtifactState(String artifactId,
ArtifactState state)
Update artifact state.
|
void |
updateArtifactState(String artifactId,
ArtifactState state,
Integer version)
Update artifact state.
|
void |
updateArtifactVersionMetaData(String artifactId,
long version,
EditableArtifactMetaDataDto metaData)
Updates the user-editable meta-data for a single version of a given artifact.
|
void |
updateGlobalRule(RuleType rule,
RuleConfigurationDto config)
Updates the configuration settings for a single global rule.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isAlive, isReady
@Inject protected ContentCanonicalizerFactory ccFactory
@PostConstruct public void init()
protected void afterInit()
protected abstract long nextGlobalId()
public static StoredArtifact toStoredArtifact(Map<String,String> content)
protected BiFunction<String,Map<Long,Map<String,String>>,Map<Long,Map<String,String>>> lookupFn()
protected ArtifactMetaDataDto createOrUpdateArtifact(String artifactId, ArtifactType artifactType, ContentHandle content, boolean create, long globalId) throws ArtifactAlreadyExistsException, ArtifactNotFoundException, RegistryStorageException
public void updateArtifactState(String artifactId, ArtifactState state)
RegistryStorage
updateArtifactState
in interface RegistryStorage
public void updateArtifactState(String artifactId, ArtifactState state, Integer version)
RegistryStorage
updateArtifactState
in interface RegistryStorage
public CompletionStage<ArtifactMetaDataDto> createArtifact(String artifactId, ArtifactType artifactType, ContentHandle content) throws ArtifactAlreadyExistsException, RegistryStorageException
RegistryStorage
createArtifact
in interface RegistryStorage
ArtifactAlreadyExistsException
RegistryStorageException
RegistryStorage.createArtifact(java.lang.String, ArtifactType, ContentHandle)
public SortedSet<Long> deleteArtifact(String artifactId) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
deleteArtifact
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.deleteArtifact(java.lang.String)
public StoredArtifact getArtifact(String artifactId) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
getArtifact
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.getArtifact(java.lang.String)
public CompletionStage<ArtifactMetaDataDto> updateArtifact(String artifactId, ArtifactType artifactType, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
updateArtifact
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.updateArtifact(java.lang.String, ArtifactType, ContentHandle)
public Set<String> getArtifactIds()
RegistryStorage
getArtifactIds
in interface RegistryStorage
RegistryStorage.getArtifactIds()
public ArtifactMetaDataDto getArtifactMetaData(String artifactId) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
getArtifactMetaData
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.getArtifactMetaData(java.lang.String)
public ArtifactMetaDataDto getArtifactMetaData(String artifactId, ContentHandle content) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
getArtifactMetaData
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
public ArtifactMetaDataDto getArtifactMetaData(long id) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
getArtifactMetaData
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
public void updateArtifactMetaData(String artifactId, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
public List<RuleType> getArtifactRules(String artifactId) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
getArtifactRules
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.getArtifactRules(java.lang.String)
public void createArtifactRule(String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleAlreadyExistsException, RegistryStorageException
RegistryStorage
public void deleteArtifactRules(String artifactId) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
deleteArtifactRules
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.deleteArtifactRules(java.lang.String)
public RuleConfigurationDto getArtifactRule(String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
RegistryStorage
getArtifactRule
in interface RegistryStorage
ArtifactNotFoundException
RuleNotFoundException
RegistryStorageException
RegistryStorage.getArtifactRule(java.lang.String, io.apicurio.registry.types.RuleType)
public void updateArtifactRule(String artifactId, RuleType rule, RuleConfigurationDto config) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
RegistryStorage
public void deleteArtifactRule(String artifactId, RuleType rule) throws ArtifactNotFoundException, RuleNotFoundException, RegistryStorageException
RegistryStorage
deleteArtifactRule
in interface RegistryStorage
ArtifactNotFoundException
RuleNotFoundException
RegistryStorageException
RegistryStorage.deleteArtifactRule(java.lang.String, io.apicurio.registry.types.RuleType)
public SortedSet<Long> getArtifactVersions(String artifactId) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
getArtifactVersions
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.getArtifactVersions(java.lang.String)
public StoredArtifact getArtifactVersion(long id) throws ArtifactNotFoundException, RegistryStorageException
RegistryStorage
getArtifactVersion
in interface RegistryStorage
ArtifactNotFoundException
RegistryStorageException
RegistryStorage.getArtifactVersion(long)
public StoredArtifact getArtifactVersion(String artifactId, long version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
RegistryStorage
getArtifactVersion
in interface RegistryStorage
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
RegistryStorage.getArtifactVersion(java.lang.String, long)
public void deleteArtifactVersion(String artifactId, long version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
RegistryStorage
deleteArtifactVersion
in interface RegistryStorage
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
RegistryStorage.deleteArtifactVersion(java.lang.String, long)
public ArtifactVersionMetaDataDto getArtifactVersionMetaData(String artifactId, long version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
RegistryStorage
getArtifactVersionMetaData
in interface RegistryStorage
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
RegistryStorage.getArtifactVersionMetaData(java.lang.String, long)
public void updateArtifactVersionMetaData(String artifactId, long version, EditableArtifactMetaDataDto metaData) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
RegistryStorage
public void deleteArtifactVersionMetaData(String artifactId, long version) throws ArtifactNotFoundException, VersionNotFoundException, RegistryStorageException
RegistryStorage
deleteArtifactVersionMetaData
in interface RegistryStorage
ArtifactNotFoundException
VersionNotFoundException
RegistryStorageException
RegistryStorage.deleteArtifactVersionMetaData(java.lang.String, long)
public List<RuleType> getGlobalRules() throws RegistryStorageException
RegistryStorage
getGlobalRules
in interface RegistryStorage
RegistryStorageException
RegistryStorage.getGlobalRules()
public void createGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleAlreadyExistsException, RegistryStorageException
RegistryStorage
public void deleteGlobalRules() throws RegistryStorageException
RegistryStorage
deleteGlobalRules
in interface RegistryStorage
RegistryStorageException
RegistryStorage.deleteGlobalRules()
public RuleConfigurationDto getGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
RegistryStorage
getGlobalRule
in interface RegistryStorage
RuleNotFoundException
RegistryStorageException
RegistryStorage.getGlobalRule(io.apicurio.registry.types.RuleType)
public void updateGlobalRule(RuleType rule, RuleConfigurationDto config) throws RuleNotFoundException, RegistryStorageException
RegistryStorage
updateGlobalRule
in interface RegistryStorage
RuleNotFoundException
RegistryStorageException
RegistryStorage.updateGlobalRule(io.apicurio.registry.types.RuleType, io.apicurio.registry.storage.RuleConfigurationDto)
public void deleteGlobalRule(RuleType rule) throws RuleNotFoundException, RegistryStorageException
RegistryStorage
deleteGlobalRule
in interface RegistryStorage
RuleNotFoundException
RegistryStorageException
RegistryStorage.deleteGlobalRule(io.apicurio.registry.types.RuleType)
Copyright © 2020 Red Hat. All rights reserved.