Package org.commonjava.indy.data
Interface StoreDataManager
-
public interface StoreDataManagerData manager used to access and manipulate the configurations forArtifactStoreinstances.- Author:
- jdcasey
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classStoreDataManager.ContextualTask
-
Field Summary
Fields Modifier and Type Field Description static StringAFFECTED_GROUPSWe calculate and pass the affected groups through different modules, e.g, in case of promotion.static StringCHANGE_SUMMARYNeed to store change summary for repository change processingstatic StringEVENT_ORIGINstatic StringIGNORE_READONLYWe need to modify the way Indy processes the readonly flag on repositories.static StringTARGET_STOREWe pass the target store through different modules, e.g, in case of promotion.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Set<org.commonjava.indy.model.core.Group>affectedBy(Collection<org.commonjava.indy.model.core.StoreKey> keys)Set<org.commonjava.indy.model.core.Group>affectedBy(Collection<org.commonjava.indy.model.core.StoreKey> keys, org.commonjava.maven.galley.event.EventMetadata eventMetadata)Get affected-by groups from event metadata if provided.voidasyncGroupAffectedBy(StoreDataManager.ContextualTask contextualTask)This api is used for some time-sensitive tasks which should use getGroupsAffectedBy service, as this service is a little time-consuming now.voidclear(ChangeSummary summary)Delete allArtifactStoreinstances currently in the system.voiddeleteArtifactStore(org.commonjava.indy.model.core.StoreKey key, ChangeSummary summary, org.commonjava.maven.galley.event.EventMetadata eventMetadata)Delete theArtifactStorecorresponding to the givenStoreKey.Set<org.commonjava.indy.model.core.Group>filterAffectedGroups(Set<org.commonjava.indy.model.core.Group> affectedGroups)Set<org.commonjava.indy.model.core.ArtifactStore>getAllArtifactStores()Deprecated.We should avoid to call this method in new microservice architecture due to performance considerationorg.commonjava.indy.model.core.ArtifactStoregetArtifactStore(org.commonjava.indy.model.core.StoreKey key)Return theArtifactStoreinstance corresponding to the given key, where key is a composite ofStoreType(hosted, remote, or group) and name.Map<org.commonjava.indy.model.core.StoreKey,org.commonjava.indy.model.core.ArtifactStore>getArtifactStoresByKey()Return a mapping ofArtifactStore's keyed by the correspondingStoreKey.Set<org.commonjava.indy.model.core.ArtifactStore>getArtifactStoresByPkgAndType(String packageType, org.commonjava.indy.model.core.StoreType storeType)Set<org.commonjava.indy.model.core.StoreKey>getStoreKeysByPkg(String pkg)Set<org.commonjava.indy.model.core.StoreKey>getStoreKeysByPkgAndType(String pkg, org.commonjava.indy.model.core.StoreType type)booleanhasArtifactStore(org.commonjava.indy.model.core.StoreKey key)Return true if the system contains aArtifactStorewith the given key (combination ofStoreTypeand name); false otherwise.voidinstall()If noArtifactStore's exist in the system, install a couple of defaults: Remotecentralpointing to the Maven central repository at http://repo.maven.apache.org/maven2/ Hostedlocal-deploymentsthat can host both releases and snapshots Grouppubliccontainingcentralandlocal-deploymentsas membersbooleanisEmpty()booleanisReadonly(org.commonjava.indy.model.core.ArtifactStore store)Check if store is a readonly hosted repository.booleanisStarted()Return true once any post-construction code runs.ArtifactStoreQuery<org.commonjava.indy.model.core.ArtifactStore>query()voidreload()Mechanism for clearing all cachedArtifactStoreinstances and reloading them from some backing store.booleanstoreArtifactStore(org.commonjava.indy.model.core.ArtifactStore store, ChangeSummary summary, boolean skipIfExists, boolean fireEvents, org.commonjava.maven.galley.event.EventMetadata eventMetadata)Store a modified or newArtifactStoreinstance.java.util.stream.Stream<org.commonjava.indy.model.core.StoreKey>streamArtifactStoreKeys()Stream of StoreKey instances present in the system.java.util.stream.Stream<org.commonjava.indy.model.core.ArtifactStore>streamArtifactStores()Deprecated.We should avoid to call this method in new microservice architecture due to performance consideration
-
-
-
Field Detail
-
EVENT_ORIGIN
static final String EVENT_ORIGIN
- See Also:
- Constant Field Values
-
IGNORE_READONLY
static final String IGNORE_READONLY
We need to modify the way Indy processes the readonly flag on repositories. It should apply to user operations but NOT apply to workflow like promotion. Set it to true in EventMetadata to bypass the readonly check.- See Also:
- Constant Field Values
-
AFFECTED_GROUPS
static final String AFFECTED_GROUPS
We calculate and pass the affected groups through different modules, e.g, in case of promotion.- See Also:
- Constant Field Values
-
TARGET_STORE
static final String TARGET_STORE
We pass the target store through different modules, e.g, in case of promotion.- See Also:
- Constant Field Values
-
CHANGE_SUMMARY
static final String CHANGE_SUMMARY
Need to store change summary for repository change processing- See Also:
- Constant Field Values
-
-
Method Detail
-
query
ArtifactStoreQuery<org.commonjava.indy.model.core.ArtifactStore> query()
-
hasArtifactStore
boolean hasArtifactStore(org.commonjava.indy.model.core.StoreKey key)
Return true if the system contains aArtifactStorewith the given key (combination ofStoreTypeand name); false otherwise.
-
getArtifactStore
org.commonjava.indy.model.core.ArtifactStore getArtifactStore(org.commonjava.indy.model.core.StoreKey key) throws IndyDataExceptionReturn theArtifactStoreinstance corresponding to the given key, where key is a composite ofStoreType(hosted, remote, or group) and name.- Throws:
IndyDataException
-
getAllArtifactStores
@Deprecated Set<org.commonjava.indy.model.core.ArtifactStore> getAllArtifactStores() throws IndyDataException
Deprecated.We should avoid to call this method in new microservice architecture due to performance considerationReturn the full list ofArtifactStoreinstances of a givenStoreType(hosted, remote, or group) available on the system.- Throws:
IndyDataException
-
streamArtifactStores
@Deprecated java.util.stream.Stream<org.commonjava.indy.model.core.ArtifactStore> streamArtifactStores() throws IndyDataException
Deprecated.We should avoid to call this method in new microservice architecture due to performance considerationReturn theArtifactStoreinstances as aStream.- Throws:
IndyDataException
-
getArtifactStoresByKey
Map<org.commonjava.indy.model.core.StoreKey,org.commonjava.indy.model.core.ArtifactStore> getArtifactStoresByKey()
Return a mapping ofArtifactStore's keyed by the correspondingStoreKey.- Returns:
-
storeArtifactStore
boolean storeArtifactStore(org.commonjava.indy.model.core.ArtifactStore store, ChangeSummary summary, boolean skipIfExists, boolean fireEvents, org.commonjava.maven.galley.event.EventMetadata eventMetadata) throws IndyDataExceptionStore a modified or newArtifactStoreinstance. If the store already exists, andskipIfExistsis true, abort the operation.- Parameters:
eventMetadata- TODO- Throws:
IndyDataException
-
deleteArtifactStore
void deleteArtifactStore(org.commonjava.indy.model.core.StoreKey key, ChangeSummary summary, org.commonjava.maven.galley.event.EventMetadata eventMetadata) throws IndyDataExceptionDelete theArtifactStorecorresponding to the givenStoreKey. If the store doesn't exist, simply return (don't fail).- Parameters:
eventMetadata- TODO- Throws:
IndyDataException
-
clear
void clear(ChangeSummary summary) throws IndyDataException
Delete allArtifactStoreinstances currently in the system.- Throws:
IndyDataException
-
install
void install() throws IndyDataExceptionIf noArtifactStore's exist in the system, install a couple of defaults:- Remote
centralpointing to the Maven central repository at http://repo.maven.apache.org/maven2/ - Hosted
local-deploymentsthat can host both releases and snapshots - Group
publiccontainingcentralandlocal-deploymentsas members
- Throws:
IndyDataException
- Remote
-
reload
void reload() throws IndyDataExceptionMechanism for clearing all cachedArtifactStoreinstances and reloading them from some backing store.- Throws:
IndyDataException
-
isStarted
boolean isStarted()
Return true once any post-construction code runs.
-
isReadonly
boolean isReadonly(org.commonjava.indy.model.core.ArtifactStore store)
Check if store is a readonly hosted repository. Return true only when store is a readonlyHostedRepository
-
isEmpty
boolean isEmpty()
-
streamArtifactStoreKeys
java.util.stream.Stream<org.commonjava.indy.model.core.StoreKey> streamArtifactStoreKeys()
Stream of StoreKey instances present in the system.
-
getStoreKeysByPkgAndType
Set<org.commonjava.indy.model.core.StoreKey> getStoreKeysByPkgAndType(String pkg, org.commonjava.indy.model.core.StoreType type)
-
affectedBy
Set<org.commonjava.indy.model.core.Group> affectedBy(Collection<org.commonjava.indy.model.core.StoreKey> keys) throws IndyDataException
- Throws:
IndyDataException
-
affectedBy
Set<org.commonjava.indy.model.core.Group> affectedBy(Collection<org.commonjava.indy.model.core.StoreKey> keys, org.commonjava.maven.galley.event.EventMetadata eventMetadata) throws IndyDataException
Get affected-by groups from event metadata if provided.- Parameters:
keys-eventMetadata-- Throws:
IndyDataException
-
asyncGroupAffectedBy
void asyncGroupAffectedBy(StoreDataManager.ContextualTask contextualTask)
This api is used for some time-sensitive tasks which should use getGroupsAffectedBy service, as this service is a little time-consuming now.- Parameters:
contextualTask-
-
getArtifactStoresByPkgAndType
Set<org.commonjava.indy.model.core.ArtifactStore> getArtifactStoresByPkgAndType(String packageType, org.commonjava.indy.model.core.StoreType storeType)
-
-