Line data Source code
1 : // Copyright (C) 2015 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.extensions.events; 16 : 17 : import com.google.gerrit.extensions.annotations.ExtensionPoint; 18 : 19 : /** Notified whenever a change is indexed or deleted from the index. */ 20 : @ExtensionPoint 21 : public interface ChangeIndexedListener { 22 : /** 23 : * Invoked when a change is scheduled for indexing. 24 : * 25 : * @param projectName project containing the change 26 : * @param id id of the change that was scheduled for indexing 27 : */ 28 5 : default void onChangeScheduledForIndexing(String projectName, int id) {} 29 : 30 : /** 31 : * Invoked when a change is scheduled for deletion from indexing. 32 : * 33 : * @param id id of the change that was scheduled for deletion from indexing 34 : */ 35 0 : default void onChangeScheduledForDeletionFromIndex(int id) {} 36 : 37 : /** 38 : * Invoked when a change is indexed. 39 : * 40 : * @param projectName project containing the change 41 : * @param id indexed change id 42 : */ 43 : void onChangeIndexed(String projectName, int id); 44 : 45 : /** Invoked when a change is deleted from the index. */ 46 : void onChangeDeleted(int id); 47 : }