Provides implementations of the {@link net.jini.jeri.Endpoint} and {@link net.jini.jeri.ServerEndpoint} abstractions that use HTTP messages sent over TCP sockets as the underlying communication mechanism. {@link net.jini.jeri.http.HttpEndpoint} instances can be used by clients to initiate calls over HTTP; each instance contains the host name and TCP port number to which to connect, as well as an optional {@link javax.net.SocketFactory} for customizing the type of {@link java.net.Socket} to use. {@link net.jini.jeri.http.HttpServerEndpoint} instances are used to listen for and receive incoming calls over HTTP; each instance contains the name of the listening host and the number of the TCP port on which to listen, as well as an optional {@link javax.net.ServerSocketFactory} for customizing the type of {@link java.net.ServerSocket} to use.

Note that providing socket factories which produce SSL sockets does not result in endpoints which are fully HTTPS capable. HTTPS support is offered by the {@link net.jini.jeri.ssl} security provider.

## HTTP mapping

`HttpEndpoint` and `HttpServerEndpoint` map {@link net.jini.jeri.OutboundRequest} and {@link net.jini.jeri.InboundRequest} instances to HTTP request/response messages: request data is transmitted as the `entity-body` of an HTTP POST request, while response data is transmitted as the `entity-body` of the corresponding HTTP response message. When possible, HTTP 1.1 persistent connections and chunked transfer coding are employed. For information on HTTP, refer to RFC 2616.

## HTTP proxying

To determine whether or not requests should be sent through an HTTP proxy, `HttpEndpoint` consults the same set of system properties used by {@link java.net.HttpURLConnection}:

- `http.proxyHost`: if specified, the value of this property is interpreted as the host name of the HTTP proxy to use. If `http.proxyHost` is not specified, then the `proxyHost` system property is consulted as a fallback; if it is not specified either, then HTTP proxying is disabled (i.e., all HTTP messages are sent directly to the target host of the given `HttpEndpoint`).

- `http.proxyPort`: if `http.proxyHost` or `proxyHost` is set, then the (integer) value of `http.proxyPort` system property is used as the port number on which to connect to the HTTP proxy; if unspecified, then the `proxyPort` property is consulted as a fallback. If neither `http.proxyPort` nor `proxyPort` is specified (but `http.proxyHost` or `proxyHost` is), then the HTTP proxy port number defaults to 80.

- `http.nonProxyHosts`: if specified, the value of this property is interpreted as a list of host name patterns, each delimited by the '|' character. Individual host name patterns may be literal host names/addresses, or partial host names/addresses containing the '*' character as a wildcard. The '*' wildcard matches arbitrary (including zero-length) spans of characters. If `http.nonProxyHosts` is specified and the name of the target host for a given outbound message matches at least one of the patterns, then messages to that host will not be sent through the HTTP proxy.

The values of the system properties above are resampled for each new outbound HTTP message.

## HTTP authentication

`HttpEndpoint` supports both basic and digest HTTP authentication methods, specified in RFC 2617. Like `HttpURLConnection`, it obtains authentication parameters (e.g., username, password) from the {@link java.net.Authenticator} class.

## Constraint support

`TcpEndpoint` and `TcpServerEndpoint` support the transport layer aspects of at least the following constraints:

- any {@link net.jini.core.constraint.ConnectionAbsoluteTime}
- any {@link net.jini.core.constraint.ConnectionRelativeTime}
- a {@link net.jini.core.constraint.ConstraintAlternatives} if at least one element is supported
- {@link net.jini.core.constraint.Integrity#NO Integrity.NO}
- {@link net.jini.core.constraint.Confidentiality#NO Confidentiality.NO}
- {@link net.jini.core.constraint.ClientAuthentication#NO ClientAuthentication.NO}
- {@link net.jini.core.constraint.ServerAuthentication#NO ServerAuthentication.NO}
- {@link net.jini.core.constraint.Delegation#NO Delegation.NO}
- any {@link net.jini.core.constraint.ClientMaxPrincipal}
- any {@link net.jini.core.constraint.ClientMaxPrincipalType}
- any {@link net.jini.core.constraint.ClientMinPrincipal}
- any {@link net.jini.core.constraint.ClientMinPrincipalType}
- any {@link net.jini.core.constraint.ServerMinPrincipal}
- any {@link net.jini.core.constraint.DelegationAbsoluteTime}
- any {@link net.jini.core.constraint.DelegationRelativeTime}

(Note that `ClientMaxPricipal`, `ClientMaxPrincipalType`, `ClientMinPrincipal`, `ClientMinPrincipalType`, `ServerMinPrincipal`, `DelegationAbsoluteTime`, and `DelegationRelativeTime` constraints are trivially supported if `ClientAuthentication.YES`, `ServerAuthentication.YES`, and `Delegation.YES` are not supported.) @since 2.0 @com.sun.jini.impl

## Logging

This implementation uses the {@link java.util.logging.Logger} named `net.jini.jeri.http.client` to log information at the following levels:

{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | exceptions caught setting options on client-side sockets
{@link java.util.logging.Level#FINE FINE} | client-side socket operations (creation and close)

This implementation uses the {@link java.util.logging.Logger} named `net.jini.jeri.http.server` to log information at the following levels:

Level | Description
--- | ---
{@link java.util.logging.Level#INFO INFO} | exceptions accepting on server sockets
{@link com.sun.jini.logging.Levels#HANDLED HANDLED} | exceptions caught setting options on server-side sockets
{@link java.util.logging.Level#FINE FINE} | server-side socket operations (creation, accept, and close)

## System properties

In addition to the HTTP proxy-related system properties listed above, this implementation of `HttpEndpoint` and `HttpServerEndpoint` recognizes the following system properies:

- `com.sun.jini.jeri.http.idleConnectionTimeout` - The number of milliseconds to retain idle client-side HTTP connections before closing them. The default is `15000`.
- `com.sun.jini.jeri.http.idleServerConnectionTimeout` - The number of milliseconds to retain idle server-side HTTP connections before closing them. The default is the idle client-side connection timeout (as specified by the `com.sun.jini.jeri.http.idleConnectionTimeout` system property) plus `10000`.
- `com.sun.jini.jeri.http.responseAckTimeout` - The number of milliseconds to wait for acknowledgments from {@link net.jini.io.context.AcknowledgmentSource} instances. The default is `15000`.