1 package org.apache.archiva.metadata.repository;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.metadata.model.ArtifactMetadata;
23 import org.apache.archiva.metadata.model.MetadataFacet;
24 import org.apache.archiva.metadata.model.ProjectMetadata;
25 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
26 import org.apache.archiva.metadata.model.ProjectVersionReference;
27 import org.springframework.stereotype.Service;
29 import java.util.ArrayList;
30 import java.util.Collection;
31 import java.util.Date;
32 import java.util.HashMap;
33 import java.util.List;
37 public class TestMetadataRepository
38 implements MetadataRepository
40 private Map<String, MetadataFacet> facets = new HashMap<String, MetadataFacet>();
42 public void updateProject( String repoId, ProjectMetadata project )
44 //To change body of implemented methods use File | Settings | File Templates.
47 public void updateArtifact( String repoId, String namespace, String projectId, String projectVersion,
48 ArtifactMetadata artifactMeta )
50 //To change body of implemented methods use File | Settings | File Templates.
53 public void updateProjectVersion( String repoId, String namespace, String projectId,
54 ProjectVersionMetadata versionMetadata )
56 //To change body of implemented methods use File | Settings | File Templates.
59 public void updateNamespace( String repoId, String namespace )
61 //To change body of implemented methods use File | Settings | File Templates.
64 public List<String> getMetadataFacets( String repoId, String facetId )
66 return new ArrayList<String>( facets.keySet() );
69 public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
71 return facets.get( name );
74 public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
76 facets.put( metadataFacet.getName(), metadataFacet );
79 public void removeMetadataFacets( String repositoryId, String facetId )
84 public void removeMetadataFacet( String repoId, String facetId, String name )
86 //To change body of implemented methods use File | Settings | File Templates.
89 public List<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date startTime, Date endTime )
91 return null; //To change body of implemented methods use File | Settings | File Templates.
94 public Collection<String> getRepositories()
96 return null; //To change body of implemented methods use File | Settings | File Templates.
99 public List<ArtifactMetadata> getArtifactsByChecksum( String repoId, String checksum )
101 return null; //To change body of implemented methods use File | Settings | File Templates.
104 public void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
106 //To change body of implemented methods use File | Settings | File Templates.
109 public void removeRepository( String repoId )
111 //To change body of implemented methods use File | Settings | File Templates.
114 public List<ArtifactMetadata> getArtifacts( String repositoryId )
119 public ProjectMetadata getProject( String repoId, String namespace, String projectId )
120 throws MetadataResolutionException
122 return null; //To change body of implemented methods use File | Settings | File Templates.
125 public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
126 String projectVersion )
127 throws MetadataResolutionException
129 return null; //To change body of implemented methods use File | Settings | File Templates.
132 public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
133 String projectVersion )
134 throws MetadataResolutionException
136 return null; //To change body of implemented methods use File | Settings | File Templates.
139 public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
140 String projectVersion )
141 throws MetadataResolutionException
143 return null; //To change body of implemented methods use File | Settings | File Templates.
146 public Collection<String> getRootNamespaces( String repoId )
147 throws MetadataResolutionException
149 return null; //To change body of implemented methods use File | Settings | File Templates.
152 public Collection<String> getNamespaces( String repoId, String namespace )
153 throws MetadataResolutionException
155 return null; //To change body of implemented methods use File | Settings | File Templates.
158 public Collection<String> getProjects( String repoId, String namespace )
159 throws MetadataResolutionException
161 return null; //To change body of implemented methods use File | Settings | File Templates.
164 public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
165 throws MetadataResolutionException
167 return null; //To change body of implemented methods use File | Settings | File Templates.
170 public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
171 String projectVersion )
172 throws MetadataResolutionException
174 return null; //To change body of implemented methods use File | Settings | File Templates.
179 //To change body of implemented methods use File | Settings | File Templates.
184 //To change body of implemented methods use File | Settings | File Templates.
189 //To change body of implemented methods use File | Settings | File Templates.
192 public boolean canObtainAccess( Class<?> aClass )
194 return false; //To change body of implemented methods use File | Settings | File Templates.
197 public Object obtainAccess( Class<?> aClass )
199 return null; //To change body of implemented methods use File | Settings | File Templates.
202 public void removeArtifact( String repositoryId, String namespace, String project, String version,
203 MetadataFacet metadataFacet )
204 throws MetadataRepositoryException
206 throw new UnsupportedOperationException();