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;
28 import java.util.ArrayList;
29 import java.util.Collection;
30 import java.util.Date;
31 import java.util.HashMap;
32 import java.util.List;
35 public class TestMetadataRepository
36 implements MetadataRepository
38 private Map<String, MetadataFacet> facets = new HashMap<String, MetadataFacet>();
40 public void updateProject( String repoId, ProjectMetadata project )
42 //To change body of implemented methods use File | Settings | File Templates.
45 public void updateArtifact( String repoId, String namespace, String projectId, String projectVersion,
46 ArtifactMetadata artifactMeta )
48 //To change body of implemented methods use File | Settings | File Templates.
51 public void updateProjectVersion( String repoId, String namespace, String projectId,
52 ProjectVersionMetadata versionMetadata )
54 //To change body of implemented methods use File | Settings | File Templates.
57 public void updateProjectReference( String repoId, String namespace, String projectId, String projectVersion,
58 ProjectVersionReference reference )
60 //To change body of implemented methods use File | Settings | File Templates.
63 public void updateNamespace( String repoId, String namespace )
65 //To change body of implemented methods use File | Settings | File Templates.
68 public List<String> getMetadataFacets( String repoId, String facetId )
70 return new ArrayList<String>( facets.keySet() );
73 public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
75 return facets.get( name );
78 public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
80 facets.put( metadataFacet.getName(), metadataFacet );
83 public void removeMetadataFacets( String repositoryId, String facetId )
88 public void removeMetadataFacet( String repoId, String facetId, String name )
90 //To change body of implemented methods use File | Settings | File Templates.
93 public List<ArtifactMetadata> getArtifactsByDateRange( String repoId, Date startTime, Date endTime )
95 return null; //To change body of implemented methods use File | Settings | File Templates.
98 public Collection<String> getRepositories()
100 return null; //To change body of implemented methods use File | Settings | File Templates.
103 public List<ArtifactMetadata> getArtifactsByChecksum( String repoId, String checksum )
105 return null; //To change body of implemented methods use File | Settings | File Templates.
108 public void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
110 //To change body of implemented methods use File | Settings | File Templates.
113 public void removeRepository( String repoId )
115 //To change body of implemented methods use File | Settings | File Templates.
118 public List<ArtifactMetadata> getArtifacts( String repositoryId )
123 public ProjectMetadata getProject( String repoId, String namespace, String projectId )
124 throws MetadataResolutionException
126 return null; //To change body of implemented methods use File | Settings | File Templates.
129 public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
130 String projectVersion )
131 throws MetadataResolutionException
133 return null; //To change body of implemented methods use File | Settings | File Templates.
136 public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
137 String projectVersion )
138 throws MetadataResolutionException
140 return null; //To change body of implemented methods use File | Settings | File Templates.
143 public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
144 String projectVersion )
145 throws MetadataResolutionException
147 return null; //To change body of implemented methods use File | Settings | File Templates.
150 public Collection<String> getRootNamespaces( String repoId )
151 throws MetadataResolutionException
153 return null; //To change body of implemented methods use File | Settings | File Templates.
156 public Collection<String> getNamespaces( String repoId, String namespace )
157 throws MetadataResolutionException
159 return null; //To change body of implemented methods use File | Settings | File Templates.
162 public Collection<String> getProjects( String repoId, String namespace )
163 throws MetadataResolutionException
165 return null; //To change body of implemented methods use File | Settings | File Templates.
168 public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
169 throws MetadataResolutionException
171 return null; //To change body of implemented methods use File | Settings | File Templates.
174 public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
175 String projectVersion )
176 throws MetadataResolutionException
178 return null; //To change body of implemented methods use File | Settings | File Templates.
183 //To change body of implemented methods use File | Settings | File Templates.
188 //To change body of implemented methods use File | Settings | File Templates.
193 //To change body of implemented methods use File | Settings | File Templates.
196 public boolean canObtainAccess( Class<?> aClass )
198 return false; //To change body of implemented methods use File | Settings | File Templates.
201 public Object obtainAccess( Class<?> aClass )
203 return null; //To change body of implemented methods use File | Settings | File Templates.