aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-proxy/src/site
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2006-08-26 05:47:59 +0000
committerBrett Porter <brett@apache.org>2006-08-26 05:47:59 +0000
commit209ef5ca84ee8de9e5ee61952e0d380749c3074b (patch)
tree1f64a28aa8f3bfab1ab17cb8715fe6eb0485391e /archiva-proxy/src/site
parent72cbf8748f2f0cb7dad3b45cd5668461aa4a76b2 (diff)
downloadarchiva-209ef5ca84ee8de9e5ee61952e0d380749c3074b.tar.gz
archiva-209ef5ca84ee8de9e5ee61952e0d380749c3074b.zip
rename archiva artifacts
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@437088 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-proxy/src/site')
-rw-r--r--archiva-proxy/src/site/apt/how-to.apt73
1 files changed, 73 insertions, 0 deletions
diff --git a/archiva-proxy/src/site/apt/how-to.apt b/archiva-proxy/src/site/apt/how-to.apt
new file mode 100644
index 000000000..14cf1ef4b
--- /dev/null
+++ b/archiva-proxy/src/site/apt/how-to.apt
@@ -0,0 +1,73 @@
+ProxyManager
+
+ The ProxyManager is designed to be used as a simple object or bean for use by
+ a command-line application or web application.
+
+Configuration
+
+ An instance of a ProxyManager requires a configuration object that will
+ define its behavior called ProxyConfiguration. The ProxyConfiguration is a
+ plexus component and can be looked up to get an instance of it. Below is a sample
+ plexus lookup statement:
+
+----------
+ ProxyConfiguration config = (ProxyConfiguration) container.lookup( ProxyConfiguration.ROLE );
+----------
+
+ Currently, a ProxyConfiguration lookup will return an empty instance of the
+ ProxyConfiguration which means it doesn't have any default definitions yet on
+ how the ProxyManager should behave. So the next step is to explicitly define
+ its behavior.
+
+----------
+ ProxyConfiguration config = (ProxyConfiguration) container.lookup( ProxyConfiguration.ROLE );
+
+ config.setRepositoryCachePath( "/user/proxy-cache" );
+
+ ArtifactRepositoryLayout defLayout = new DefaultRepositoryLayout();
+
+ File repo1File = new File( "src/test/remote-repo1" );
+
+ ProxyRepository repo1 = new ProxyRepository( "central", "http://www.ibiblio.org/maven2", defLayout );
+
+ config.addRepository( repo1 );
+----------
+
+ The above statements sets up the ProxyConfiguration to use the directory
+ <<</user/proxy-cache>>> as the location of the proxy's repository cache.
+ Then it creates a ProxyRepository instance with an id of <<<central>>> to
+ look for remote files in ibiblio.org.
+
+Instantiation
+
+ To create or retrieve an instance of a ProxyManager, one will need to use the
+ ProxyManagerFactory.
+
+----------
+ ProxyManagerFactory factory = (ProxyManagerFactory) container.lookup( ProxyManagerFactory.ROLE );
+ proxy = factory.getProxyManager( "default", config );
+----------
+
+ The factory requires two parameters. The first parameter is the proxy_type
+ that you will want to use. And the second parameter is the ProxyConfiguration
+ which we already did above. The proxy_type defines the client that the
+ ProxyManager is expected to service. Currently, only <<<default>>>
+ ProxyManager type is available and is defined to be for Maven 2.x clients.
+
+Usage
+
+* The get() method
+
+ The ProxyManager get( target ) method is used to retrieve a path file. This
+ method first looks into the cache if the target exists. If it does not, then
+ the ProxyManager will search all the ProxyRepositories present in its
+ ProxyConfiguration. When the target path is found, the ProxyManager creates
+ a copy of it in its cache and returns a File instance of the cached copy.
+
+* The getRemoteFile() method
+
+ The ProxyManager getRemoteFile( path ) method is used to force the
+ ProxyManager to ignore the contents of its cache and search all the
+ ProxyRepository objects for the specified path and retrieve it when
+ available. When successful, the ProxyManager creates a copy of the remote
+ file in its cache and then returns a File instance of the cached copy. \ No newline at end of file