1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.server.core.api.event; 21 22 23 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext; 24 import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext; 25 import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext; 26 import org.apache.directory.server.core.api.interceptor.context.MoveAndRenameOperationContext; 27 import org.apache.directory.server.core.api.interceptor.context.MoveOperationContext; 28 import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext; 29 30 31 /** 32 * A listener which is notified of changes to the directory service. 33 * 34 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 35 */ 36 public interface DirectoryListener 37 { 38 /** 39 * Called when an entry has been added. 40 * 41 * @param addContext the add operation context responsible for the change 42 */ 43 void entryAdded( AddOperationContext addContext ); 44 45 46 /** 47 * Called when an entry has been deleted. 48 * 49 * @param deleteContext the delete operation context responsible for the change 50 */ 51 void entryDeleted( DeleteOperationContext deleteContext ); 52 53 54 /** 55 * Called when an entry has been modified. 56 * 57 * @param modifyContext the modify operation context responsible for the change 58 */ 59 void entryModified( ModifyOperationContext modifyContext ); 60 61 62 /** 63 * Called when an entry has been renamed. 64 * 65 * @param renameContext the rename operation context responsible for the change 66 */ 67 void entryRenamed( RenameOperationContext renameContext ); 68 69 70 /** 71 * Called when an entry is moved. 72 * 73 * @param moveContext the move operation context responsible for the change 74 */ 75 void entryMoved( MoveOperationContext moveContext ); 76 77 78 /** 79 * Called when an entry is moved and renamed at the same time. 80 * 81 * @param moveAndRenameContext the move/rename operation context responsible for the change 82 */ 83 void entryMovedAndRenamed( MoveAndRenameOperationContext moveAndRenameContext ); 84 85 86 /** 87 * indicates if this listener needs to be invoked synchronously 88 * 89 * @return true if should be invoked synchronously, false otherwise 90 */ 91 boolean isSynchronous(); 92 }