1 package org.apache.archiva.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
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import org.apache.archiva.admin.model.AuditInformation;
22 import org.apache.archiva.admin.model.RepositoryAdminException;
23 import org.apache.archiva.admin.model.admin.ArchivaAdministration;
24 import org.apache.archiva.admin.model.beans.FileType;
25 import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
26 import org.apache.archiva.admin.model.beans.NetworkConfiguration;
27 import org.apache.archiva.admin.model.beans.OrganisationInformation;
28 import org.apache.archiva.admin.model.beans.UiConfiguration;
29 import org.apache.archiva.configuration.ArchivaConfiguration;
31 import java.util.ArrayList;
32 import java.util.List;
35 * @author Olivier Lamy
37 public class MockArchivaAdministration
38 implements ArchivaAdministration
40 private ArchivaConfiguration archivaConfiguration;
43 public List<LegacyArtifactPath> getLegacyArtifactPaths()
44 throws RepositoryAdminException
50 public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
51 throws RepositoryAdminException
57 public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
58 throws RepositoryAdminException
64 public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
65 throws RepositoryAdminException
71 public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
72 throws RepositoryAdminException
78 public List<FileType> getFileTypes()
79 throws RepositoryAdminException
85 public FileType getFileType( String fileTypeId )
86 throws RepositoryAdminException
92 public void addFileType( FileType fileType, AuditInformation auditInformation )
93 throws RepositoryAdminException
99 public void removeFileType( String fileTypeId, AuditInformation auditInformation )
100 throws RepositoryAdminException
106 public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
107 throws RepositoryAdminException
113 public void setKnownContentConsumers( List<String> knownContentConsumers, AuditInformation auditInformation )
114 throws RepositoryAdminException
120 public List<String> getKnownContentConsumers()
121 throws RepositoryAdminException
123 return new ArrayList<>(
124 getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() );
128 public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
129 throws RepositoryAdminException
135 public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
136 throws RepositoryAdminException
142 public void setInvalidContentConsumers( List<String> invalidContentConsumers, AuditInformation auditInformation )
143 throws RepositoryAdminException
149 public List<String> getInvalidContentConsumers()
150 throws RepositoryAdminException
152 return new ArrayList<>(
153 getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() );
157 public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
158 throws RepositoryAdminException
164 public OrganisationInformation getOrganisationInformation()
165 throws RepositoryAdminException
171 public void setOrganisationInformation( OrganisationInformation organisationInformation )
172 throws RepositoryAdminException
177 public ArchivaConfiguration getArchivaConfiguration()
179 return archivaConfiguration;
182 public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
184 this.archivaConfiguration = archivaConfiguration;
188 public UiConfiguration getUiConfiguration()
189 throws RepositoryAdminException
195 public void updateUiConfiguration( UiConfiguration uiConfiguration )
196 throws RepositoryAdminException
202 public NetworkConfiguration getNetworkConfiguration()
203 throws RepositoryAdminException
209 public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
210 throws RepositoryAdminException