org.apache.maven.archiva.proxy
Class DefaultRepositoryProxyConnectors

Package class diagram package DefaultRepositoryProxyConnectors
java.lang.Object
  extended by org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors
All Implemented Interfaces:
RepositoryProxyConnectors, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.registry.RegistryListener

public class DefaultRepositoryProxyConnectors
extends java.lang.Object
implements RepositoryProxyConnectors, org.codehaus.plexus.registry.RegistryListener, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

DefaultRepositoryProxyConnectors


Constructor Summary
DefaultRepositoryProxyConnectors()
           
 
Method Summary
 void afterConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
           
 void beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry, java.lang.String propertyName, java.lang.Object propertyValue)
           
 java.io.File fetchFromProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository, org.apache.maven.archiva.model.ArtifactReference artifact)
          Fetch an artifact from a remote repository.
 java.io.File fetchFromProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository, org.apache.maven.archiva.model.ProjectReference metadata)
          Fetch from the proxies a metadata.xml file for the groupId:artifactId metadata contents.
 java.io.File fetchFromProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository, org.apache.maven.archiva.model.VersionedReference metadata)
          Fetch, from the proxies, a metadata.xml file for the groupId:artifactId:version metadata contents.
 java.util.List<ProxyConnector> getProxyConnectors(org.apache.maven.archiva.repository.ManagedRepositoryContent repository)
          TODO: Ensure that list is correctly ordered based on configuration.
 boolean hasProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository)
          Test if the provided ManagedRepositoryContent has any proxies configured for it.
 void initialize()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRepositoryProxyConnectors

public DefaultRepositoryProxyConnectors()
Method Detail

fetchFromProxies

public java.io.File fetchFromProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository,
                                     org.apache.maven.archiva.model.ArtifactReference artifact)
                              throws org.apache.maven.archiva.policies.ProxyDownloadException
Fetch an artifact from a remote repository.

Specified by:
fetchFromProxies in interface RepositoryProxyConnectors
Parameters:
repository - the managed repository to utilize for the request.
artifact - the artifact reference to fetch.
Returns:
the local file in the managed repository that was fetched, or null if the artifact was not (or could not be) fetched.
Throws:
org.apache.maven.archiva.policies.PolicyViolationException - if there was a problem fetching the artifact.
org.apache.maven.archiva.policies.ProxyDownloadException - if there was a problem fetching the content from the target repositories.

fetchFromProxies

public java.io.File fetchFromProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository,
                                     org.apache.maven.archiva.model.VersionedReference metadata)
Fetch, from the proxies, a metadata.xml file for the groupId:artifactId:version metadata contents.

Specified by:
fetchFromProxies in interface RepositoryProxyConnectors
Parameters:
repository - the source repository to use. (must be a managed repository)
metadata - the metadata to fetch.
Returns:
the (local) metadata file that was fetched/merged/updated, or null if no metadata file exists.

fetchFromProxies

public java.io.File fetchFromProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository,
                                     org.apache.maven.archiva.model.ProjectReference metadata)
Fetch from the proxies a metadata.xml file for the groupId:artifactId metadata contents.

Specified by:
fetchFromProxies in interface RepositoryProxyConnectors
Parameters:
repository - the source repository to use. (must be a managed repository)
metadata - the metadata to fetch.
Returns:
the (local) metadata file that was fetched/merged/updated, or null if no metadata file exists.
Throws:
ProxyException - if there was a problem fetching the metadata file.

hasProxies

public boolean hasProxies(org.apache.maven.archiva.repository.ManagedRepositoryContent repository)
Test if the provided ManagedRepositoryContent has any proxies configured for it.

Specified by:
hasProxies in interface RepositoryProxyConnectors
Parameters:
repository - the source repository to look for.
Returns:
true if there are proxy connectors that use the provided repository as a source repository.

getProxyConnectors

public java.util.List<ProxyConnector> getProxyConnectors(org.apache.maven.archiva.repository.ManagedRepositoryContent repository)
TODO: Ensure that list is correctly ordered based on configuration. See MRM-477

Specified by:
getProxyConnectors in interface RepositoryProxyConnectors
Parameters:
repository - the source repository to look for.
Returns:
the List of ProxyConnector objects.

afterConfigurationChange

public void afterConfigurationChange(org.codehaus.plexus.registry.Registry registry,
                                     java.lang.String propertyName,
                                     java.lang.Object propertyValue)
Specified by:
afterConfigurationChange in interface org.codehaus.plexus.registry.RegistryListener

beforeConfigurationChange

public void beforeConfigurationChange(org.codehaus.plexus.registry.Registry registry,
                                      java.lang.String propertyName,
                                      java.lang.Object propertyValue)
Specified by:
beforeConfigurationChange in interface org.codehaus.plexus.registry.RegistryListener

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException