Path: blob/master/src/java.naming/share/classes/javax/naming/event/EventDirContext.java
41159 views
/*1* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.naming.event;26import javax.naming.Name;27import javax.naming.NamingException;28import javax.naming.directory.DirContext;29import javax.naming.directory.SearchControls;3031/**32* Contains methods for registering listeners to be notified33* of events fired when objects named in a directory context changes.34*<p>35* The methods in this interface support identification of objects by36* <A HREF="http://www.ietf.org/rfc/rfc2254.txt">RFC 2254</a>37* search filters.38*39*<P>Using the search filter, it is possible to register interest in objects40* that do not exist at the time of registration but later come into existence and41* satisfy the filter. However, there might be limitations in the extent42* to which this can be supported by the service provider and underlying43* protocol/service. If the caller submits a filter that cannot be44* supported in this way, {@code addNamingListener()} throws an45* {@code InvalidSearchFilterException}.46*<p>47* See {@code EventContext} for a description of event source48* and target, and information about listener registration/deregistration49* that are also applicable to methods in this interface.50* See the51* <a href=package-summary.html#THREADING>package description</a>52* for information on threading issues.53*<p>54* A {@code SearchControls} or array object55* passed as a parameter to any method is owned by the caller.56* The service provider will not modify the object or keep a reference to it.57*58* @author Rosanna Lee59* @author Scott Seligman60* @since 1.361*/6263public interface EventDirContext extends EventContext, DirContext {64/**65* Adds a listener for receiving naming events fired66* when objects identified by the search filter {@code filter} at67* the object named by target are modified.68* <p>69* The scope, returningObj flag, and returningAttributes flag from70* the search controls {@code ctls} are used to control the selection71* of objects that the listener is interested in,72* and determines what information is returned in the eventual73* {@code NamingEvent} object. Note that the requested74* information to be returned might not be present in the {@code NamingEvent}75* object if they are unavailable or could not be obtained by the76* service provider or service.77*78* @param target The nonnull name of the object resolved relative to this context.79* @param filter The nonnull string filter (see RFC2254).80* @param ctls The possibly null search controls. If null, the default81* search controls are used.82* @param l The nonnull listener.83* @throws NamingException If a problem was encountered while84* adding the listener.85* @see EventContext#removeNamingListener86* @see javax.naming.directory.DirContext#search(javax.naming.Name, java.lang.String, javax.naming.directory.SearchControls)87*/88void addNamingListener(Name target, String filter, SearchControls ctls,89NamingListener l) throws NamingException;9091/**92* Adds a listener for receiving naming events fired when93* objects identified by the search filter {@code filter} at the94* object named by the string target name are modified.95* See the overload that accepts a {@code Name} for details of96* how this method behaves.97*98* @param target The nonnull string name of the object resolved relative to this context.99* @param filter The nonnull string filter (see RFC2254).100* @param ctls The possibly null search controls. If null, the default101* search controls is used.102* @param l The nonnull listener.103* @throws NamingException If a problem was encountered while104* adding the listener.105* @see EventContext#removeNamingListener106* @see javax.naming.directory.DirContext#search(java.lang.String, java.lang.String, javax.naming.directory.SearchControls)107*/108void addNamingListener(String target, String filter, SearchControls ctls,109NamingListener l) throws NamingException;110111/**112* Adds a listener for receiving naming events fired113* when objects identified by the search filter {@code filter} and114* filter arguments at the object named by the target are modified.115* The scope, returningObj flag, and returningAttributes flag from116* the search controls {@code ctls} are used to control the selection117* of objects that the listener is interested in,118* and determines what information is returned in the eventual119* {@code NamingEvent} object. Note that the requested120* information to be returned might not be present in the {@code NamingEvent}121* object if they are unavailable or could not be obtained by the122* service provider or service.123*124* @param target The nonnull name of the object resolved relative to this context.125* @param filter The nonnull string filter (see RFC2254).126* @param filterArgs The possibly null array of arguments for the filter.127* @param ctls The possibly null search controls. If null, the default128* search controls are used.129* @param l The nonnull listener.130* @throws NamingException If a problem was encountered while131* adding the listener.132* @see EventContext#removeNamingListener133* @see javax.naming.directory.DirContext#search(javax.naming.Name, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls)134*/135void addNamingListener(Name target, String filter, Object[] filterArgs,136SearchControls ctls, NamingListener l) throws NamingException;137138/**139* Adds a listener for receiving naming events fired when140* objects identified by the search filter {@code filter}141* and filter arguments at the142* object named by the string target name are modified.143* See the overload that accepts a {@code Name} for details of144* how this method behaves.145*146* @param target The nonnull string name of the object resolved relative to this context.147* @param filter The nonnull string filter (see RFC2254).148* @param filterArgs The possibly null array of arguments for the filter.149* @param ctls The possibly null search controls. If null, the default150* search controls is used.151* @param l The nonnull listener.152* @throws NamingException If a problem was encountered while153* adding the listener.154* @see EventContext#removeNamingListener155* @see javax.naming.directory.DirContext#search(java.lang.String, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) */156void addNamingListener(String target, String filter, Object[] filterArgs,157SearchControls ctls, NamingListener l) throws NamingException;158}159160161