Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
- Remove redundant parentheses
- No need to nest into else clause
- Add missing @OverRide
  • Loading branch information
garydgregory committed Aug 26, 2024
1 parent 648690f commit a1eed80
Show file tree
Hide file tree
Showing 33 changed files with 382 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public interface AsyncExecCallback {
* @param entityDetails the response entity details or {@code null} if the response
* does not enclose an entity.
* @return the data consumer to be used for processing of incoming response message body.
* @throws HttpException If a protocol error occurs.
* @throws IOException If an I/O error occurs.
*/
AsyncDataConsumer handleResponse(
HttpResponse response,
Expand All @@ -58,6 +60,8 @@ AsyncDataConsumer handleResponse(
* Triggered to signal receipt of an intermediate response message.
*
* @param response the intermediate response message.
* @throws HttpException If a protocol error occurs.
* @throws IOException If an I/O error occurs.
*/
void handleInformationResponse(HttpResponse response) throws HttpException, IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public interface AsyncExecChainHandler {
* @param scope the execution scope .
* @param chain the next element in the request execution chain.
* @param asyncExecCallback the execution callback.
* @throws HttpException If a protocol error occurs.
* @throws IOException If an I/O error occurs.
*/
void execute(
HttpRequest request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ default void upgradeTls(HttpClientContext context,
}

/**
* Returns information about the underlying endpoint when connected or {@code null} otherwise.
* Gets information about the underlying endpoint when connected or {@code null} otherwise.
*
* @return the underlying endpoint or {@code null}
*/
default EndpointInfo getEndpointInfo() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public abstract class AbstractBinPushConsumer extends AbstractBinDataConsumer im
* @param response the response message head
* @param contentType the content type of the response body,
* or {@code null} if the response does not enclose a response entity.
* @throws HttpException If a protocol error occurs.
* @throws IOException If an I/O error occurs.
*/
protected abstract void start(HttpRequest promise, HttpResponse response, ContentType contentType) throws HttpException, IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public abstract class AbstractBinResponseConsumer<T> extends AbstractBinDataCons
* @param response the response message head
* @param contentType the content type of the response body,
* or {@code null} if the response does not enclose a response entity.
* @throws HttpException If a protocol error occurs.
* @throws IOException If an I/O error occurs.
*/
protected abstract void start(HttpResponse response, ContentType contentType) throws HttpException, IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ protected AbstractCharPushConsumer(final int bufSize,
* @param response the response message head
* @param contentType the content type of the response body,
* or {@code null} if the response does not enclose a response entity.
* @throws HttpException If a protocol error occurs.
* @throws IOException If an I/O error occurs.
*/
protected abstract void start(HttpRequest promise, HttpResponse response, ContentType contentType) throws HttpException, IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ protected AbstractCharResponseConsumer(final int bufSize,
* @param response the response message head
* @param contentType the content type of the response body,
* or {@code null} if the response does not enclose a response entity.
* @throws HttpException If a protocol error occurs.
* @throws IOException If an I/O error occurs.
*/
protected abstract void start(HttpResponse response, ContentType contentType) throws HttpException, IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,125 +65,280 @@ public static BasicHttpRequest create(final String method, final URI uri) {
return create(Method.normalizedValueOf(method), uri);
}

/**
* Creates a new DELETE {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest delete(final String uri) {
return delete(URI.create(uri));
}

/**
* Creates a new DELETE {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest delete(final URI uri) {
return create(Method.DELETE, uri);
}

/**
* Creates a new DELETE {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest delete(final HttpHost host, final String path) {
return create(Method.DELETE, host, path);
}

/**
* Creates a new GET {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest get(final String uri) {
return get(URI.create(uri));
}

/**
* Creates a new GET {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest get(final URI uri) {
return create(Method.GET, uri);
}

/**
* Creates a new HEAD {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest get(final HttpHost host, final String path) {
return create(Method.GET, host, path);
}

/**
* Creates a new HEAD {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest head(final String uri) {
return head(URI.create(uri));
}

/**
* Creates a new HEAD {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest head(final URI uri) {
return create(Method.HEAD, uri);
}

/**
* Creates a new HEAD {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest head(final HttpHost host, final String path) {
return create(Method.HEAD, host, path);
}

/**
* Creates a new OPTIONS {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest options(final String uri) {
return options(URI.create(uri));
}

/**
* Creates a new OPTIONS {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest options(final URI uri) {
return create(Method.OPTIONS, uri);
}

/**
* Creates a new OPTIONS {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest options(final HttpHost host, final String path) {
return create(Method.OPTIONS, host, path);
}

/**
* Creates a new PATCH {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest patch(final String uri) {
return patch(URI.create(uri));
}

/**
* Creates a new PATCH {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest patch(final URI uri) {
return create(Method.PATCH, uri);
}

/**
* Creates a new PATCH {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest patch(final HttpHost host, final String path) {
return create(Method.PATCH, host, path);
}

/**
* Creates a new POST {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest post(final String uri) {
return post(URI.create(uri));
}

/**
* Creates a new POST {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest post(final URI uri) {
return create(Method.POST, uri);
}

/**
* Creates a new POST {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest post(final HttpHost host, final String path) {
return create(Method.POST, host, path);
}

/**
* Creates a new PUT {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest put(final String uri) {
return put(URI.create(uri));
}

/**
* Creates a new PUT {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest put(final URI uri) {
return create(Method.PUT, uri);
}

/**
* Creates a new PUT {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest put(final HttpHost host, final String path) {
return create(Method.PUT, host, path);
}

/**
* Creates a new TRACE {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest trace(final String uri) {
return trace(URI.create(uri));
}

/**
* Creates a new TRACE {@link BasicHttpRequest}.
*
* @param uri a non-null URI.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest trace(final URI uri) {
return create(Method.TRACE, uri);
}

/**
* Creates a new TRACE {@link BasicHttpRequest}.
*
* @param host HTTP host.
* @param path request path.
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest trace(final HttpHost host, final String path) {
return create(Method.TRACE, host, path);
}

/**
* Creates a request object of the exact subclass of {@link BasicHttpRequest}.
* Creates a new {@link BasicHttpRequest}.
*
* @param method a non-null HTTP method.
* @param uri a non-null URI String.
* @return a new subclass of BasicHttpRequest
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest create(final Method method, final String uri) {
return create(method, URI.create(uri));
}

/**
* Creates a request object of the exact subclass of {@link BasicHttpRequest}.
* Creates a new {@link BasicHttpRequest}.
*
* @param method a non-null HTTP method.
* @param uri a non-null URI.
* @return a new subclass of BasicHttpRequest
* @return a new BasicHttpRequest
*/
public static BasicHttpRequest create(final Method method, final URI uri) {
return new BasicHttpRequest(method, uri);
}

/**
* Creates a request object of the exact subclass of {@link BasicHttpRequest}.
* Creates a new {@link BasicHttpRequest}.
*
* @param method a non-null HTTP method.
* @param host HTTP host.
* @param path request path.
* @return a new subclass of BasicHttpRequest
Expand Down
Loading

0 comments on commit a1eed80

Please sign in to comment.