Repository: archiva
Updated Branches:
  refs/heads/master c544376af -> 9cd3c6134


Moving repo features to API module


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/0ef19fe3
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/0ef19fe3
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/0ef19fe3

Branch: refs/heads/master
Commit: 0ef19fe33800beaa5640e88cdfd42ecf2ffa67c1
Parents: c544376
Author: Martin Stockhammer <[email protected]>
Authored: Tue Mar 27 07:31:04 2018 +0200
Committer: Martin Stockhammer <[email protected]>
Committed: Tue Mar 27 07:31:04 2018 +0200

----------------------------------------------------------------------
 .../archiva/indexer/ArchivaIndexManager.java    |   7 +
 .../archiva/indexer/GenericIndexManager.java    |  51 +++++++
 .../archiva/repository/RepositoryEvent.java     |  12 +-
 .../repository/features/AbstractFeature.java    |  66 +++++++++
 .../features/ArtifactCleanupFeature.java        | 102 ++++++++++++++
 .../repository/features/IndexCreationEvent.java |  36 +++++
 .../features/IndexCreationFeature.java          | 123 +++++++++++++++++
 .../repository/features/RemoteIndexFeature.java | 136 +++++++++++++++++++
 .../features/StagingRepositoryFeature.java      |  85 ++++++++++++
 .../repository/BasicManagedRepository.java      |   2 +-
 .../archiva/repository/RepositoryRegistry.java  |  58 ++++----
 .../repository/features/AbstractFeature.java    |  66 ---------
 .../features/ArtifactCleanupFeature.java        | 102 --------------
 .../repository/features/IndexCreationEvent.java |  35 -----
 .../features/IndexCreationFeature.java          | 112 ---------------
 .../repository/features/RemoteIndexFeature.java | 136 -------------------
 .../features/StagingRepositoryFeature.java      |  85 ------------
 .../mock/ArchivaIndexManagerMock.java           |   5 +
 18 files changed, 650 insertions(+), 569 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
index 63a8a92..5e64d23 100644
--- 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/ArchivaIndexManager.java
@@ -24,6 +24,7 @@ import org.apache.archiva.repository.RepositoryEventListener;
 import org.apache.archiva.repository.RepositoryType;
 
 import java.net.URI;
