Interface StoreDataManager


  • public interface StoreDataManager
    Data manager used to access and manipulate the configurations for ArtifactStore instances.
    Author:
    jdcasey
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String AFFECTED_GROUPS
      We calculate and pass the affected groups through different modules, e.g, in case of promotion.
      static String CHANGE_SUMMARY
      Need to store change summary for repository change processing
      static String EVENT_ORIGIN  
      static String IGNORE_READONLY
      We need to modify the way Indy processes the readonly flag on repositories.
      static String TARGET_STORE
      We 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.
      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.
      void clear​(ChangeSummary summary)
      Delete all ArtifactStore instances currently in the system.
      void deleteArtifactStore​(org.commonjava.indy.model.core.StoreKey key, ChangeSummary summary, org.commonjava.maven.galley.event.EventMetadata eventMetadata)
      Delete the ArtifactStore corresponding to the given StoreKey.
      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 consideration
      org.commonjava.indy.model.core.ArtifactStore getArtifactStore​(org.commonjava.indy.model.core.StoreKey key)
      Return the ArtifactStore instance corresponding to the given key, where key is a composite of StoreType (hosted, remote, or group) and name.
      Map<org.commonjava.indy.model.core.StoreKey,​org.commonjava.indy.model.core.ArtifactStore> getArtifactStoresByKey()
      Return a mapping of ArtifactStore's keyed by the corresponding StoreKey.
      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)  
      boolean hasArtifactStore​(org.commonjava.indy.model.core.StoreKey key)
      Return true if the system contains a ArtifactStore with the given key (combination of StoreType and name); false otherwise.
      void install()
      If no ArtifactStore's exist in the system, install a couple of defaults: Remote central pointing to the Maven central repository at http://repo.maven.apache.org/maven2/ Hosted local-deployments that can host both releases and snapshots Group public containing central and local-deployments as members
      boolean isEmpty()  
      boolean isReadonly​(org.commonjava.indy.model.core.ArtifactStore store)
      Check if store is a readonly hosted repository.
      boolean isStarted()
      Return true once any post-construction code runs.
      ArtifactStoreQuery<org.commonjava.indy.model.core.ArtifactStore> query()  
      void reload()
      Mechanism for clearing all cached ArtifactStore instances and reloading them from some backing store.
      boolean storeArtifactStore​(org.commonjava.indy.model.core.ArtifactStore store, ChangeSummary summary, boolean skipIfExists, boolean fireEvents, org.commonjava.maven.galley.event.EventMetadata eventMetadata)
      Store a modified or new ArtifactStore instance.
      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

      • 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

      • hasArtifactStore

        boolean hasArtifactStore​(org.commonjava.indy.model.core.StoreKey key)
        Return true if the system contains a ArtifactStore with the given key (combination of StoreType and name); false otherwise.
      • getArtifactStore

        org.commonjava.indy.model.core.ArtifactStore getArtifactStore​(org.commonjava.indy.model.core.StoreKey key)
                                                               throws IndyDataException
        Return the ArtifactStore instance corresponding to the given key, where key is a composite of StoreType (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 consideration
        Return the full list of ArtifactStore instances of a given StoreType (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 consideration
        Return the ArtifactStore instances as a Stream.
        Throws:
        IndyDataException
      • getArtifactStoresByKey

        Map<org.commonjava.indy.model.core.StoreKey,​org.commonjava.indy.model.core.ArtifactStore> getArtifactStoresByKey()
        Return a mapping of ArtifactStore's keyed by the corresponding StoreKey.
        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 IndyDataException
        Store a modified or new ArtifactStore instance. If the store already exists, and skipIfExists is 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 IndyDataException
        Delete the ArtifactStore corresponding to the given StoreKey. If the store doesn't exist, simply return (don't fail).
        Parameters:
        eventMetadata - TODO
        Throws:
        IndyDataException
      • install

        void install()
              throws IndyDataException
        If no ArtifactStore's exist in the system, install a couple of defaults:
        • Remote central pointing to the Maven central repository at http://repo.maven.apache.org/maven2/
        • Hosted local-deployments that can host both releases and snapshots
        • Group public containing central and local-deployments as members
        Throws:
        IndyDataException
      • reload

        void reload()
             throws IndyDataException
        Mechanism for clearing all cached ArtifactStore instances 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 readonly HostedRepository
      • isEmpty

        boolean isEmpty()
      • streamArtifactStoreKeys

        java.util.stream.Stream<org.commonjava.indy.model.core.StoreKey> streamArtifactStoreKeys()
        Stream of StoreKey instances present in the system.
      • getStoreKeysByPkg

        Set<org.commonjava.indy.model.core.StoreKey> getStoreKeysByPkg​(String pkg)
      • 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,
                                                             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)
      • filterAffectedGroups

        Set<org.commonjava.indy.model.core.Group> filterAffectedGroups​(Set<org.commonjava.indy.model.core.Group> affectedGroups)