Line data Source code
1 : // Copyright (C) 2017 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.account.externalids; 16 : 17 : import com.google.common.collect.ImmutableSet; 18 : import com.google.common.collect.ImmutableSetMultimap; 19 : import com.google.gerrit.entities.Account; 20 : import com.google.inject.AbstractModule; 21 : import com.google.inject.Module; 22 : import java.io.IOException; 23 : import java.util.Optional; 24 : import org.eclipse.jgit.lib.ObjectId; 25 : 26 2 : public class DisabledExternalIdCache implements ExternalIdCache { 27 : public static Module module() { 28 2 : return new AbstractModule() { 29 : 30 : @Override 31 : protected void configure() { 32 2 : bind(ExternalIdCache.class).to(DisabledExternalIdCache.class); 33 2 : } 34 : }; 35 : } 36 : 37 : @Override 38 : public Optional<ExternalId> byKey(ExternalId.Key key) throws IOException { 39 0 : throw new UnsupportedOperationException(); 40 : } 41 : 42 : @Override 43 : public ImmutableSet<ExternalId> byAccount(Account.Id accountId) { 44 0 : throw new UnsupportedOperationException(); 45 : } 46 : 47 : @Override 48 : public ImmutableSet<ExternalId> byAccount(Account.Id accountId, ObjectId rev) { 49 0 : throw new UnsupportedOperationException(); 50 : } 51 : 52 : @Override 53 : public ImmutableSetMultimap<Account.Id, ExternalId> allByAccount() throws IOException { 54 0 : throw new UnsupportedOperationException(); 55 : } 56 : 57 : @Override 58 : public ImmutableSetMultimap<String, ExternalId> byEmails(String... emails) throws IOException { 59 0 : throw new UnsupportedOperationException(); 60 : } 61 : 62 : @Override 63 : public ImmutableSetMultimap<String, ExternalId> allByEmail() throws IOException { 64 0 : throw new UnsupportedOperationException(); 65 : } 66 : }