public interface RepositoryProxyHandler
ProxyConnector
each defines a one-to-one relationship.
A proxy connector defines specifics about the download behaviour:
Policy
define the behaviour for different cases (errors, not available, caching lifetime).ProxyConnector
There may be network proxies needed to connect the remote repositories.Modifier and Type | Method and Description |
---|---|
void |
addNetworkproxy(String id,
NetworkProxy networkProxy)
Adds a network proxy that is used to access the remote repository.
|
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 managedRepository,
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.
|
<T extends RepositoryProxyHandler> |
getHandler(Class<T> clazz)
Returns the proxy handler implementation.
|
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.
|
List<ProxyConnector> |
getProxyConnectors(ManagedRepository repository)
Get the List of
ProxyConnector objects of the source repository. |
boolean |
hasProxies(ManagedRepository repository)
Tests to see if the provided repository is a source repository for
any
ProxyConnector objects. |
void |
removePolicy(Policy policy)
Removes a policy
|
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 |
setProxyConnectors(List<ProxyConnector> proxyConnectors) |
List<RepositoryType> |
supports() |
List<RepositoryType> supports()
StorageAsset fetchFromProxies(ManagedRepository repository, ArtifactReference artifact) throws ProxyDownloadException
If the artifact is found, it is downloaded and placed into the source repository filesystem.
repository
- 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.ProxyFetchResult fetchMetadataFromProxies(ManagedRepository repository, String logicalPath)
If the metadata is found, it is downloaded and placed into the source repository filesystem.
repository
- the source repository to use. (must be a managed repository)logicalPath
- the metadata to fetch.StorageAsset fetchFromProxies(ManagedRepository managedRepository, String path)
managedRepository
- the source repository to use. (must be a managed repository)path
- the path of the resource to fetchList<ProxyConnector> getProxyConnectors(ManagedRepository repository)
ProxyConnector
objects of the source repository.repository
- the source repository to look for.ProxyConnector
objects.boolean hasProxies(ManagedRepository repository)
ProxyConnector
objects.repository
- the source repository to look for.void setNetworkProxies(Map<String,NetworkProxy> networkProxies)
networkProxies
- A map of (repository id, network proxy) where the repository id must be the id of an
existing remote repository.void addNetworkproxy(String id, NetworkProxy networkProxy)
id
- The repository idnetworkProxy
- The network proxy to useMap<String,NetworkProxy> getNetworkProxies()
NetworkProxy getNetworkProxy(String id)
id
- The remote repository idnull
if no one is defined for this id.<T extends RepositoryProxyHandler> T getHandler(Class<T> clazz) throws IllegalArgumentException
T
- The typeclazz
- The class to convert toIllegalArgumentException
void setPolicies(List<Policy> policyList)
policyList
- void removePolicy(Policy policy)
policy
- void addProxyConnector(ProxyConnector connector)
void setProxyConnectors(List<ProxyConnector> proxyConnectors)
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.