Line data Source code
1 : // Copyright (C) 2021 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.server.project; 16 : 17 : import com.google.common.collect.ImmutableSortedSet; 18 : import com.google.gerrit.entities.AccountGroup.UUID; 19 : import com.google.gerrit.entities.Project; 20 : import com.google.gerrit.entities.Project.NameKey; 21 : import com.google.gerrit.exceptions.StorageException; 22 : import java.io.IOException; 23 : import java.util.Optional; 24 : import java.util.Set; 25 : 26 : /** An implementation of {@link ProjectCache} with no operations implemented. */ 27 1 : public class NullProjectCache implements ProjectCache { 28 : 29 : @Override 30 : public ProjectState getAllProjects() { 31 0 : throw new UnsupportedOperationException(); 32 : } 33 : 34 : @Override 35 : public ProjectState getAllUsers() { 36 0 : throw new UnsupportedOperationException(); 37 : } 38 : 39 : @Override 40 : public Optional<ProjectState> get(NameKey projectName) throws StorageException { 41 0 : throw new UnsupportedOperationException(); 42 : } 43 : 44 : @Override 45 : public void evict(NameKey p) { 46 0 : throw new UnsupportedOperationException(); 47 : } 48 : 49 : @Override 50 : public void remove(Project p) { 51 0 : throw new UnsupportedOperationException(); 52 : } 53 : 54 : @Override 55 : public void remove(NameKey name) { 56 0 : throw new UnsupportedOperationException(); 57 : } 58 : 59 : @Override 60 : public ImmutableSortedSet<NameKey> all() { 61 0 : throw new UnsupportedOperationException(); 62 : } 63 : 64 : @Override 65 : public void refreshProjectList() { 66 0 : throw new UnsupportedOperationException(); 67 : } 68 : 69 : @Override 70 : public Set<UUID> guessRelevantGroupUUIDs() { 71 0 : throw new UnsupportedOperationException(); 72 : } 73 : 74 : @Override 75 : public ImmutableSortedSet<NameKey> byName(String prefix) { 76 0 : throw new UnsupportedOperationException(); 77 : } 78 : 79 : @Override 80 : public void onCreateProject(NameKey newProjectName) throws IOException { 81 0 : throw new UnsupportedOperationException(); 82 : } 83 : 84 : @Override 85 : public void evictAndReindex(Project p) { 86 0 : throw new UnsupportedOperationException(); 87 : } 88 : 89 : @Override 90 : public void evictAndReindex(NameKey p) { 91 0 : throw new UnsupportedOperationException(); 92 : } 93 : }