1 package org.apache.archiva.scheduler.indexing.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.metadata.model.ArtifactMetadata;
22 import org.apache.archiva.metadata.model.MetadataFacet;
23 import org.apache.archiva.metadata.model.ProjectMetadata;
24 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
25 import org.apache.archiva.metadata.model.ProjectVersionReference;
26 import org.apache.archiva.metadata.repository.MetadataRepository;
27 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
28 import org.apache.archiva.metadata.repository.MetadataResolutionException;
29 import org.apache.archiva.metadata.repository.RepositorySession;
30 import org.apache.archiva.metadata.repository.RepositorySessionFactory;
31 import org.springframework.stereotype.Service;
33 import java.util.Collection;
34 import java.util.Collections;
35 import java.util.Date;
36 import java.util.List;
39 * @author Olivier Lamy
41 @Service( "RepositorySessionFactory#mock" )
42 public class MockRepositorySessionFactory
43 implements RepositorySessionFactory
45 public RepositorySession createSession()
47 return new RepositorySession( null, null )
62 public MetadataRepository getRepository()
64 return new MetadataRepository()
66 public void updateProject( String repositoryId, ProjectMetadata project )
67 throws MetadataRepositoryException
69 //To change body of implemented methods use File | Settings | File Templates.
72 public void updateArtifact( String repositoryId, String namespace, String projectId,
73 String projectVersion, ArtifactMetadata artifactMeta )
74 throws MetadataRepositoryException
76 //To change body of implemented methods use File | Settings | File Templates.
79 public void updateProjectVersion( String repositoryId, String namespace, String projectId,
80 ProjectVersionMetadata versionMetadata )
81 throws MetadataRepositoryException
83 //To change body of implemented methods use File | Settings | File Templates.
86 public void updateNamespace( String repositoryId, String namespace )
87 throws MetadataRepositoryException
89 //To change body of implemented methods use File | Settings | File Templates.
92 public List<String> getMetadataFacets( String repositoryId, String facetId )
93 throws MetadataRepositoryException
95 return Collections.emptyList();
98 public MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name )
99 throws MetadataRepositoryException
101 return null; //To change body of implemented methods use File | Settings | File Templates.
104 public void addMetadataFacet( String repositoryId, MetadataFacet metadataFacet )
105 throws MetadataRepositoryException
107 //To change body of implemented methods use File | Settings | File Templates.
110 public void removeMetadataFacets( String repositoryId, String facetId )
111 throws MetadataRepositoryException
113 //To change body of implemented methods use File | Settings | File Templates.
116 public void removeMetadataFacet( String repositoryId, String facetId, String name )
117 throws MetadataRepositoryException
119 //To change body of implemented methods use File | Settings | File Templates.
122 public List<ArtifactMetadata> getArtifactsByDateRange( String repositoryId, Date startTime,
124 throws MetadataRepositoryException
126 return null; //To change body of implemented methods use File | Settings | File Templates.
129 public Collection<String> getRepositories()
130 throws MetadataRepositoryException
132 return null; //To change body of implemented methods use File | Settings | File Templates.
135 public List<ArtifactMetadata> getArtifactsByChecksum( String repositoryId, String checksum )
136 throws MetadataRepositoryException
138 return null; //To change body of implemented methods use File | Settings | File Templates.
141 public void removeArtifact( String repositoryId, String namespace, String project, String version,
143 throws MetadataRepositoryException
145 //To change body of implemented methods use File | Settings | File Templates.
148 public void removeRepository( String repositoryId )
149 throws MetadataRepositoryException
151 //To change body of implemented methods use File | Settings | File Templates.
154 public List<ArtifactMetadata> getArtifacts( String repositoryId )
155 throws MetadataRepositoryException
157 return null; //To change body of implemented methods use File | Settings | File Templates.
160 public ProjectMetadata getProject( String repoId, String namespace, String projectId )
161 throws MetadataResolutionException
163 return null; //To change body of implemented methods use File | Settings | File Templates.
166 public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
167 String projectVersion )
168 throws MetadataResolutionException
170 return null; //To change body of implemented methods use File | Settings | File Templates.
173 public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
174 String projectVersion )
175 throws MetadataResolutionException
177 return null; //To change body of implemented methods use File | Settings | File Templates.
180 public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace,
182 String projectVersion )
183 throws MetadataResolutionException
185 return null; //To change body of implemented methods use File | Settings | File Templates.
188 public Collection<String> getRootNamespaces( String repoId )
189 throws MetadataResolutionException
191 return null; //To change body of implemented methods use File | Settings | File Templates.
194 public Collection<String> getNamespaces( String repoId, String namespace )
195 throws MetadataResolutionException
197 return null; //To change body of implemented methods use File | Settings | File Templates.
200 public Collection<String> getProjects( String repoId, String namespace )
201 throws MetadataResolutionException
203 return null; //To change body of implemented methods use File | Settings | File Templates.
206 public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
207 throws MetadataResolutionException
209 return null; //To change body of implemented methods use File | Settings | File Templates.
212 public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
213 String projectVersion )
214 throws MetadataResolutionException
216 return null; //To change body of implemented methods use File | Settings | File Templates.
221 //To change body of implemented methods use File | Settings | File Templates.
226 //To change body of implemented methods use File | Settings | File Templates.
231 //To change body of implemented methods use File | Settings | File Templates.
234 public boolean canObtainAccess( Class<?> aClass )
236 return false; //To change body of implemented methods use File | Settings | File Templates.
239 public Object obtainAccess( Class<?> aClass )
241 return null; //To change body of implemented methods use File | Settings | File Templates.