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