001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 */
026package org.opends.server.admin.std.server;
027
028
029
030import java.util.SortedSet;
031import org.forgerock.opendj.ldap.AddressMask;
032import org.opends.server.admin.Configuration;
033import org.opends.server.admin.server.ConfigurationChangeListener;
034
035
036
037/**
038 * A server-side interface for querying Connection Handler settings.
039 * <p>
040 * Connection Handlers are responsible for handling all interaction
041 * with the clients, including accepting the connections, reading
042 * requests, and sending responses.
043 */
044public interface ConnectionHandlerCfg extends Configuration {
045
046  /**
047   * Gets the configuration class associated with this Connection Handler.
048   *
049   * @return Returns the configuration class associated with this Connection Handler.
050   */
051  Class<? extends ConnectionHandlerCfg> configurationClass();
052
053
054
055  /**
056   * Register to be notified when this Connection Handler is changed.
057   *
058   * @param listener
059   *          The Connection Handler configuration change listener.
060   */
061  void addChangeListener(ConfigurationChangeListener<ConnectionHandlerCfg> listener);
062
063
064
065  /**
066   * Deregister an existing Connection Handler configuration change listener.
067   *
068   * @param listener
069   *          The Connection Handler configuration change listener.
070   */
071  void removeChangeListener(ConfigurationChangeListener<ConnectionHandlerCfg> listener);
072
073
074
075  /**
076   * Gets the "allowed-client" property.
077   * <p>
078   * Specifies a set of host names or address masks that determine the
079   * clients that are allowed to establish connections to this
080   * Connection Handler.
081   * <p>
082   * Valid values include a host name, a fully qualified domain name,
083   * a domain name, an IP address, or a subnetwork with subnetwork
084   * mask.
085   *
086   * @return Returns an unmodifiable set containing the values of the "allowed-client" property.
087   */
088  SortedSet<AddressMask> getAllowedClient();
089
090
091
092  /**
093   * Gets the "denied-client" property.
094   * <p>
095   * Specifies a set of host names or address masks that determine the
096   * clients that are not allowed to establish connections to this
097   * Connection Handler.
098   * <p>
099   * Valid values include a host name, a fully qualified domain name,
100   * a domain name, an IP address, or a subnetwork with subnetwork
101   * mask. If both allowed and denied client masks are defined and a
102   * client connection matches one or more masks in both lists, then
103   * the connection is denied. If only a denied list is specified, then
104   * any client not matching a mask in that list is allowed.
105   *
106   * @return Returns an unmodifiable set containing the values of the "denied-client" property.
107   */
108  SortedSet<AddressMask> getDeniedClient();
109
110
111
112  /**
113   * Gets the "enabled" property.
114   * <p>
115   * Indicates whether the Connection Handler is enabled.
116   *
117   * @return Returns the value of the "enabled" property.
118   */
119  boolean isEnabled();
120
121
122
123  /**
124   * Gets the "java-class" property.
125   * <p>
126   * Specifies the fully-qualified name of the Java class that
127   * provides the Connection Handler implementation.
128   *
129   * @return Returns the value of the "java-class" property.
130   */
131  String getJavaClass();
132
133}