1 package org.apache.archiva.scheduler.repository.mock;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
20 import org.apache.archiva.admin.model.AuditInformation;
21 import org.apache.archiva.admin.model.RepositoryAdminException;
22 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
23 import org.apache.archiva.admin.model.beans.FileType;
24 import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
25 import org.apache.archiva.admin.model.beans.NetworkConfiguration;
26 import org.apache.archiva.admin.model.beans.OrganisationInformation;
27 import org.apache.archiva.admin.model.beans.UiConfiguration;
28 import org.apache.archiva.configuration.ArchivaConfiguration;
30 import java.util.ArrayList;
31 import java.util.List;
34 * @author Olivier Lamy
36 public class MockArchivaAdministration
37 implements ArchivaAdministration
39 private ArchivaConfiguration archivaConfiguration;
42 public List<LegacyArtifactPath> getLegacyArtifactPaths()
43 throws RepositoryAdminException
49 public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
50 throws RepositoryAdminException
56 public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
57 throws RepositoryAdminException
63 public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
64 throws RepositoryAdminException
70 public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
71 throws RepositoryAdminException
77 public List<FileType> getFileTypes()
78 throws RepositoryAdminException
84 public FileType getFileType( String fileTypeId )
85 throws RepositoryAdminException
91 public void addFileType( FileType fileType, AuditInformation auditInformation )
92 throws RepositoryAdminException
98 public void removeFileType( String fileTypeId, AuditInformation auditInformation )
99 throws RepositoryAdminException
105 public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
106 throws RepositoryAdminException
112 public void setKnownContentConsumers( List<String> knownContentConsumers, AuditInformation auditInformation )
113 throws RepositoryAdminException
119 public List<String> getKnownContentConsumers()
120 throws RepositoryAdminException
122 return new ArrayList<>(
123 getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() );
127 public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
128 throws RepositoryAdminException
134 public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
135 throws RepositoryAdminException
141 public void setInvalidContentConsumers( List<String> invalidContentConsumers, AuditInformation auditInformation )
142 throws RepositoryAdminException
148 public List<String> getInvalidContentConsumers()
149 throws RepositoryAdminException
151 return new ArrayList<>(
152 getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() );
156 public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
157 throws RepositoryAdminException
163 public OrganisationInformation getOrganisationInformation()
164 throws RepositoryAdminException
170 public void setOrganisationInformation( OrganisationInformation organisationInformation )
171 throws RepositoryAdminException
176 public ArchivaConfiguration getArchivaConfiguration()
178 return archivaConfiguration;
181 public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
183 this.archivaConfiguration = archivaConfiguration;
187 public UiConfiguration getUiConfiguration()
188 throws RepositoryAdminException
194 public void updateUiConfiguration( UiConfiguration uiConfiguration )
195 throws RepositoryAdminException
201 public NetworkConfiguration getNetworkConfiguration()
202 throws RepositoryAdminException
208 public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
209 throws RepositoryAdminException