Class CacheOnlyLocation

  • All Implemented Interfaces:
    KeyedLocation, org.commonjava.maven.galley.model.Location
    Direct Known Subclasses:
    GroupLocation

    public class CacheOnlyLocation
    extends Object
    implements KeyedLocation
    KeyedLocation implementation that only knows about locally hosted/cached content. During Galley's handling, it can be converted into other store-related KeyedLocation types, assuming it's not referencing a HostedRepository, via the IndyLocationExpander component.
    • Constructor Detail

      • CacheOnlyLocation

        public CacheOnlyLocation​(org.commonjava.indy.model.core.HostedRepository repo)
      • CacheOnlyLocation

        public CacheOnlyLocation​(org.commonjava.indy.model.core.StoreKey key,
                                 boolean isHosted,
                                 boolean isAllowReleases,
                                 boolean isAllowSnapshots,
                                 boolean isReadOnly)
      • CacheOnlyLocation

        public CacheOnlyLocation​(org.commonjava.indy.model.core.StoreKey key)
    • Method Detail

      • setReadonly

        public void setReadonly​(boolean isReadOnly)
        This is used to bypass the repo's readonly flag in case of internal workflow like promotion.
      • isHostedRepository

        public boolean isHostedRepository()
      • allowsPublishing

        public boolean allowsPublishing()
        Specified by:
        allowsPublishing in interface org.commonjava.maven.galley.model.Location
      • allowsStoring

        public boolean allowsStoring()
        Specified by:
        allowsStoring in interface org.commonjava.maven.galley.model.Location
      • allowsSnapshots

        public boolean allowsSnapshots()
        Specified by:
        allowsSnapshots in interface org.commonjava.maven.galley.model.Location
      • allowsReleases

        public boolean allowsReleases()
        Specified by:
        allowsReleases in interface org.commonjava.maven.galley.model.Location
      • allowsDeletion

        public boolean allowsDeletion()
        Specified by:
        allowsDeletion in interface org.commonjava.maven.galley.model.Location
      • getUri

        public String getUri()
        Specified by:
        getUri in interface org.commonjava.maven.galley.model.Location
      • getAttributes

        public Map<String,​Object> getAttributes()
        Specified by:
        getAttributes in interface org.commonjava.maven.galley.model.Location
      • getAttribute

        public <T> T getAttribute​(String key,
                                  Class<T> type)
        Specified by:
        getAttribute in interface org.commonjava.maven.galley.model.Location
      • getAttribute

        public <T> T getAttribute​(String key,
                                  Class<T> type,
                                  T defaultValue)
        Specified by:
        getAttribute in interface org.commonjava.maven.galley.model.Location
      • removeAttribute

        public Object removeAttribute​(String key)
        Specified by:
        removeAttribute in interface org.commonjava.maven.galley.model.Location
      • setAttribute

        public Object setAttribute​(String key,
                                   Object value)
        Specified by:
        setAttribute in interface org.commonjava.maven.galley.model.Location
      • getKey

        public org.commonjava.indy.model.core.StoreKey getKey()
        Specified by:
        getKey in interface KeyedLocation
      • allowsDownloading

        public boolean allowsDownloading()
        Specified by:
        allowsDownloading in interface org.commonjava.maven.galley.model.Location
      • getName

        public String getName()
        Specified by:
        getName in interface org.commonjava.maven.galley.model.Location
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface org.commonjava.maven.galley.model.Location
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface org.commonjava.maven.galley.model.Location
        Overrides:
        equals in class Object