aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-proxy-api
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-10-29 21:01:09 +0000
committerOlivier Lamy <olamy@apache.org>2012-10-29 21:01:09 +0000
commit6aed2d478125a20a6cd54e03d412613cd0a54c97 (patch)
treebef7902a1e83c15c71d6a12e7da74433b4d30123 /archiva-modules/archiva-base/archiva-proxy-api
parent6f95f668fcb8c766d83d0b5caa4a02d3e02d20a9 (diff)
downloadarchiva-6aed2d478125a20a6cd54e03d412613cd0a54c97.tar.gz
archiva-6aed2d478125a20a6cd54e03d412613cd0a54c97.zip
[MRM-1704] Refactor to remove maven specific part from various repository/metadata apis
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1403509 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy-api')
-rw-r--r--archiva-modules/archiva-base/archiva-proxy-api/pom.xml55
-rw-r--r--archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyConnectors.java91
2 files changed, 146 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy-api/pom.xml b/archiva-modules/archiva-base/archiva-proxy-api/pom.xml
new file mode 100644
index 000000000..f729a3946
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-proxy-api/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>archiva-base</artifactId>
+ <groupId>org.apache.archiva</groupId>
+ <version>1.4-M4-SNAPSHOT</version>
+ </parent>
+ <artifactId>archiva-proxy-api</artifactId>
+ <packaging>bundle</packaging>
+ <name>Archiva Base :: Proxy Api</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-layer</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>org.apache.archiva.proxy.model</Bundle-SymbolicName>
+ <Bundle-Version>${project.version}</Bundle-Version>
+ <Export-Package>
+ org.apache.archiva.proxy;version=${project.version}
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyConnectors.java
new file mode 100644
index 000000000..58a3aaf3a
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-proxy-api/src/main/java/org/apache/archiva/proxy/model/RepositoryProxyConnectors.java
@@ -0,0 +1,91 @@
+package org.apache.archiva.proxy.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.policies.ProxyDownloadException;
+import org.apache.archiva.repository.ManagedRepositoryContent;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Handler for potential repository proxy connectors.
+ *
+ *
+ */
+public interface RepositoryProxyConnectors
+{
+ /**
+ * Performs the artifact fetch operation against the target repositories
+ * of the provided source repository.
+ *
+ * If the artifact is found, it is downloaded and placed into the source repository
+ * filesystem.
+ *
+ * @param repository the source repository to use. (must be a managed repository)
+ * @param artifact the artifact to fetch.
+ * @return the file that was obtained, or null if no content was obtained
+ * @throws ProxyDownloadException if there was a problem fetching the content from the target repositories.
+ */
+ public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact )
+ throws ProxyDownloadException;
+
+ /**
+ * Performs the metadata fetch operation against the target repositories
+ * of the provided source repository.
+ *
+ * If the metadata is found, it is downloaded and placed into the source repository
+ * filesystem.
+ *
+ * @param repository the source repository to use. (must be a managed repository)
+ * @param logicalPath the metadata to fetch.
+ * @return the file that was obtained, or null if no content was obtained
+ */
+ public File fetchMetatadaFromProxies( ManagedRepositoryContent repository, String logicalPath );
+
+ /**
+ * Performs the fetch operation against the target repositories
+ * of the provided source repository.
+ *
+ * @param managedRepository the source repository to use. (must be a managed repository)
+ * @param path the path of the resource to fetch
+ * @return the file that was obtained, or null if no content was obtained
+ */
+ public File fetchFromProxies( ManagedRepositoryContent managedRepository, String path );
+
+ /**
+ * Get the List of {@link ProxyConnector} objects of the source repository.
+ *
+ * @param repository the source repository to look for.
+ * @return the List of {@link ProxyConnector} objects.
+ */
+ public List<ProxyConnector> getProxyConnectors( ManagedRepositoryContent repository );
+
+ /**
+ * Tests to see if the provided repository is a source repository for
+ * any {@link ProxyConnector} objects.
+ *
+ * @param repository the source repository to look for.
+ * @return true if there are proxy connectors that use the provided
+ * repository as a source repository.
+ */
+ public boolean hasProxies( ManagedRepositoryContent repository );
+}