jdk/src/java.naming/share/classes/javax/naming/event/EventDirContext.java
author igerasim
Tue, 09 Sep 2014 19:02:36 +0400
changeset 26458 d6a5aed9204b
parent 25859 3317bb8137f4
child 32029 a5538163e144
permissions -rw-r--r--
7010989: Duplicate closure of file descriptors leads to unexpected and incorrect closure of sockets Reviewed-by: chegar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 5627
diff changeset
     2
 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.naming.event;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import javax.naming.Name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.naming.NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.naming.directory.DirContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.naming.directory.SearchControls;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * Contains methods for registering listeners to be notified
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * of events fired when objects named in a directory context changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * The methods in this interface support identification of objects by
5604
d5b97d8361d0 6952701: Use http://www.ietf.org/rfc for rfc references in jdk public APIs
sherman
parents: 2
diff changeset
    37
 * <A HREF="http://www.ietf.org/rfc/rfc2254.txt">RFC 2254</a>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * search filters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *<P>Using the search filter, it is possible to register interest in objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * that do not exist at the time of registration but later come into existence and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * satisfy the filter.  However, there might be limitations in the extent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * to which this can be supported by the service provider and underlying
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * protocol/service.  If the caller submits a filter that cannot be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * supported in this way, <tt>addNamingListener()</tt> throws an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <tt>InvalidSearchFilterException</tt>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * See <tt>EventContext</tt> for a description of event source
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * and target, and information about listener registration/deregistration
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * that are also applicable to methods in this interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * See the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * <a href=package-summary.html#THREADING>package description</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * for information on threading issues.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * A <tt>SearchControls</tt> or array object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * passed as a parameter to any method is owned by the caller.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * The service provider will not modify the object or keep a reference to it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * @author Rosanna Lee
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * @author Scott Seligman
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
public interface EventDirContext extends EventContext, DirContext {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * Adds a listener for receiving naming events fired
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * when objects identified by the search filter <tt>filter</tt> at
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * the object named by target are modified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * The scope, returningObj flag, and returningAttributes flag from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * the search controls <tt>ctls</tt> are used to control the selection
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * of objects that the listener is interested in,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * and determines what information is returned in the eventual
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * <tt>NamingEvent</tt> object. Note that the requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * information to be returned might not be present in the <tt>NamingEvent</tt>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * object if they are unavailable or could not be obtained by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * service provider or service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * @param target The nonnull name of the object resolved relative to this context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * @param filter The nonnull string filter (see RFC2254).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @param ctls   The possibly null search controls. If null, the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     *        search controls are used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * @param l  The nonnull listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * @exception NamingException If a problem was encountered while
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * adding the listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * @see EventContext#removeNamingListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * @see javax.naming.directory.DirContext#search(javax.naming.Name, java.lang.String, javax.naming.directory.SearchControls)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    void addNamingListener(Name target, String filter, SearchControls ctls,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        NamingListener l) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * Adds a listener for receiving naming events fired when
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * objects identified by the search filter <tt>filter</tt> at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * object named by the string target name are modified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * See the overload that accepts a <tt>Name</tt> for details of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * how this method behaves.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @param target The nonnull string name of the object resolved relative to this context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * @param filter The nonnull string filter (see RFC2254).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * @param ctls   The possibly null search controls. If null, the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     *        search controls is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @param l  The nonnull listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @exception NamingException If a problem was encountered while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * adding the listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @see EventContext#removeNamingListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @see javax.naming.directory.DirContext#search(java.lang.String, java.lang.String, javax.naming.directory.SearchControls)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    void addNamingListener(String target, String filter, SearchControls ctls,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        NamingListener l) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * Adds a listener for receiving naming events fired
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * when objects identified by the search filter <tt>filter</tt> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * filter arguments at the object named by the target are modified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * The scope, returningObj flag, and returningAttributes flag from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * the search controls <tt>ctls</tt> are used to control the selection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * of objects that the listener is interested in,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * and determines what information is returned in the eventual
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * <tt>NamingEvent</tt> object.  Note that the requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * information to be returned might not be present in the <tt>NamingEvent</tt>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * object if they are unavailable or could not be obtained by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * service provider or service.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * @param target The nonnull name of the object resolved relative to this context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @param filter The nonnull string filter (see RFC2254).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * @param filterArgs The possibly null array of arguments for the filter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * @param ctls   The possibly null search controls. If null, the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     *        search controls are used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @param l  The nonnull listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @exception NamingException If a problem was encountered while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * adding the listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @see EventContext#removeNamingListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @see javax.naming.directory.DirContext#search(javax.naming.Name, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    void addNamingListener(Name target, String filter, Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        SearchControls ctls, NamingListener l) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * Adds a listener for receiving naming events fired when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * objects identified by the search filter <tt>filter</tt>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * and filter arguments at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * object named by the string target name are modified.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * See the overload that accepts a <tt>Name</tt> for details of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * how this method behaves.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @param target The nonnull string name of the object resolved relative to this context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @param filter The nonnull string filter (see RFC2254).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @param filterArgs The possibly null array of arguments for the filter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @param ctls   The possibly null search controls. If null, the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *        search controls is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @param l  The nonnull listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @exception NamingException If a problem was encountered while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * adding the listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @see EventContext#removeNamingListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * @see javax.naming.directory.DirContext#search(java.lang.String, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls)      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    void addNamingListener(String target, String filter, Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        SearchControls ctls, NamingListener l) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
}