public abstract class DefaultRepositoryProxyHandler extends Object implements RepositoryProxyHandler
| Modifier and Type | Field and Description | 
|---|---|
| protected org.slf4j.Logger | log | 
| protected UrlFailureCache | urlFailureCache | 
| Constructor and Description | 
|---|
| DefaultRepositoryProxyHandler() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected String | addParameters(String path,
             RemoteRepository remoteRepository) | 
| void | addPolicy(Policy policy)Adds a policy | 
| void | addProxyConnector(ProxyConnector connector) | 
| StorageAsset | fetchFromProxies(ManagedRepository repository,
                ArtifactReference artifact)Performs the artifact fetch operation against the target repositories
 of the provided source repository. | 
| StorageAsset | fetchFromProxies(ManagedRepository repository,
                String path)Performs the fetch operation against the target repositories
 of the provided source repository by a specific path. | 
| ProxyFetchResult | fetchMetadataFromProxies(ManagedRepository repository,
                        String logicalPath)Performs the metadata fetch operation against the target repositories
 of the provided source repository. | 
| Map<String,DownloadErrorPolicy> | getDownloadErrorPolicies() | 
| MetadataTools | getMetadataTools() | 
| Map<String,NetworkProxy> | getNetworkProxies()Returns a map of the defined network proxies, or a empty map, if no proxy is defined. | 
| NetworkProxy | getNetworkProxy(String id)Returns the network proxy that is defined for the given repository id. | 
| Map<String,PostDownloadPolicy> | getPostDownloadPolicies() | 
| Map<String,PreDownloadPolicy> | getPreDownloadPolicies() | 
| List<ProxyConnector> | getProxyConnectors(ManagedRepository repository)TODO: Ensure that list is correctly ordered based on configuration. | 
| UrlFailureCache | getUrlFailureCache() | 
| boolean | hasProxies(ManagedRepository repository)Test if the provided ManagedRepositoryContent has any proxies configured for it. | 
| void | initialize() | 
| void | removePolicy(Policy policy)Removes a policy | 
| void | setArchivaConfiguration(ArchivaConfiguration archivaConfiguration) | 
| void | setDownloadErrorPolicies(Map<String,DownloadErrorPolicy> downloadErrorPolicies) | 
| void | setMetadataTools(MetadataTools metadataTools) | 
| void | setNetworkProxies(Map<String,NetworkProxy> networkProxies)Sets network proxies (normally HTTP proxies) to access the remote repositories. | 
| void | setPolicies(List<Policy> policyList)Sets the policies that this handler should validate. | 
| void | setPostDownloadPolicies(Map<String,PostDownloadPolicy> postDownloadPolicies) | 
| void | setPreDownloadPolicies(Map<String,PreDownloadPolicy> preDownloadPolicies) | 
| void | setProxyConnectors(List<ProxyConnector> proxyConnectors) | 
| void | setUrlFailureCache(UrlFailureCache urlFailureCache) | 
| abstract List<RepositoryType> | supports() | 
| protected StorageAsset | transferFile(ProxyConnector connector,
            RemoteRepository remoteRepository,
            String remotePath,
            ManagedRepository repository,
            StorageAsset resource,
            Properties requestProperties,
            boolean executeConsumers)Perform the transfer of the file. | 
| protected abstract void | transferResources(ProxyConnector connector,
                 RemoteRepository remoteRepository,
                 StorageAsset tmpResource,
                 StorageAsset[] checksumFiles,
                 String url,
                 String remotePath,
                 StorageAsset resource,
                 Path workingDirectory,
                 ManagedRepository repository) | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNetworkproxy, getHandlerprotected org.slf4j.Logger log