+import java.nio.file.Path;
 import java.util.Collection;
 
 public interface ArchivaIndexManager {
@@ -95,4 +96,10 @@ public interface ArchivaIndexManager {
      * @throws IndexCreationFailedException
      */
     ArchivaIndexingContext move(ArchivaIndexingContext context, Repository 
repo) throws IndexCreationFailedException;
+
+    /**
+     * Returns the local path where the index is stored.
+     * @return
+     */
+    public void updateLocalIndexPath(Repository repo);
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/GenericIndexManager.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/GenericIndexManager.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/GenericIndexManager.java
index 8d8072e..8a059f8 100644
--- 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/GenericIndexManager.java
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/indexer/GenericIndexManager.java
@@ -19,17 +19,29 @@ package org.apache.archiva.indexer;
  * under the License.
  */
 
+import org.apache.archiva.common.utils.PathUtil;
 import org.apache.archiva.repository.Repository;
 import org.apache.archiva.repository.RepositoryEvent;
 import org.apache.archiva.repository.RepositoryType;
+import org.apache.archiva.repository.features.IndexCreationFeature;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
+import java.io.IOException;
 import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.Collection;
 
 @Service("indexManager#none")
 public class GenericIndexManager implements ArchivaIndexManager {
 
+    private final Logger log = 
LoggerFactory.getLogger(GenericIndexManager.class);
+
+    public static final String DEFAULT_INDEXER_DIR = ".indexer";
+
     @Override
     public void pack(ArchivaIndexingContext context) {
 
@@ -75,4 +87,43 @@ public class GenericIndexManager implements 
ArchivaIndexManager {
         return null;
     }
 
+    @Override
+    public void updateLocalIndexPath(Repository repo) {
+        if (repo.supportsFeature(IndexCreationFeature.class)) {
+            IndexCreationFeature icf = 
repo.getFeature(IndexCreationFeature.class).get();
+            try {
+                icf.setLocalIndexPath(getIndexPath(repo));
+            } catch (IOException e) {
+                log.error("Could not set local index path for {}. New URI: 
{}", repo.getId(), icf.getIndexPath());
+            }
+        }
+    }
+
+    private Path getIndexPath(Repository repo) throws IOException {
+        IndexCreationFeature icf = 
repo.getFeature(IndexCreationFeature.class).get();
+        Path repoDir = repo.getLocalPath();
+        URI indexDir = icf.getIndexPath();
+        Path indexDirectory = null;
+        if ( ! StringUtils.isEmpty(indexDir.toString( ) ) )
+        {
+
+            indexDirectory = PathUtil.getPathFromUri( indexDir );
+            // not absolute so create it in repository directory
+            if ( !indexDirectory.isAbsolute( ) )
+            {
+                indexDirectory = repoDir.resolve( indexDirectory );
+            }
+        }
+        else
+        {
+            indexDirectory = repoDir.resolve( DEFAULT_INDEXER_DIR);
+        }
+
+        if ( !Files.exists( indexDirectory ) )
+        {
+            Files.createDirectories( indexDirectory );
+        }
+        return indexDirectory;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryEvent.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryEvent.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryEvent.java
index d8bdf95..8a9db88 100644
--- 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryEvent.java
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/RepositoryEvent.java
@@ -29,12 +29,12 @@ import java.time.LocalDateTime;
 public class RepositoryEvent<T> {
 
     final EventType type;
-    final String repo;
+    final Repository repo;
     final T value;
     final T oldValue;
     final LocalDateTime instant;
 
-    public RepositoryEvent(EventType type, String repo, T oldValue, T value) {
+    public RepositoryEvent(EventType type, Repository repo, T oldValue, T 
value) {
         this.type = type;
         this.repo = repo;
         this.value = value;
@@ -47,19 +47,19 @@ public class RepositoryEvent<T> {
     }
 
 
-    EventType getType() {
+    public EventType getType() {
         return type;
     };
 
-    String getRepositoryId() {
+    public Repository getRepository() {
         return repo;
     };
 
-    T getValue() {
+    public T getValue() {
         return value;
     }
 
-    T getOldValue() {
+    public T getOldValue() {
         return oldValue;
     }
 

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
new file mode 100644
index 0000000..2f5831f
--- /dev/null
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
@@ -0,0 +1,66 @@
+package org.apache.archiva.repository.features;
+
+/*
+ * 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.repository.RepositoryEvent;
+import org.apache.archiva.repository.RepositoryEventListener;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+public class AbstractFeature {
+    private List<RepositoryEventListener> listener = new ArrayList<>();
+
+    AbstractFeature() {
+
+    }
+
+    AbstractFeature(RepositoryEventListener listener) {
+        this.listener.add(listener);
+    }
+
+    AbstractFeature(Collection<RepositoryEventListener> listeners) {
+        this.listener.addAll(listeners);
+    }
+
+    public void addListener(RepositoryEventListener listener) {
+        if (!this.listener.contains(listener)) {
+            this.listener.add(listener);
+        }
+        this.listener.add(listener);
+    }
+
+    public void removeListener(RepositoryEventListener listener) {
+        this.listener.remove(listener);
+    }
+
+    public void clearListeners() {
+        this.listener.clear();
+    }
+
+    protected void raiseEvent(RepositoryEvent event) {
+        for(RepositoryEventListener listr : listener) {
+            listr.raise(event);
+        }
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
new file mode 100644
index 0000000..57c6830
--- /dev/null
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
@@ -0,0 +1,102 @@
+package org.apache.archiva.repository.features;
+
+/*
+ * 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 java.time.Period;
+
+/**
+ *
+ * This feature provides settings for artifact cleanup. This is meant mainly 
for snapshot artifacts,
+ * that should be deleted after a time period.
+ *
+ */
+public class ArtifactCleanupFeature implements 
RepositoryFeature<ArtifactCleanupFeature> {
+
+    private boolean deleteReleasedSnapshots = false;
+    private Period retentionPeriod = Period.ofDays(100);
+    private int retentionCount = 2;
+
+    public ArtifactCleanupFeature() {
+
+    }
+
+    public ArtifactCleanupFeature( boolean deleteReleasedSnapshots, Period 
retentionPeriod, int retentionCount) {
+        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
+        this.retentionPeriod = retentionPeriod;
+        this.retentionCount = retentionCount;
+    }
+
+    @Override
+    public ArtifactCleanupFeature get() {
+        return this;
+    }
+
+    /**
+     * Returns true, if snapshot artifacts should be deleted, when artifacts 
with release version
+     * exist in one of the managed repositories.
+     * @return True, if artifacts should be deleted after release, otherwise 
false.
+     */
+    public boolean isDeleteReleasedSnapshots() {
+        return deleteReleasedSnapshots;
+    }
+
+    /**
+     * Sets the flag for the deletion of released snapshot artifacts.
+     * @param deleteReleasedSnapshots
+     */
+    public void setDeleteReleasedSnapshots(boolean deleteReleasedSnapshots) {
+        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
+    }
+
+    /**
+     * Returns the amount of time after that, the (snapshot) artifacts can be 
deleted.
+     *
+     * @return The time period after that the artifacts can be deleted.
+     */
+    public Period getRetentionPeriod() {
+        return retentionPeriod;
+    }
+
+    /**
+     * Sets time period, after that artifacts can be deleted.
+     * @param retentionPeriod
+     */
+    public void setRetentionPeriod( Period retentionPeriod ) {
+        this.retentionPeriod = retentionPeriod;
+    }
+
+    /**
+     * Sets the number of (snapshot) artifacts that should be kept, even if 
they are older
+     * than the retention time.
+     * @return The number of artifacts for a version that should be kept
+     */
+    public int getRetentionCount() {
+        return retentionCount;
+    }
+
+    /**
+     * Sets the number of artifacts that should be kept and not be deleted.
+     *
+     * @param retentionCount
+     */
+    public void setRetentionCount(int retentionCount) {
+        this.retentionCount = retentionCount;
+    }
+}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
new file mode 100644
index 0000000..4c9dc8e
--- /dev/null
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
@@ -0,0 +1,36 @@
+package org.apache.archiva.repository.features;
+
+/*
+ * 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.repository.Repository;
+import org.apache.archiva.repository.RepositoryEvent;
+
+import java.net.URI;
+
+public class IndexCreationEvent extends RepositoryEvent<URI> {
+
+    public enum Index implements EventType {
+        URI_CHANGE
+    }
+
+    IndexCreationEvent(Repository repo, URI oldValue, URI value) {
+        super(Index.URI_CHANGE, repo, oldValue, value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
new file mode 100644
index 0000000..0aa44a2
--- /dev/null
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
@@ -0,0 +1,123 @@
+package org.apache.archiva.repository.features;
+
+/*
+ * 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.repository.Repository;
+import org.apache.archiva.repository.RepositoryEventListener;
+import org.apache.commons.lang.StringUtils;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.EventListener;
+import java.util.List;
+
+/**
+ *
+ * This feature provides some information about index creation.
+ *
+ */
+public class IndexCreationFeature extends AbstractFeature implements 
RepositoryFeature<IndexCreationFeature>{
+
+
+    private boolean skipPackedIndexCreation = false;
+
+    private URI indexPath;
+
+    private Path localIndexPath;
+
+    private Repository repo;
+
+    public IndexCreationFeature(Repository repoId, RepositoryEventListener 
listener) {
+        super(listener);
+        this.repo = repoId;
+        try
+        {
+            setIndexPath(new URI(".indexer"));
+        }
+        catch ( URISyntaxException e )
+        {
+            // This may not happen.
+            e.printStackTrace( );
+        }
+    }
+
+    public IndexCreationFeature(boolean skipPackedIndexCreation) {
+        this.skipPackedIndexCreation = skipPackedIndexCreation;
+    }
+
+    @Override
+    public IndexCreationFeature get() {
+        return this;
+    }
+
+    /**
+     * Returns true, if no packed index files should be created.
+     * @return True, if no packed index files are created, otherwise false.
+     */
+    public boolean isSkipPackedIndexCreation() {
+        return skipPackedIndexCreation;
+    }
+
+    /**
+     * Sets the flag for packed index creation.
+     *
+     * @param skipPackedIndexCreation
+     */
+    public void setSkipPackedIndexCreation(boolean skipPackedIndexCreation) {
+        this.skipPackedIndexCreation = skipPackedIndexCreation;
+    }
+
+    /**
+     * Returns the path that is used to store the index.
+     * @return the uri (may be relative or absolute)
+     */
+    public URI getIndexPath( )
+    {
+        return indexPath;
+    }
+
+    /**
+     * Sets the path that is used to store the index.
+     * @param indexPath the uri to the index path (may be relative)
+     */
+    public void setIndexPath( URI indexPath )
+    {
+        URI oldVal = this.indexPath;
+        this.indexPath = indexPath;
+        raiseEvent(new IndexCreationEvent(repo, oldVal, this.indexPath));
+
+    }
+
+
+    public boolean hasIndex() {
+        return this.indexPath!=null && !StringUtils.isEmpty( 
this.indexPath.getPath() );
+    }
+
+    public Path getLocalIndexPath() {
+        return localIndexPath;
+    }
+
+    public void setLocalIndexPath(Path localIndexPath) {
+        this.localIndexPath = localIndexPath;
+    }
+}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
new file mode 100644
index 0000000..dca455a
--- /dev/null
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
@@ -0,0 +1,136 @@
+package org.apache.archiva.repository.features;
+
+/*
+ * 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.commons.lang.StringUtils;
+
+import java.net.URI;
+import java.time.Duration;
+
+/**
+ * Feature for remote index download.
+ */
+public class RemoteIndexFeature implements 
RepositoryFeature<RemoteIndexFeature> {
+
+    private boolean downloadRemoteIndex = false;
+    private URI indexUri;
+    private boolean downloadRemoteIndexOnStartup = false;
+    private Duration downloadTimeout = Duration.ofSeconds( 600 );
+    private String proxyId = "";
+
+
+    @Override
+    public RemoteIndexFeature get() {
+        return this;
+    }
+
+    /**
+     * True, if the remote index should be downloaded.
+     * @return True if download, otherwise false.
+     */
+    public boolean isDownloadRemoteIndex() {
+        return downloadRemoteIndex;
+    }
+
+    public void setDownloadRemoteIndex(boolean downloadRemoteIndex) {
+        this.downloadRemoteIndex = downloadRemoteIndex;
+    }
+
+    /**
+     * The URI to access the remote index. May be a relative URI that is 
relative to the
+     * repository URI.
+     *
+     * @return
+     */
+    public URI getIndexUri() {
+        return indexUri;
+    }
+
+    /**
+     * Sets the URI to access the remote index. May be a relative URI that is 
relative to the
+     * repository URI. The allowed URI schemes are dependent on the repository 
type.
+     *
+     * @param indexUri The URI of the index
+     */
+    public void setIndexUri(URI indexUri) {
+        this.indexUri = indexUri;
+    }
+
+    /**
+     * Returns true, if the remote index should be downloaded on startup of 
the repository.
+     * @return true, if the index should be downloaded during startup, 
otherwise false.
+     */
+    public boolean isDownloadRemoteIndexOnStartup() {
+        return downloadRemoteIndexOnStartup;
+    }
+
+    /**
+     * Sets the flag for download of the remote repository index.
+     *
+     * @param downloadRemoteIndexOnStartup
+     */
+    public void setDownloadRemoteIndexOnStartup(boolean 
downloadRemoteIndexOnStartup) {
+        this.downloadRemoteIndexOnStartup = downloadRemoteIndexOnStartup;
+    }
+
+    /**
+     * Returns the timeout after that the remote index download is aborted.
+     * @return the time duration after that, the download is aborted.
+     */
+    public Duration getDownloadTimeout() {
+        return this.downloadTimeout;
+    }
+
+    /**
+     * Sets the timeout after that a remote index download will be aborted.
+     * @param timeout The duration
+     */
+    public void setDownloadTimeout(Duration timeout) {
+        this.downloadTimeout = timeout;
+    }
+
+    /**
+     * Returns the id of the proxy, that should be used to download the remote 
index.
+     * @return The proxy id
+     */
+    public String getProxyId( )
+    {
+        return proxyId;
+    }
+
+    /**
+     * Sets the id of the proxy that should be used to download the remote 
index.
+     * @param proxyId
+     */
+    public void setProxyId( String proxyId )
+    {
+        this.proxyId = proxyId;
+    }
+
+    /**
+     * Returns true, if there is a index available.
+     *
+     * @return
+     */
+    public boolean hasIndex() {
+        return this.indexUri!=null && !StringUtils.isEmpty( 
this.indexUri.getPath() );
+    }
+}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
new file mode 100644
index 0000000..3e4ba12
--- /dev/null
+++ 
b/archiva-modules/archiva-base/archiva-repository-api/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
@@ -0,0 +1,85 @@
+package org.apache.archiva.repository.features;
+
+/*
+ * 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.repository.ManagedRepository;
+
+/**
+ * This feature provides some information about staging repositories.
+ *
+ */
+public class StagingRepositoryFeature implements 
RepositoryFeature<StagingRepositoryFeature> {
+
+    public static final String STAGING_REPO_POSTFIX = "-stage";
+
+    private ManagedRepository stagingRepository = null;
+    private boolean stageRepoNeeded = false;
+
+    public StagingRepositoryFeature() {
+
+    }
+
+    public StagingRepositoryFeature(ManagedRepository stagingRepository, 
boolean stageRepoNeeded) {
+        this.stagingRepository = stagingRepository;
+        this.stageRepoNeeded = stageRepoNeeded;
+    }
+
+    @Override
+    public StagingRepositoryFeature get() {
+        return this;
+    }
+
+    /**
+     * Returns the staging repository, if it exists.
+     *
+     * @return The staging repository, null if not set.
+     *
+     */
+    public ManagedRepository getStagingRepository() {
+        return stagingRepository;
+    }
+
+    /**
+     * Sets the staging repository.
+     *
+     * @param stagingRepository
+     */
+    public void setStagingRepository(ManagedRepository stagingRepository) {
+        this.stagingRepository = stagingRepository;
+    }
+
+    /**
+     * Returns true, if a staging repository is needed by this repository.
+     * @return True, if staging repository is needed, otherwise false.
+     */
+    public boolean isStageRepoNeeded() {
+        return stageRepoNeeded;
+    }
+
+    /**
+     * Sets the flag for needed staging repository.
+     *
+     * @param stageRepoNeeded
+     */
+    public void setStageRepoNeeded(boolean stageRepoNeeded) {
+        this.stageRepoNeeded = stageRepoNeeded;
+    }
+}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java
index 8df9883..6aa2fe9 100644
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java
+++ 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/BasicManagedRepository.java
@@ -64,7 +64,7 @@ public class BasicManagedRepository extends 
AbstractManagedRepository
     }
 
     private void initFeatures() {
-        IndexCreationFeature indexCreationFeature = new 
IndexCreationFeature(this.getId(), this);
+        IndexCreationFeature indexCreationFeature = new 
IndexCreationFeature(this, this);
         addFeature( artifactCleanupFeature );
         addFeature( indexCreationFeature );
         addFeature( stagingRepositoryFeature );

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryRegistry.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryRegistry.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryRegistry.java
index 17a08f7..984a2f6 100644
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryRegistry.java
+++ 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/RepositoryRegistry.java
@@ -19,19 +19,14 @@ package org.apache.archiva.repository;
  * under the License.
  */
 
-import org.apache.archiva.configuration.ArchivaConfiguration;
-import org.apache.archiva.configuration.Configuration;
-import org.apache.archiva.configuration.ConfigurationEvent;
-import org.apache.archiva.configuration.ConfigurationListener;
-import org.apache.archiva.configuration.IndeterminateConfigurationException;
-import org.apache.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
+import org.apache.archiva.configuration.*;
 import org.apache.archiva.indexer.*;
+import org.apache.archiva.metadata.model.facets.AuditEvent;
 import org.apache.archiva.redback.components.registry.RegistryException;
-import org.apache.archiva.repository.features.ArtifactCleanupFeature;
 import org.apache.archiva.repository.features.IndexCreationEvent;
 import org.apache.archiva.repository.features.IndexCreationFeature;
 import org.apache.archiva.repository.features.StagingRepositoryFeature;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -40,7 +35,6 @@ import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Named;
-import java.io.IOException;
 import java.util.*;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.stream.Collectors;
@@ -239,6 +233,7 @@ public class RepositoryRegistry implements 
ConfigurationListener, RepositoryEven
             ArchivaIndexManager idxManager = 
getIndexManager(editableRepo.getType());
             try {
                 
editableRepo.setIndexingContext(idxManager.createContext(editableRepo));
+                idxManager.updateLocalIndexPath(editableRepo);
             } catch (IndexCreationFailedException e) {
                 throw new RepositoryException("Could not create index for 
repository "+editableRepo.getId()+": "+e.getMessage(),e);
             }
@@ -855,6 +850,21 @@ public class RepositoryRegistry implements 
ConfigurationListener, RepositoryEven
 
     }
 
+
+    private void doRemoveRepo(RemoteRepository repo, Configuration 
configuration) {
+            repo.close();
+            RemoteRepositoryConfiguration cfg = 
configuration.findRemoteRepositoryById(repo.getId());
+            if (cfg != null) {
+                configuration.removeRemoteRepository(cfg);
+            }
+            List<ProxyConnectorConfiguration> proxyConnectors = new 
ArrayList<>(configuration.getProxyConnectors());
+            for (ProxyConnectorConfiguration proxyConnector : proxyConnectors) 
{
+                if (StringUtils.equals(proxyConnector.getTargetRepoId(), 
repo.getId())) {
+                    configuration.removeProxyConnector(proxyConnector);
+                }
+            }
+    }
+
     /**
      * Removes the remote repository from the registry and configuration.
      * The change is saved to the configuration immediately.
@@ -864,23 +874,18 @@ public class RepositoryRegistry implements 
ConfigurationListener, RepositoryEven
      */
     public void removeRepository( RemoteRepository remoteRepository ) throws 
RepositoryException
     {
+
         final String id = remoteRepository.getId();
         RemoteRepository repo = getRemoteRepository( id );
         if (repo!=null) {
             rwLock.writeLock().lock();
             try {
                 repo = remoteRepositories.remove( id );
-
                 if (repo!=null) {
-                    repo.close();
                     Configuration configuration = 
getArchivaConfiguration().getConfiguration();
-                    RemoteRepositoryConfiguration cfg = 
configuration.findRemoteRepositoryById( id );
-                    if (cfg!=null) {
-                        configuration.removeRemoteRepository( cfg );
-                    }
+                    doRemoveRepo(repo, configuration);
                     getArchivaConfiguration().save( configuration );
                 }
-
             }
             catch ( RegistryException | IndeterminateConfigurationException e )
             {
@@ -904,11 +909,7 @@ public class RepositoryRegistry implements 
ConfigurationListener, RepositoryEven
             try {
                 repo = remoteRepositories.remove( id );
                 if (repo!=null) {
-                    repo.close();
-                    RemoteRepositoryConfiguration cfg = 
configuration.findRemoteRepositoryById( id );
-                    if (cfg!=null) {
-                        configuration.removeRemoteRepository( cfg );
-                    }
+                    doRemoveRepo(repo, configuration);
                 }
             } finally
             {
@@ -1017,13 +1018,18 @@ public class RepositoryRegistry implements 
ConfigurationListener, RepositoryEven
     @Override
     public <T> void raise(RepositoryEvent<T> event) {
         if (event.getType().equals(IndexCreationEvent.Index.URI_CHANGE)) {
-            if (managedRepositories.containsKey(event.getRepositoryId()) ||
-                    remoteRepositories.containsKey(event.getRepositoryId())) {
-                EditableRepository repo = (EditableRepository) 
getRepository(event.getRepositoryId());
+            if (managedRepositories.containsKey(event.getRepository().getId()) 
||
+                    
remoteRepositories.containsKey(event.getRepository().getId())) {
+                EditableRepository repo = (EditableRepository) 
event.getRepository();
                 if (repo != null && repo.getIndexingContext()!=null) {
                     try {
-                        ArchivaIndexingContext newCtx = 
getIndexManager(repo.getType()).move(repo.getIndexingContext(), repo);
-                        repo.setIndexingContext(newCtx);
+                        ArchivaIndexManager idxmgr = 
getIndexManager(repo.getType());
+                        if (idxmgr != null) {
+                            ArchivaIndexingContext newCtx = 
idxmgr.move(repo.getIndexingContext(), repo);
+                            repo.setIndexingContext(newCtx);
+                            idxmgr.updateLocalIndexPath(repo);
+                        }
+
                     } catch (IndexCreationFailedException e) {
                         log.error("Could not move index to new directory {}", 
e.getMessage(), e);
                     }

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
deleted file mode 100644
index 2f5831f..0000000
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/AbstractFeature.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.archiva.repository.features;
-
-/*
- * 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.repository.RepositoryEvent;
-import org.apache.archiva.repository.RepositoryEventListener;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public class AbstractFeature {
-    private List<RepositoryEventListener> listener = new ArrayList<>();
-
-    AbstractFeature() {
-
-    }
-
-    AbstractFeature(RepositoryEventListener listener) {
-        this.listener.add(listener);
-    }
-
-    AbstractFeature(Collection<RepositoryEventListener> listeners) {
-        this.listener.addAll(listeners);
-    }
-
-    public void addListener(RepositoryEventListener listener) {
-        if (!this.listener.contains(listener)) {
-            this.listener.add(listener);
-        }
-        this.listener.add(listener);
-    }
-
-    public void removeListener(RepositoryEventListener listener) {
-        this.listener.remove(listener);
-    }
-
-    public void clearListeners() {
-        this.listener.clear();
-    }
-
-    protected void raiseEvent(RepositoryEvent event) {
-        for(RepositoryEventListener listr : listener) {
-            listr.raise(event);
-        }
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
deleted file mode 100644
index 57c6830..0000000
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/ArtifactCleanupFeature.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.apache.archiva.repository.features;
-
-/*
- * 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 java.time.Period;
-
-/**
- *
- * This feature provides settings for artifact cleanup. This is meant mainly 
for snapshot artifacts,
- * that should be deleted after a time period.
- *
- */
-public class ArtifactCleanupFeature implements 
RepositoryFeature<ArtifactCleanupFeature> {
-
-    private boolean deleteReleasedSnapshots = false;
-    private Period retentionPeriod = Period.ofDays(100);
-    private int retentionCount = 2;
-
-    public ArtifactCleanupFeature() {
-
-    }
-
-    public ArtifactCleanupFeature( boolean deleteReleasedSnapshots, Period 
retentionPeriod, int retentionCount) {
-        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
-        this.retentionPeriod = retentionPeriod;
-        this.retentionCount = retentionCount;
-    }
-
-    @Override
-    public ArtifactCleanupFeature get() {
-        return this;
-    }
-
-    /**
-     * Returns true, if snapshot artifacts should be deleted, when artifacts 
with release version
-     * exist in one of the managed repositories.
-     * @return True, if artifacts should be deleted after release, otherwise 
false.
-     */
-    public boolean isDeleteReleasedSnapshots() {
-        return deleteReleasedSnapshots;
-    }
-
-    /**
-     * Sets the flag for the deletion of released snapshot artifacts.
-     * @param deleteReleasedSnapshots
-     */
-    public void setDeleteReleasedSnapshots(boolean deleteReleasedSnapshots) {
-        this.deleteReleasedSnapshots = deleteReleasedSnapshots;
-    }
-
-    /**
-     * Returns the amount of time after that, the (snapshot) artifacts can be 
deleted.
-     *
-     * @return The time period after that the artifacts can be deleted.
-     */
-    public Period getRetentionPeriod() {
-        return retentionPeriod;
-    }
-
-    /**
-     * Sets time period, after that artifacts can be deleted.
-     * @param retentionPeriod
-     */
-    public void setRetentionPeriod( Period retentionPeriod ) {
-        this.retentionPeriod = retentionPeriod;
-    }
-
-    /**
-     * Sets the number of (snapshot) artifacts that should be kept, even if 
they are older
-     * than the retention time.
-     * @return The number of artifacts for a version that should be kept
-     */
-    public int getRetentionCount() {
-        return retentionCount;
-    }
-
-    /**
-     * Sets the number of artifacts that should be kept and not be deleted.
-     *
-     * @param retentionCount
-     */
-    public void setRetentionCount(int retentionCount) {
-        this.retentionCount = retentionCount;
-    }
-}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
deleted file mode 100644
index f871dc9..0000000
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.archiva.repository.features;
-
-/*
- * 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.repository.RepositoryEvent;
-
-import java.net.URI;
-
-public class IndexCreationEvent extends RepositoryEvent<URI> {
-
-    public enum Index implements EventType {
-        URI_CHANGE
-    }
-
-    IndexCreationEvent(String repo, URI oldValue, URI value) {
-        super(Index.URI_CHANGE, repo, oldValue, value);
-    }
-}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
deleted file mode 100644
index eaf532f..0000000
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/IndexCreationFeature.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.apache.archiva.repository.features;
-
-/*
- * 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.repository.Repository;
-import org.apache.archiva.repository.RepositoryEventListener;
-import org.apache.commons.lang.StringUtils;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.EventListener;
-import java.util.List;
-
-/**
- *
- * This feature provides some information about index creation.
- *
- */
-public class IndexCreationFeature extends AbstractFeature implements 
RepositoryFeature<IndexCreationFeature>{
-
-
-    private boolean skipPackedIndexCreation = false;
-
-    private URI indexPath;
-
-    private String repo;
-
-    public IndexCreationFeature(String repoId, RepositoryEventListener 
listener) {
-        super(listener);
-        this.repo = repoId;
-        try
-        {
-            setIndexPath(new URI(".indexer"));
-        }
-        catch ( URISyntaxException e )
-        {
-            // This may not happen.
-            e.printStackTrace( );
-        }
-    }
-
-    public IndexCreationFeature(boolean skipPackedIndexCreation) {
-        this.skipPackedIndexCreation = skipPackedIndexCreation;
-    }
-
-    @Override
-    public IndexCreationFeature get() {
-        return this;
-    }
-
-    /**
-     * Returns true, if no packed index files should be created.
-     * @return True, if no packed index files are created, otherwise false.
-     */
-    public boolean isSkipPackedIndexCreation() {
-        return skipPackedIndexCreation;
-    }
-
-    /**
-     * Sets the flag for packed index creation.
-     *
-     * @param skipPackedIndexCreation
-     */
-    public void setSkipPackedIndexCreation(boolean skipPackedIndexCreation) {
-        this.skipPackedIndexCreation = skipPackedIndexCreation;
-    }
-
-    /**
-     * Returns the path that is used to store the index.
-     * @return the uri (may be relative or absolute)
-     */
-    public URI getIndexPath( )
-    {
-        return indexPath;
-    }
-
-    /**
-     * Sets the path that is used to store the index.
-     * @param indexPath the uri to the index path (may be relative)
-     */
-    public void setIndexPath( URI indexPath )
-    {
-        URI oldVal = this.indexPath;
-        this.indexPath = indexPath;
-        raiseEvent(new IndexCreationEvent(repo, oldVal, this.indexPath));
-
-    }
-
-
-    public boolean hasIndex() {
-        return this.indexPath!=null && !StringUtils.isEmpty( 
this.indexPath.getPath() );
-    }
-}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
deleted file mode 100644
index dca455a..0000000
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/RemoteIndexFeature.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package org.apache.archiva.repository.features;
-
-/*
- * 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.commons.lang.StringUtils;
-
-import java.net.URI;
-import java.time.Duration;
-
-/**
- * Feature for remote index download.
- */
-public class RemoteIndexFeature implements 
RepositoryFeature<RemoteIndexFeature> {
-
-    private boolean downloadRemoteIndex = false;
-    private URI indexUri;
-    private boolean downloadRemoteIndexOnStartup = false;
-    private Duration downloadTimeout = Duration.ofSeconds( 600 );
-    private String proxyId = "";
-
-
-    @Override
-    public RemoteIndexFeature get() {
-        return this;
-    }
-
-    /**
-     * True, if the remote index should be downloaded.
-     * @return True if download, otherwise false.
-     */
-    public boolean isDownloadRemoteIndex() {
-        return downloadRemoteIndex;
-    }
-
-    public void setDownloadRemoteIndex(boolean downloadRemoteIndex) {
-        this.downloadRemoteIndex = downloadRemoteIndex;
-    }
-
-    /**
-     * The URI to access the remote index. May be a relative URI that is 
relative to the
-     * repository URI.
-     *
-     * @return
-     */
-    public URI getIndexUri() {
-        return indexUri;
-    }
-
-    /**
-     * Sets the URI to access the remote index. May be a relative URI that is 
relative to the
-     * repository URI. The allowed URI schemes are dependent on the repository 
type.
-     *
-     * @param indexUri The URI of the index
-     */
-    public void setIndexUri(URI indexUri) {
-        this.indexUri = indexUri;
-    }
-
-    /**
-     * Returns true, if the remote index should be downloaded on startup of 
the repository.
-     * @return true, if the index should be downloaded during startup, 
otherwise false.
-     */
-    public boolean isDownloadRemoteIndexOnStartup() {
-        return downloadRemoteIndexOnStartup;
-    }
-
-    /**
-     * Sets the flag for download of the remote repository index.
-     *
-     * @param downloadRemoteIndexOnStartup
-     */
-    public void setDownloadRemoteIndexOnStartup(boolean 
downloadRemoteIndexOnStartup) {
-        this.downloadRemoteIndexOnStartup = downloadRemoteIndexOnStartup;
-    }
-
-    /**
-     * Returns the timeout after that the remote index download is aborted.
-     * @return the time duration after that, the download is aborted.
-     */
-    public Duration getDownloadTimeout() {
-        return this.downloadTimeout;
-    }
-
-    /**
-     * Sets the timeout after that a remote index download will be aborted.
-     * @param timeout The duration
-     */
-    public void setDownloadTimeout(Duration timeout) {
-        this.downloadTimeout = timeout;
-    }
-
-    /**
-     * Returns the id of the proxy, that should be used to download the remote 
index.
-     * @return The proxy id
-     */
-    public String getProxyId( )
-    {
-        return proxyId;
-    }
-
-    /**
-     * Sets the id of the proxy that should be used to download the remote 
index.
-     * @param proxyId
-     */
-    public void setProxyId( String proxyId )
-    {
-        this.proxyId = proxyId;
-    }
-
-    /**
-     * Returns true, if there is a index available.
-     *
-     * @return
-     */
-    public boolean hasIndex() {
-        return this.indexUri!=null && !StringUtils.isEmpty( 
this.indexUri.getPath() );
-    }
-}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
deleted file mode 100644
index 3e4ba12..0000000
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/features/StagingRepositoryFeature.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.apache.archiva.repository.features;
-
-/*
- * 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.repository.ManagedRepository;
-
-/**
- * This feature provides some information about staging repositories.
- *
- */
-public class StagingRepositoryFeature implements 
RepositoryFeature<StagingRepositoryFeature> {
-
-    public static final String STAGING_REPO_POSTFIX = "-stage";
-
-    private ManagedRepository stagingRepository = null;
-    private boolean stageRepoNeeded = false;
-
-    public StagingRepositoryFeature() {
-
-    }
-
-    public StagingRepositoryFeature(ManagedRepository stagingRepository, 
boolean stageRepoNeeded) {
-        this.stagingRepository = stagingRepository;
-        this.stageRepoNeeded = stageRepoNeeded;
-    }
-
-    @Override
-    public StagingRepositoryFeature get() {
-        return this;
-    }
-
-    /**
-     * Returns the staging repository, if it exists.
-     *
-     * @return The staging repository, null if not set.
-     *
-     */
-    public ManagedRepository getStagingRepository() {
-        return stagingRepository;
-    }
-
-    /**
-     * Sets the staging repository.
-     *
-     * @param stagingRepository
-     */
-    public void setStagingRepository(ManagedRepository stagingRepository) {
-        this.stagingRepository = stagingRepository;
-    }
-
-    /**
-     * Returns true, if a staging repository is needed by this repository.
-     * @return True, if staging repository is needed, otherwise false.
-     */
-    public boolean isStageRepoNeeded() {
-        return stageRepoNeeded;
-    }
-
-    /**
-     * Sets the flag for needed staging repository.
-     *
-     * @param stageRepoNeeded
-     */
-    public void setStageRepoNeeded(boolean stageRepoNeeded) {
-        this.stageRepoNeeded = stageRepoNeeded;
-    }
-}

http://git-wip-us.apache.org/repos/asf/archiva/blob/0ef19fe3/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ArchivaIndexManagerMock.java
----------------------------------------------------------------------
diff --git 
a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ArchivaIndexManagerMock.java
 
b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ArchivaIndexManagerMock.java
index e81bcff..65d8196 100644
--- 
a/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ArchivaIndexManagerMock.java
+++ 
b/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/mock/ArchivaIndexManagerMock.java
@@ -82,4 +82,9 @@ public class ArchivaIndexManagerMock implements 
ArchivaIndexManager {
     public ArchivaIndexingContext move(ArchivaIndexingContext context, 
Repository repo) throws IndexCreationFailedException {
         return null;
     }
+
+    @Override
+    public void updateLocalIndexPath(Repository repo) {
+
+    }
 }

Reply via email to