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.event; 21 22 23 import java.util.List; 24 25 26 27 28 /** 29 * Interface used by the DirectoryService to manage subscriptions for DIT 30 * change notifications. 31 * 32 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 33 * @version $Rev$, $Date$ 34 */ 35 public interface EventService 36 { 37 /** 38 * Registers a DirectoryListener for notification on any and all change 39 * events on the DIT. 40 * 41 * @param listener the DirectoryListener to deliver notifications to 42 */ 43 void addListener( DirectoryListener listener ); 44 45 46 /** 47 * Registers a DirectoryListener for notification on change events on the 48 * DIT matching some notification criteria. 49 * 50 * @param listener the DirectoryListener to deliver notifications to 51 * @param criteria the parameterized criteria for delivering change events 52 * @throws Exception 53 */ 54 void addListener( DirectoryListener listener, NotificationCriteria criteria ) throws Exception; 55 56 57 /** 58 * Removes the listener from this EventService preventing all events 59 * registered from being delivered to it. 60 * 61 * @param listener the DirectoryListener to stop delivering notifications to 62 */ 63 void removeListener( DirectoryListener listener ); 64 65 66 /** 67 * Lists the listeners registered with this EventService. 68 */ 69 List<RegistrationEntry> getRegistrationEntries(); 70 }