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.client;
017
018
019
020import java.net.InetAddress;
021import java.util.Collection;
022import java.util.SortedSet;
023import org.opends.server.admin.ManagedObjectDefinition;
024import org.opends.server.admin.PropertyException;
025import org.opends.server.admin.std.meta.HTTPConnectionHandlerCfgDefn.SSLClientAuthPolicy;
026import org.opends.server.admin.std.server.HTTPConnectionHandlerCfg;
027
028
029
030/**
031 * A client-side interface for reading and modifying HTTP Connection
032 * Handler settings.
033 * <p>
034 * The HTTP Connection Handler is used to interact with clients using
035 * HTTP.
036 */
037public interface HTTPConnectionHandlerCfgClient extends ConnectionHandlerCfgClient {
038
039  /**
040   * Get the configuration definition associated with this HTTP Connection Handler.
041   *
042   * @return Returns the configuration definition associated with this HTTP Connection Handler.
043   */
044  ManagedObjectDefinition<? extends HTTPConnectionHandlerCfgClient, ? extends HTTPConnectionHandlerCfg> definition();
045
046
047
048  /**
049   * Gets the "accept-backlog" property.
050   * <p>
051   * Specifies the maximum number of pending connection attempts that
052   * are allowed to queue up in the accept backlog before the server
053   * starts rejecting new connection attempts.
054   * <p>
055   * This is primarily an issue for cases in which a large number of
056   * connections are established to the server in a very short period
057   * of time (for example, a benchmark utility that creates a large
058   * number of client threads that each have their own connection to
059   * the server) and the connection handler is unable to keep up with
060   * the rate at which the new connections are established.
061   *
062   * @return Returns the value of the "accept-backlog" property.
063   */
064  int getAcceptBacklog();
065
066
067
068  /**
069   * Sets the "accept-backlog" property.
070   * <p>
071   * Specifies the maximum number of pending connection attempts that
072   * are allowed to queue up in the accept backlog before the server
073   * starts rejecting new connection attempts.
074   * <p>
075   * This is primarily an issue for cases in which a large number of
076   * connections are established to the server in a very short period
077   * of time (for example, a benchmark utility that creates a large
078   * number of client threads that each have their own connection to
079   * the server) and the connection handler is unable to keep up with
080   * the rate at which the new connections are established.
081   *
082   * @param value The value of the "accept-backlog" property.
083   * @throws PropertyException
084   *           If the new value is invalid.
085   */
086  void setAcceptBacklog(Integer value) throws PropertyException;
087
088
089
090  /**
091   * Gets the "allow-tcp-reuse-address" property.
092   * <p>
093   * Indicates whether the HTTP Connection Handler should reuse socket
094   * descriptors.
095   * <p>
096   * If enabled, the SO_REUSEADDR socket option is used on the server
097   * listen socket to potentially allow the reuse of socket descriptors
098   * for clients in a TIME_WAIT state. This may help the server avoid
099   * temporarily running out of socket descriptors in cases in which a
100   * very large number of short-lived connections have been established
101   * from the same client system.
102   *
103   * @return Returns the value of the "allow-tcp-reuse-address" property.
104   */
105  boolean isAllowTCPReuseAddress();
106
107
108
109  /**
110   * Sets the "allow-tcp-reuse-address" property.
111   * <p>
112   * Indicates whether the HTTP Connection Handler should reuse socket
113   * descriptors.
114   * <p>
115   * If enabled, the SO_REUSEADDR socket option is used on the server
116   * listen socket to potentially allow the reuse of socket descriptors
117   * for clients in a TIME_WAIT state. This may help the server avoid
118   * temporarily running out of socket descriptors in cases in which a
119   * very large number of short-lived connections have been established
120   * from the same client system.
121   *
122   * @param value The value of the "allow-tcp-reuse-address" property.
123   * @throws PropertyException
124   *           If the new value is invalid.
125   */
126  void setAllowTCPReuseAddress(Boolean value) throws PropertyException;
127
128
129
130  /**
131   * Gets the "authentication-required" property.
132   * <p>
133   * Specifies whether only authenticated requests can be processed by
134   * the HTTP Connection Handler.
135   * <p>
136   * If true, only authenticated requests will be processed by the
137   * HTTP Connection Handler. If false, both authenticated requests and
138   * unauthenticated requests will be processed. All requests are
139   * subject to ACI limitations and unauthenticated requests are
140   * subject to server limits like maximum number of entries returned.
141   * Note that setting ds-cfg-reject-unauthenticated-requests to true
142   * will override the current setting.
143   *
144   * @return Returns the value of the "authentication-required" property.
145   */
146  boolean isAuthenticationRequired();
147
148
149
150  /**
151   * Sets the "authentication-required" property.
152   * <p>
153   * Specifies whether only authenticated requests can be processed by
154   * the HTTP Connection Handler.
155   * <p>
156   * If true, only authenticated requests will be processed by the
157   * HTTP Connection Handler. If false, both authenticated requests and
158   * unauthenticated requests will be processed. All requests are
159   * subject to ACI limitations and unauthenticated requests are
160   * subject to server limits like maximum number of entries returned.
161   * Note that setting ds-cfg-reject-unauthenticated-requests to true
162   * will override the current setting.
163   *
164   * @param value The value of the "authentication-required" property.
165   * @throws PropertyException
166   *           If the new value is invalid.
167   */
168  void setAuthenticationRequired(boolean value) throws PropertyException;
169
170
171
172  /**
173   * Gets the "buffer-size" property.
174   * <p>
175   * Specifies the size in bytes of the HTTP response message write
176   * buffer.
177   * <p>
178   * This property specifies write buffer size allocated by the server
179   * for each client connection and used to buffer HTTP response
180   * messages data when writing.
181   *
182   * @return Returns the value of the "buffer-size" property.
183   */
184  long getBufferSize();
185
186
187
188  /**
189   * Sets the "buffer-size" property.
190   * <p>
191   * Specifies the size in bytes of the HTTP response message write
192   * buffer.
193   * <p>
194   * This property specifies write buffer size allocated by the server
195   * for each client connection and used to buffer HTTP response
196   * messages data when writing.
197   *
198   * @param value The value of the "buffer-size" property.
199   * @throws PropertyException
200   *           If the new value is invalid.
201   */
202  void setBufferSize(Long value) throws PropertyException;
203
204
205
206  /**
207   * Gets the "config-file" property.
208   * <p>
209   * Specifies the name of the configuration file for the HTTP
210   * Connection Handler.
211   *
212   * @return Returns the value of the "config-file" property.
213   */
214  String getConfigFile();
215
216
217
218  /**
219   * Sets the "config-file" property.
220   * <p>
221   * Specifies the name of the configuration file for the HTTP
222   * Connection Handler.
223   *
224   * @param value The value of the "config-file" property.
225   * @throws PropertyException
226   *           If the new value is invalid.
227   */
228  void setConfigFile(String value) throws PropertyException;
229
230
231
232  /**
233   * Gets the "java-class" property.
234   * <p>
235   * Specifies the fully-qualified name of the Java class that
236   * provides the HTTP Connection Handler implementation.
237   *
238   * @return Returns the value of the "java-class" property.
239   */
240  String getJavaClass();
241
242
243
244  /**
245   * Sets the "java-class" property.
246   * <p>
247   * Specifies the fully-qualified name of the Java class that
248   * provides the HTTP Connection Handler implementation.
249   *
250   * @param value The value of the "java-class" property.
251   * @throws PropertyException
252   *           If the new value is invalid.
253   */
254  void setJavaClass(String value) throws PropertyException;
255
256
257
258  /**
259   * Gets the "keep-stats" property.
260   * <p>
261   * Indicates whether the HTTP Connection Handler should keep
262   * statistics.
263   * <p>
264   * If enabled, the HTTP Connection Handler maintains statistics
265   * about the number and types of operations requested over HTTP and
266   * the amount of data sent and received.
267   *
268   * @return Returns the value of the "keep-stats" property.
269   */
270  boolean isKeepStats();
271
272
273
274  /**
275   * Sets the "keep-stats" property.
276   * <p>
277   * Indicates whether the HTTP Connection Handler should keep
278   * statistics.
279   * <p>
280   * If enabled, the HTTP Connection Handler maintains statistics
281   * about the number and types of operations requested over HTTP and
282   * the amount of data sent and received.
283   *
284   * @param value The value of the "keep-stats" property.
285   * @throws PropertyException
286   *           If the new value is invalid.
287   */
288  void setKeepStats(Boolean value) throws PropertyException;
289
290
291
292  /**
293   * Gets the "key-manager-provider" property.
294   * <p>
295   * Specifies the name of the key manager that should be used with
296   * this HTTP Connection Handler .
297   *
298   * @return Returns the value of the "key-manager-provider" property.
299   */
300  String getKeyManagerProvider();
301
302
303
304  /**
305   * Sets the "key-manager-provider" property.
306   * <p>
307   * Specifies the name of the key manager that should be used with
308   * this HTTP Connection Handler .
309   *
310   * @param value The value of the "key-manager-provider" property.
311   * @throws PropertyException
312   *           If the new value is invalid.
313   */
314  void setKeyManagerProvider(String value) throws PropertyException;
315
316
317
318  /**
319   * Gets the "listen-address" property.
320   * <p>
321   * Specifies the address or set of addresses on which this HTTP
322   * Connection Handler should listen for connections from HTTP
323   * clients.
324   * <p>
325   * Multiple addresses may be provided as separate values for this
326   * attribute. If no values are provided, then the HTTP Connection
327   * Handler listens on all interfaces.
328   *
329   * @return Returns the values of the "listen-address" property.
330   */
331  SortedSet<InetAddress> getListenAddress();
332
333
334
335  /**
336   * Sets the "listen-address" property.
337   * <p>
338   * Specifies the address or set of addresses on which this HTTP
339   * Connection Handler should listen for connections from HTTP
340   * clients.
341   * <p>
342   * Multiple addresses may be provided as separate values for this
343   * attribute. If no values are provided, then the HTTP Connection
344   * Handler listens on all interfaces.
345   *
346   * @param values The values of the "listen-address" property.
347   * @throws PropertyException
348   *           If one or more of the new values are invalid.
349   */
350  void setListenAddress(Collection<InetAddress> values) throws PropertyException;
351
352
353
354  /**
355   * Gets the "listen-port" property.
356   * <p>
357   * Specifies the port number on which the HTTP Connection Handler
358   * will listen for connections from clients.
359   * <p>
360   * Only a single port number may be provided.
361   *
362   * @return Returns the value of the "listen-port" property.
363   */
364  Integer getListenPort();
365
366
367
368  /**
369   * Sets the "listen-port" property.
370   * <p>
371   * Specifies the port number on which the HTTP Connection Handler
372   * will listen for connections from clients.
373   * <p>
374   * Only a single port number may be provided.
375   *
376   * @param value The value of the "listen-port" property.
377   * @throws PropertyException
378   *           If the new value is invalid.
379   */
380  void setListenPort(int value) throws PropertyException;
381
382
383
384  /**
385   * Gets the "max-blocked-write-time-limit" property.
386   * <p>
387   * Specifies the maximum length of time that attempts to write data
388   * to HTTP clients should be allowed to block.
389   * <p>
390   * If an attempt to write data to a client takes longer than this
391   * length of time, then the client connection is terminated.
392   *
393   * @return Returns the value of the "max-blocked-write-time-limit" property.
394   */
395  long getMaxBlockedWriteTimeLimit();
396
397
398
399  /**
400   * Sets the "max-blocked-write-time-limit" property.
401   * <p>
402   * Specifies the maximum length of time that attempts to write data
403   * to HTTP clients should be allowed to block.
404   * <p>
405   * If an attempt to write data to a client takes longer than this
406   * length of time, then the client connection is terminated.
407   *
408   * @param value The value of the "max-blocked-write-time-limit" property.
409   * @throws PropertyException
410   *           If the new value is invalid.
411   */
412  void setMaxBlockedWriteTimeLimit(Long value) throws PropertyException;
413
414
415
416  /**
417   * Gets the "max-concurrent-ops-per-connection" property.
418   * <p>
419   * Specifies the maximum number of internal operations that each
420   * HTTP client connection can execute concurrently.
421   * <p>
422   * This property allow to limit the impact that each HTTP request
423   * can have on the whole server by limiting the number of internal
424   * operations that each HTTP request can execute concurrently. A
425   * value of 0 means that no limit is enforced.
426   *
427   * @return Returns the value of the "max-concurrent-ops-per-connection" property.
428   */
429  Integer getMaxConcurrentOpsPerConnection();
430
431
432
433  /**
434   * Sets the "max-concurrent-ops-per-connection" property.
435   * <p>
436   * Specifies the maximum number of internal operations that each
437   * HTTP client connection can execute concurrently.
438   * <p>
439   * This property allow to limit the impact that each HTTP request
440   * can have on the whole server by limiting the number of internal
441   * operations that each HTTP request can execute concurrently. A
442   * value of 0 means that no limit is enforced.
443   *
444   * @param value The value of the "max-concurrent-ops-per-connection" property.
445   * @throws PropertyException
446   *           If the new value is invalid.
447   */
448  void setMaxConcurrentOpsPerConnection(Integer value) throws PropertyException;
449
450
451
452  /**
453   * Gets the "max-request-size" property.
454   * <p>
455   * Specifies the size in bytes of the largest HTTP request message
456   * that will be allowed by the HTTP Connection Handler.
457   * <p>
458   * This can help prevent denial-of-service attacks by clients that
459   * indicate they send extremely large requests to the server causing
460   * it to attempt to allocate large amounts of memory.
461   *
462   * @return Returns the value of the "max-request-size" property.
463   */
464  long getMaxRequestSize();
465
466
467
468  /**
469   * Sets the "max-request-size" property.
470   * <p>
471   * Specifies the size in bytes of the largest HTTP request message
472   * that will be allowed by the HTTP Connection Handler.
473   * <p>
474   * This can help prevent denial-of-service attacks by clients that
475   * indicate they send extremely large requests to the server causing
476   * it to attempt to allocate large amounts of memory.
477   *
478   * @param value The value of the "max-request-size" property.
479   * @throws PropertyException
480   *           If the new value is invalid.
481   */
482  void setMaxRequestSize(Long value) throws PropertyException;
483
484
485
486  /**
487   * Gets the "num-request-handlers" property.
488   * <p>
489   * Specifies the number of request handlers that are used to read
490   * requests from clients.
491   * <p>
492   * The HTTP Connection Handler uses one thread to accept new
493   * connections from clients, but uses one or more additional threads
494   * to read requests from existing client connections. This ensures
495   * that new requests are read efficiently and that the connection
496   * handler itself does not become a bottleneck when the server is
497   * under heavy load from many clients at the same time.
498   *
499   * @return Returns the value of the "num-request-handlers" property.
500   */
501  Integer getNumRequestHandlers();
502
503
504
505  /**
506   * Sets the "num-request-handlers" property.
507   * <p>
508   * Specifies the number of request handlers that are used to read
509   * requests from clients.
510   * <p>
511   * The HTTP Connection Handler uses one thread to accept new
512   * connections from clients, but uses one or more additional threads
513   * to read requests from existing client connections. This ensures
514   * that new requests are read efficiently and that the connection
515   * handler itself does not become a bottleneck when the server is
516   * under heavy load from many clients at the same time.
517   *
518   * @param value The value of the "num-request-handlers" property.
519   * @throws PropertyException
520   *           If the new value is invalid.
521   */
522  void setNumRequestHandlers(Integer value) throws PropertyException;
523
524
525
526  /**
527   * Gets the "ssl-cert-nickname" property.
528   * <p>
529   * Specifies the nicknames (also called the aliases) of the
530   * certificates that the HTTP Connection Handler should use when
531   * performing SSL communication. The property can be used multiple
532   * times (referencing different nicknames) when an RSA, a DSA, and an
533   * ECC based server certificate is used in parallel.
534   * <p>
535   * This is only applicable when the HTTP Connection Handler is
536   * configured to use SSL.
537   *
538   * @return Returns the values of the "ssl-cert-nickname" property.
539   */
540  SortedSet<String> getSSLCertNickname();
541
542
543
544  /**
545   * Sets the "ssl-cert-nickname" property.
546   * <p>
547   * Specifies the nicknames (also called the aliases) of the
548   * certificates that the HTTP Connection Handler should use when
549   * performing SSL communication. The property can be used multiple
550   * times (referencing different nicknames) when an RSA, a DSA, and an
551   * ECC based server certificate is used in parallel.
552   * <p>
553   * This is only applicable when the HTTP Connection Handler is
554   * configured to use SSL.
555   *
556   * @param values The values of the "ssl-cert-nickname" property.
557   * @throws PropertyException
558   *           If one or more of the new values are invalid.
559   */
560  void setSSLCertNickname(Collection<String> values) throws PropertyException;
561
562
563
564  /**
565   * Gets the "ssl-cipher-suite" property.
566   * <p>
567   * Specifies the names of the SSL cipher suites that are allowed for
568   * use in SSL communication.
569   *
570   * @return Returns the values of the "ssl-cipher-suite" property.
571   */
572  SortedSet<String> getSSLCipherSuite();
573
574
575
576  /**
577   * Sets the "ssl-cipher-suite" property.
578   * <p>
579   * Specifies the names of the SSL cipher suites that are allowed for
580   * use in SSL communication.
581   *
582   * @param values The values of the "ssl-cipher-suite" property.
583   * @throws PropertyException
584   *           If one or more of the new values are invalid.
585   */
586  void setSSLCipherSuite(Collection<String> values) throws PropertyException;
587
588
589
590  /**
591   * Gets the "ssl-client-auth-policy" property.
592   * <p>
593   * Specifies the policy that the HTTP Connection Handler should use
594   * regarding client SSL certificates. Clients can use the SASL
595   * EXTERNAL mechanism only if the policy is set to "optional" or
596   * "required".
597   * <p>
598   * This is only applicable if clients are allowed to use SSL.
599   *
600   * @return Returns the value of the "ssl-client-auth-policy" property.
601   */
602  SSLClientAuthPolicy getSSLClientAuthPolicy();
603
604
605
606  /**
607   * Sets the "ssl-client-auth-policy" property.
608   * <p>
609   * Specifies the policy that the HTTP Connection Handler should use
610   * regarding client SSL certificates. Clients can use the SASL
611   * EXTERNAL mechanism only if the policy is set to "optional" or
612   * "required".
613   * <p>
614   * This is only applicable if clients are allowed to use SSL.
615   *
616   * @param value The value of the "ssl-client-auth-policy" property.
617   * @throws PropertyException
618   *           If the new value is invalid.
619   */
620  void setSSLClientAuthPolicy(SSLClientAuthPolicy value) throws PropertyException;
621
622
623
624  /**
625   * Gets the "ssl-protocol" property.
626   * <p>
627   * Specifies the names of the SSL protocols that are allowed for use
628   * in SSL communication.
629   *
630   * @return Returns the values of the "ssl-protocol" property.
631   */
632  SortedSet<String> getSSLProtocol();
633
634
635
636  /**
637   * Sets the "ssl-protocol" property.
638   * <p>
639   * Specifies the names of the SSL protocols that are allowed for use
640   * in SSL communication.
641   *
642   * @param values The values of the "ssl-protocol" property.
643   * @throws PropertyException
644   *           If one or more of the new values are invalid.
645   */
646  void setSSLProtocol(Collection<String> values) throws PropertyException;
647
648
649
650  /**
651   * Gets the "trust-manager-provider" property.
652   * <p>
653   * Specifies the name of the trust manager that should be used with
654   * the HTTP Connection Handler .
655   *
656   * @return Returns the value of the "trust-manager-provider" property.
657   */
658  String getTrustManagerProvider();
659
660
661
662  /**
663   * Sets the "trust-manager-provider" property.
664   * <p>
665   * Specifies the name of the trust manager that should be used with
666   * the HTTP Connection Handler .
667   *
668   * @param value The value of the "trust-manager-provider" property.
669   * @throws PropertyException
670   *           If the new value is invalid.
671   */
672  void setTrustManagerProvider(String value) throws PropertyException;
673
674
675
676  /**
677   * Gets the "use-ssl" property.
678   * <p>
679   * Indicates whether the HTTP Connection Handler should use SSL.
680   * <p>
681   * If enabled, the HTTP Connection Handler will use SSL to encrypt
682   * communication with the clients.
683   *
684   * @return Returns the value of the "use-ssl" property.
685   */
686  boolean isUseSSL();
687
688
689
690  /**
691   * Sets the "use-ssl" property.
692   * <p>
693   * Indicates whether the HTTP Connection Handler should use SSL.
694   * <p>
695   * If enabled, the HTTP Connection Handler will use SSL to encrypt
696   * communication with the clients.
697   *
698   * @param value The value of the "use-ssl" property.
699   * @throws PropertyException
700   *           If the new value is invalid.
701   */
702  void setUseSSL(Boolean value) throws PropertyException;
703
704
705
706  /**
707   * Gets the "use-tcp-keep-alive" property.
708   * <p>
709   * Indicates whether the HTTP Connection Handler should use TCP
710   * keep-alive.
711   * <p>
712   * If enabled, the SO_KEEPALIVE socket option is used to indicate
713   * that TCP keepalive messages should periodically be sent to the
714   * client to verify that the associated connection is still valid.
715   * This may also help prevent cases in which intermediate network
716   * hardware could silently drop an otherwise idle client connection,
717   * provided that the keepalive interval configured in the underlying
718   * operating system is smaller than the timeout enforced by the
719   * network hardware.
720   *
721   * @return Returns the value of the "use-tcp-keep-alive" property.
722   */
723  boolean isUseTCPKeepAlive();
724
725
726
727  /**
728   * Sets the "use-tcp-keep-alive" property.
729   * <p>
730   * Indicates whether the HTTP Connection Handler should use TCP
731   * keep-alive.
732   * <p>
733   * If enabled, the SO_KEEPALIVE socket option is used to indicate
734   * that TCP keepalive messages should periodically be sent to the
735   * client to verify that the associated connection is still valid.
736   * This may also help prevent cases in which intermediate network
737   * hardware could silently drop an otherwise idle client connection,
738   * provided that the keepalive interval configured in the underlying
739   * operating system is smaller than the timeout enforced by the
740   * network hardware.
741   *
742   * @param value The value of the "use-tcp-keep-alive" property.
743   * @throws PropertyException
744   *           If the new value is invalid.
745   */
746  void setUseTCPKeepAlive(Boolean value) throws PropertyException;
747
748
749
750  /**
751   * Gets the "use-tcp-no-delay" property.
752   * <p>
753   * Indicates whether the HTTP Connection Handler should use TCP
754   * no-delay.
755   * <p>
756   * If enabled, the TCP_NODELAY socket option is used to ensure that
757   * response messages to the client are sent immediately rather than
758   * potentially waiting to determine whether additional response
759   * messages can be sent in the same packet. In most cases, using the
760   * TCP_NODELAY socket option provides better performance and lower
761   * response times, but disabling it may help for some cases in which
762   * the server sends a large number of entries to a client in response
763   * to a search request.
764   *
765   * @return Returns the value of the "use-tcp-no-delay" property.
766   */
767  boolean isUseTCPNoDelay();
768
769
770
771  /**
772   * Sets the "use-tcp-no-delay" property.
773   * <p>
774   * Indicates whether the HTTP Connection Handler should use TCP
775   * no-delay.
776   * <p>
777   * If enabled, the TCP_NODELAY socket option is used to ensure that
778   * response messages to the client are sent immediately rather than
779   * potentially waiting to determine whether additional response
780   * messages can be sent in the same packet. In most cases, using the
781   * TCP_NODELAY socket option provides better performance and lower
782   * response times, but disabling it may help for some cases in which
783   * the server sends a large number of entries to a client in response
784   * to a search request.
785   *
786   * @param value The value of the "use-tcp-no-delay" property.
787   * @throws PropertyException
788   *           If the new value is invalid.
789   */
790  void setUseTCPNoDelay(Boolean value) throws PropertyException;
791
792}