@Inject protected UrlFailureCache urlFailureCache
public DefaultRepositoryProxyHandler()
@PostConstruct public void initialize()
public StorageAsset fetchFromProxies(ManagedRepository repository, ArtifactReference artifact) throws ProxyDownloadException
RepositoryProxyHandlerIf the artifact is found, it is downloaded and placed into the source repository filesystem.
fetchFromProxies in interface RepositoryProxyHandlerrepository - the source repository to use. (must be a managed repository)artifact - the artifact to fetch.ProxyDownloadException - if there was a problem fetching the content from the target repositories.public StorageAsset fetchFromProxies(ManagedRepository repository, String path)
RepositoryProxyHandlerfetchFromProxies in interface RepositoryProxyHandlerrepository - the source repository to use. (must be a managed repository)path - the path of the resource to fetchpublic ProxyFetchResult fetchMetadataFromProxies(ManagedRepository repository, String logicalPath)
RepositoryProxyHandlerIf the metadata is found, it is downloaded and placed into the source repository filesystem.
fetchMetadataFromProxies in interface RepositoryProxyHandlerrepository - the source repository to use. (must be a managed repository)logicalPath - the metadata to fetch.public boolean hasProxies(ManagedRepository repository)
hasProxies in interface RepositoryProxyHandlerrepository - protected StorageAsset transferFile(ProxyConnector connector, RemoteRepository remoteRepository, String remotePath, ManagedRepository repository, StorageAsset resource, Properties requestProperties, boolean executeConsumers) throws ProxyException, NotModifiedException
connector - the connector configuration to use.remoteRepository - the remote repository get the resource from.remotePath - the path in the remote repository to the resource to get.repository - the managed repository that will hold the fileresource - the path relative to the repository storage where the file should be downloaded torequestProperties - the request properties to utilize for policy handling.executeConsumers - whether to execute the consumers after proxyingNotFoundException - if the file was not found on the remote repository.NotModifiedException - if the localFile was present, and the resource was present on remote repository, but
                              the remote resource is not newer than the local File.ProxyException - if transfer was unsuccessful.protected abstract void transferResources(ProxyConnector connector, RemoteRepository remoteRepository, StorageAsset tmpResource, StorageAsset[] checksumFiles, String url, String remotePath, StorageAsset resource, Path workingDirectory, ManagedRepository repository) throws ProxyException
ProxyExceptionpublic List<ProxyConnector> getProxyConnectors(ManagedRepository repository)
getProxyConnectors in interface RepositoryProxyHandlerrepository - ProxyConnector objects.protected String addParameters(String path, RemoteRepository remoteRepository)
public void setArchivaConfiguration(ArchivaConfiguration archivaConfiguration)
public MetadataTools getMetadataTools()
public void setMetadataTools(MetadataTools metadataTools)
public UrlFailureCache getUrlFailureCache()
public void setUrlFailureCache(UrlFailureCache urlFailureCache)
public Map<String,PreDownloadPolicy> getPreDownloadPolicies()
public void setPreDownloadPolicies(Map<String,PreDownloadPolicy> preDownloadPolicies)
public Map<String,PostDownloadPolicy> getPostDownloadPolicies()
public void setPostDownloadPolicies(Map<String,PostDownloadPolicy> postDownloadPolicies)
public Map<String,DownloadErrorPolicy> getDownloadErrorPolicies()
public void setDownloadErrorPolicies(Map<String,DownloadErrorPolicy> downloadErrorPolicies)
public void setNetworkProxies(Map<String,NetworkProxy> networkProxies)
RepositoryProxyHandlersetNetworkProxies in interface RepositoryProxyHandlernetworkProxies - A map of (repository id, network proxy) where the repository id must be the id of an
                existing remote repository.public NetworkProxy getNetworkProxy(String id)
RepositoryProxyHandlergetNetworkProxy in interface RepositoryProxyHandlerid - The remote repository idnull if no one is defined for this id.public Map<String,NetworkProxy> getNetworkProxies()
RepositoryProxyHandlergetNetworkProxies in interface RepositoryProxyHandlerpublic abstract List<RepositoryType> supports()
supports in interface RepositoryProxyHandlerpublic void setPolicies(List<Policy> policyList)
RepositoryProxyHandlersetPolicies in interface RepositoryProxyHandlerpublic void addPolicy(Policy policy)
RepositoryProxyHandleraddPolicy in interface RepositoryProxyHandlerpublic void removePolicy(Policy policy)
RepositoryProxyHandlerremovePolicy in interface RepositoryProxyHandlerpublic void addProxyConnector(ProxyConnector connector)
addProxyConnector in interface RepositoryProxyHandlerpublic void setProxyConnectors(List<ProxyConnector> proxyConnectors)
setProxyConnectors in interface RepositoryProxyHandlerCopyright © 2006–2019 The Apache Software Foundation. All rights reserved.