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.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;
41 public List<LegacyArtifactPath> getLegacyArtifactPaths()
42 throws RepositoryAdminException
47 public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath, AuditInformation auditInformation )
48 throws RepositoryAdminException
53 public void deleteLegacyArtifactPath( String path, AuditInformation auditInformation )
54 throws RepositoryAdminException
59 public void addFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
60 throws RepositoryAdminException
65 public void removeFileTypePattern( String fileTypeId, String pattern, AuditInformation auditInformation )
66 throws RepositoryAdminException
71 public List<FileType> getFileTypes()
72 throws RepositoryAdminException
77 public FileType getFileType( String fileTypeId )
78 throws RepositoryAdminException
83 public void addFileType( FileType fileType, AuditInformation auditInformation )
84 throws RepositoryAdminException
89 public void removeFileType( String fileTypeId, AuditInformation auditInformation )
90 throws RepositoryAdminException
95 public void addKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
96 throws RepositoryAdminException
101 public void setKnownContentConsumers( List<String> knownContentConsumers, AuditInformation auditInformation )
102 throws RepositoryAdminException
107 public List<String> getKnownContentConsumers()
108 throws RepositoryAdminException
110 return new ArrayList<String>(
111 getArchivaConfiguration().getConfiguration().getRepositoryScanning().getKnownContentConsumers() );
114 public void removeKnownContentConsumer( String knownContentConsumer, AuditInformation auditInformation )
115 throws RepositoryAdminException
120 public void addInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
121 throws RepositoryAdminException
126 public void setInvalidContentConsumers( List<String> invalidContentConsumers, AuditInformation auditInformation )
127 throws RepositoryAdminException
132 public List<String> getInvalidContentConsumers()
133 throws RepositoryAdminException
135 return new ArrayList<String>(
136 getArchivaConfiguration().getConfiguration().getRepositoryScanning().getInvalidContentConsumers() );
139 public void removeInvalidContentConsumer( String invalidContentConsumer, AuditInformation auditInformation )
140 throws RepositoryAdminException
145 public OrganisationInformation getOrganisationInformation()
146 throws RepositoryAdminException
151 public void setOrganisationInformation( OrganisationInformation organisationInformation )
152 throws RepositoryAdminException
157 public ArchivaConfiguration getArchivaConfiguration()
159 return archivaConfiguration;
162 public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
164 this.archivaConfiguration = archivaConfiguration;
167 public UiConfiguration getUiConfiguration()
168 throws RepositoryAdminException
173 public void updateUiConfiguration( UiConfiguration uiConfiguration )
174 throws RepositoryAdminException