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.opends.server.admin.std.server;
017
018
019
020import java.net.InetAddress;
021import java.util.SortedSet;
022import org.forgerock.opendj.ldap.DN;
023import org.opends.server.admin.server.ConfigurationChangeListener;
024import org.opends.server.admin.std.meta.HTTPConnectionHandlerCfgDefn.SSLClientAuthPolicy;
025
026
027
028/**
029 * A server-side interface for querying HTTP Connection Handler
030 * settings.
031 * <p>
032 * The HTTP Connection Handler is used to interact with clients using
033 * HTTP.
034 */
035public interface HTTPConnectionHandlerCfg extends ConnectionHandlerCfg {
036
037  /**
038   * Gets the configuration class associated with this HTTP Connection Handler.
039   *
040   * @return Returns the configuration class associated with this HTTP Connection Handler.
041   */
042  Class<? extends HTTPConnectionHandlerCfg> configurationClass();
043
044
045
046  /**
047   * Register to be notified when this HTTP Connection Handler is changed.
048   *
049   * @param listener
050   *          The HTTP Connection Handler configuration change listener.
051   */
052  void addHTTPChangeListener(ConfigurationChangeListener<HTTPConnectionHandlerCfg> listener);
053
054
055
056  /**
057   * Deregister an existing HTTP Connection Handler configuration change listener.
058   *
059   * @param listener
060   *          The HTTP Connection Handler configuration change listener.
061   */
062  void removeHTTPChangeListener(ConfigurationChangeListener<HTTPConnectionHandlerCfg> listener);
063
064
065
066  /**
067   * Gets the "accept-backlog" property.
068   * <p>
069   * Specifies the maximum number of pending connection attempts that
070   * are allowed to queue up in the accept backlog before the server
071   * starts rejecting new connection attempts.
072   * <p>
073   * This is primarily an issue for cases in which a large number of
074   * connections are established to the server in a very short period
075   * of time (for example, a benchmark utility that creates a large
076   * number of client threads that each have their own connection to
077   * the server) and the connection handler is unable to keep up with
078   * the rate at which the new connections are established.
079   *
080   * @return Returns the value of the "accept-backlog" property.
081   */
082  int getAcceptBacklog();
083
084
085
086  /**
087   * Gets the "allow-tcp-reuse-address" property.
088   * <p>
089   * Indicates whether the HTTP Connection Handler should reuse socket
090   * descriptors.
091   * <p>
092   * If enabled, the SO_REUSEADDR socket option is used on the server
093   * listen socket to potentially allow the reuse of socket descriptors
094   * for clients in a TIME_WAIT state. This may help the server avoid
095   * temporarily running out of socket descriptors in cases in which a
096   * very large number of short-lived connections have been established
097   * from the same client system.
098   *
099   * @return Returns the value of the "allow-tcp-reuse-address" property.
100   */
101  boolean isAllowTCPReuseAddress();
102
103
104
105  /**
106   * Gets the "authentication-required" property.
107   * <p>
108   * Specifies whether only authenticated requests can be processed by
109   * the HTTP Connection Handler.
110   * <p>
111   * If true, only authenticated requests will be processed by the
112   * HTTP Connection Handler. If false, both authenticated requests and
113   * unauthenticated requests will be processed. All requests are
114   * subject to ACI limitations and unauthenticated requests are
115   * subject to server limits like maximum number of entries returned.
116   * Note that setting ds-cfg-reject-unauthenticated-requests to true
117   * will override the current setting.
118   *
119   * @return Returns the value of the "authentication-required" property.
120   */
121  boolean isAuthenticationRequired();
122
123
124
125  /**
126   * Gets the "buffer-size" property.
127   * <p>
128   * Specifies the size in bytes of the HTTP response message write
129   * buffer.
130   * <p>
131   * This property specifies write buffer size allocated by the server
132   * for each client connection and used to buffer HTTP response
133   * messages data when writing.
134   *
135   * @return Returns the value of the "buffer-size" property.
136   */
137  long getBufferSize();
138
139
140
141  /**
142   * Gets the "config-file" property.
143   * <p>
144   * Specifies the name of the configuration file for the HTTP
145   * Connection Handler.
146   *
147   * @return Returns the value of the "config-file" property.
148   */
149  String getConfigFile();
150
151
152
153  /**
154   * Gets the "java-class" property.
155   * <p>
156   * Specifies the fully-qualified name of the Java class that
157   * provides the HTTP Connection Handler implementation.
158   *
159   * @return Returns the value of the "java-class" property.
160   */
161  String getJavaClass();
162
163
164
165  /**
166   * Gets the "keep-stats" property.
167   * <p>
168   * Indicates whether the HTTP Connection Handler should keep
169   * statistics.
170   * <p>
171   * If enabled, the HTTP Connection Handler maintains statistics
172   * about the number and types of operations requested over HTTP and
173   * the amount of data sent and received.
174   *
175   * @return Returns the value of the "keep-stats" property.
176   */
177  boolean isKeepStats();
178
179
180
181  /**
182   * Gets the "key-manager-provider" property.
183   * <p>
184   * Specifies the name of the key manager that should be used with
185   * this HTTP Connection Handler .
186   *
187   * @return Returns the value of the "key-manager-provider" property.
188   */
189  String getKeyManagerProvider();
190
191
192
193  /**
194   * Gets the "key-manager-provider" property as a DN.
195   * <p>
196   * Specifies the name of the key manager that should be used with
197   * this HTTP Connection Handler .
198   *
199   * @return Returns the DN value of the "key-manager-provider"
200   *         property.
201   */
202  DN getKeyManagerProviderDN();
203
204
205
206  /**
207   * Gets the "listen-address" property.
208   * <p>
209   * Specifies the address or set of addresses on which this HTTP
210   * Connection Handler should listen for connections from HTTP
211   * clients.
212   * <p>
213   * Multiple addresses may be provided as separate values for this
214   * attribute. If no values are provided, then the HTTP Connection
215   * Handler listens on all interfaces.
216   *
217   * @return Returns an unmodifiable set containing the values of the "listen-address" property.
218   */
219  SortedSet<InetAddress> getListenAddress();
220
221
222
223  /**
224   * Gets the "listen-port" property.
225   * <p>
226   * Specifies the port number on which the HTTP Connection Handler
227   * will listen for connections from clients.
228   * <p>
229   * Only a single port number may be provided.
230   *
231   * @return Returns the value of the "listen-port" property.
232   */
233  int getListenPort();
234
235
236
237  /**
238   * Gets the "max-blocked-write-time-limit" property.
239   * <p>
240   * Specifies the maximum length of time that attempts to write data
241   * to HTTP clients should be allowed to block.
242   * <p>
243   * If an attempt to write data to a client takes longer than this
244   * length of time, then the client connection is terminated.
245   *
246   * @return Returns the value of the "max-blocked-write-time-limit" property.
247   */
248  long getMaxBlockedWriteTimeLimit();
249
250
251
252  /**
253   * Gets the "max-concurrent-ops-per-connection" property.
254   * <p>
255   * Specifies the maximum number of internal operations that each
256   * HTTP client connection can execute concurrently.
257   * <p>
258   * This property allow to limit the impact that each HTTP request
259   * can have on the whole server by limiting the number of internal
260   * operations that each HTTP request can execute concurrently. A
261   * value of 0 means that no limit is enforced.
262   *
263   * @return Returns the value of the "max-concurrent-ops-per-connection" property.
264   */
265  Integer getMaxConcurrentOpsPerConnection();
266
267
268
269  /**
270   * Gets the "max-request-size" property.
271   * <p>
272   * Specifies the size in bytes of the largest HTTP request message
273   * that will be allowed by the HTTP Connection Handler.
274   * <p>
275   * This can help prevent denial-of-service attacks by clients that
276   * indicate they send extremely large requests to the server causing
277   * it to attempt to allocate large amounts of memory.
278   *
279   * @return Returns the value of the "max-request-size" property.
280   */
281  long getMaxRequestSize();
282
283
284
285  /**
286   * Gets the "num-request-handlers" property.
287   * <p>
288   * Specifies the number of request handlers that are used to read
289   * requests from clients.
290   * <p>
291   * The HTTP Connection Handler uses one thread to accept new
292   * connections from clients, but uses one or more additional threads
293   * to read requests from existing client connections. This ensures
294   * that new requests are read efficiently and that the connection
295   * handler itself does not become a bottleneck when the server is
296   * under heavy load from many clients at the same time.
297   *
298   * @return Returns the value of the "num-request-handlers" property.
299   */
300  Integer getNumRequestHandlers();
301
302
303
304  /**
305   * Gets the "ssl-cert-nickname" property.
306   * <p>
307   * Specifies the nicknames (also called the aliases) of the
308   * certificates that the HTTP Connection Handler should use when
309   * performing SSL communication. The property can be used multiple
310   * times (referencing different nicknames) when an RSA, a DSA, and an
311   * ECC based server certificate is used in parallel.
312   * <p>
313   * This is only applicable when the HTTP Connection Handler is
314   * configured to use SSL.
315   *
316   * @return Returns an unmodifiable set containing the values of the "ssl-cert-nickname" property.
317   */
318  SortedSet<String> getSSLCertNickname();
319
320
321
322  /**
323   * Gets the "ssl-cipher-suite" property.
324   * <p>
325   * Specifies the names of the SSL cipher suites that are allowed for
326   * use in SSL communication.
327   *
328   * @return Returns an unmodifiable set containing the values of the "ssl-cipher-suite" property.
329   */
330  SortedSet<String> getSSLCipherSuite();
331
332
333
334  /**
335   * Gets the "ssl-client-auth-policy" property.
336   * <p>
337   * Specifies the policy that the HTTP Connection Handler should use
338   * regarding client SSL certificates. Clients can use the SASL
339   * EXTERNAL mechanism only if the policy is set to "optional" or
340   * "required".
341   * <p>
342   * This is only applicable if clients are allowed to use SSL.
343   *
344   * @return Returns the value of the "ssl-client-auth-policy" property.
345   */
346  SSLClientAuthPolicy getSSLClientAuthPolicy();
347
348
349
350  /**
351   * Gets the "ssl-protocol" property.
352   * <p>
353   * Specifies the names of the SSL protocols that are allowed for use
354   * in SSL communication.
355   *
356   * @return Returns an unmodifiable set containing the values of the "ssl-protocol" property.
357   */
358  SortedSet<String> getSSLProtocol();
359
360
361
362  /**
363   * Gets the "trust-manager-provider" property.
364   * <p>
365   * Specifies the name of the trust manager that should be used with
366   * the HTTP Connection Handler .
367   *
368   * @return Returns the value of the "trust-manager-provider" property.
369   */
370  String getTrustManagerProvider();
371
372
373
374  /**
375   * Gets the "trust-manager-provider" property as a DN.
376   * <p>
377   * Specifies the name of the trust manager that should be used with
378   * the HTTP Connection Handler .
379   *
380   * @return Returns the DN value of the "trust-manager-provider"
381   *         property.
382   */
383  DN getTrustManagerProviderDN();
384
385
386
387  /**
388   * Gets the "use-ssl" property.
389   * <p>
390   * Indicates whether the HTTP Connection Handler should use SSL.
391   * <p>
392   * If enabled, the HTTP Connection Handler will use SSL to encrypt
393   * communication with the clients.
394   *
395   * @return Returns the value of the "use-ssl" property.
396   */
397  boolean isUseSSL();
398
399
400
401  /**
402   * Gets the "use-tcp-keep-alive" property.
403   * <p>
404   * Indicates whether the HTTP Connection Handler should use TCP
405   * keep-alive.
406   * <p>
407   * If enabled, the SO_KEEPALIVE socket option is used to indicate
408   * that TCP keepalive messages should periodically be sent to the
409   * client to verify that the associated connection is still valid.
410   * This may also help prevent cases in which intermediate network
411   * hardware could silently drop an otherwise idle client connection,
412   * provided that the keepalive interval configured in the underlying
413   * operating system is smaller than the timeout enforced by the
414   * network hardware.
415   *
416   * @return Returns the value of the "use-tcp-keep-alive" property.
417   */
418  boolean isUseTCPKeepAlive();
419
420
421
422  /**
423   * Gets the "use-tcp-no-delay" property.
424   * <p>
425   * Indicates whether the HTTP Connection Handler should use TCP
426   * no-delay.
427   * <p>
428   * If enabled, the TCP_NODELAY socket option is used to ensure that
429   * response messages to the client are sent immediately rather than
430   * potentially waiting to determine whether additional response
431   * messages can be sent in the same packet. In most cases, using the
432   * TCP_NODELAY socket option provides better performance and lower
433   * response times, but disabling it may help for some cases in which
434   * the server sends a large number of entries to a client in response
435   * to a search request.
436   *
437   * @return Returns the value of the "use-tcp-no-delay" property.
438   */
439  boolean isUseTCPNoDelay();
440
441}