Commit graph

329 commits

Author SHA1 Message Date
Nate Wolfe
acfe3f4806 (MAINT) Update CHANGELOG for 0.4.1 release 2015-01-26 10:48:14 -08:00
Jeremy Barlow
1c007767e3 Merge pull request #29 from nwolfe/svr101-update-jvm-ca-dependency
(SERVER-101) Update jvm-ca dependency
2015-01-26 10:41:20 -08:00
Nate Wolfe
e164bb12d7 (SERVER-101) Upgrade jvm-ca dependency to 0.7.0
This commit changes the usages to reflect the new name of the library
and API.
2015-01-23 17:33:02 -08:00
Nate Wolfe
017c950f60 (MAINT) Upgrade trapperkeeper dependency to 1.0.1 2015-01-23 15:10:26 -08:00
Nate Wolfe
e8546660e0 (MAINT) Upgrade kitchensink dependency to 1.0.0 2015-01-23 14:58:23 -08:00
Nate Wolfe
5d5dfa4f7f (MAINT) Add .lein-failures to .gitignore
This file is auto-generated during "lein test" and thus leaves the git
repo dirty after a test run. We can ignore this file.
2015-01-23 14:52:18 -08:00
Jeremy Barlow
3f51098b20 Merge pull request #28 from fpringvaldsen/TK-117-external-api-docs
(TK-117) Add external API docs
2014-12-23 09:01:18 -08:00
Preben Ingvaldsen
4eb10ea549 (TK-117) Address further PR comments
Make a number of minor cosmetic changes to address PR comments.
Document constructors for the SimpleRequestOptions class.
2014-12-19 13:21:36 -08:00
Preben Ingvaldsen
f92ff0396e (TK-117) Add javadoc strings
Add javadoc strings to each of the user-facing Java classes, and
reference those javadoc strings in the documentation on the
Java client.
2014-12-18 12:01:18 -08:00
Preben Ingvaldsen
494f806f14 (TK-117) Address PR comments
Expand discussion of the `close` function for clojure clients and
the `close` method for Java clients. Add examples for making
requests with various types of clients. Fix wording/typos.
2014-12-17 15:15:12 -08:00
Preben Ingvaldsen
8a3a675d3f (TK-117) Add external API docs
Add some external API docs in the doc folder which detail how
to make requests using the Java and clojure clients.
2014-12-16 11:40:25 -08:00
Jenkins CI
91e29aebeb lein-release plugin: bumped version from 0.4.0 to 0.4.1-SNAPSHOT for next development cycle 2014-11-17 15:54:26 -08:00
Jenkins CI
7e5729bffd lein-release plugin: preparing 0.4.0 release 2014-11-17 15:54:04 -08:00
Preben Ingvaldsen
69b8ae6c63 Merge pull request #27 from camlow325/maint/master/clj-http-client-0.4.0-release
(MAINT) Update CHANGELOG and project.clj for 0.4.0 release
2014-11-17 15:25:36 -08:00
Jeremy Barlow
74ef5ee0fc (MAINT) Update CHANGELOG and project.clj for 0.4.0 release 2014-11-17 14:04:56 -08:00
Preben Ingvaldsen
8d0fcdf713 Merge pull request #26 from camlow325/maint/master/TK-103-http-client-close-on-request-complete
(TK-103) Rework client close and remove support for "single request" async APIs
2014-11-17 10:34:02 -08:00
Jeremy Barlow
137ae4bd48 (TK-103) Restored redirect-test-async tests
This commit restores several of the `rediret-test-async` tests, using a
client to make the requests since the client-less single-request async
APIs are no longer available.
2014-11-15 14:37:00 -08:00
Jeremy Barlow
91f679a795 (TK-103) Restored query-params-test-async tests
This commit restores the `query-params-test-async` tests, using a client
to make the requests since the client-less single-request async APIs are
no longer available.
2014-11-14 15:54:02 -08:00
Jeremy Barlow
94379358ac (TK-103) More DRYing up and restored some options documentation
This commit removes the `request-with-reified-client` function in
async.clj in lieu of having clients just call the `request-with-client`
function.

This commit also restores documentation for the client and request
options to the `create-client` and `request-with-client` functions,
respectively.  The documentation includes some updates for newer options
which are supported but not were not included in the code currently on
the master branch.
2014-11-13 16:25:32 -08:00
Jeremy Barlow
22fffaa797 (TK-103) DRYed up Clojure client request
This commit removes some repeated code from the Clojure sync request
function and changes the surrounding try/catch/finally block to make use
of the Clojure `with-open` macro.
2014-11-12 14:42:16 -08:00
Jeremy Barlow
4e56352c44 (TK-103) Restore client close tests
This commit restores some of the client close tests which had been
disabled temporarily per some of the refactoring for TK-108.
2014-11-12 14:20:50 -08:00
Jeremy Barlow
e5f55affd3 (TK-103) Reworked sync single request APOIs to create and close client
For both the Clojure and Java single request APIs, the internal
implementation now creates an http client, makes a request on it, and
calls close on the client when done.  The close at the end avoids
resource leaks.

In support of this, the `JavaClient` class now requires the caller to
create an instance rather than just make a call to the static
`request` method on the `JavaClient` class.

The `coerceBodyType` method on the `JavaClient` class now closes the
body `InputStream` after coercing the stream content into a `String`.
This eliminates a possible resource leak and makes the Java-layer
coerce implementation consistent with the Clojure-layer coerce in
that the latter was already, via the use of the Clojure `slurp`
function, closing the stream content after coercing to `String`.
2014-11-12 14:11:16 -08:00
Jeremy Barlow
c1abea3e37 (TK-103) Remove AsyncClose class and references
This commit removes the `AsyncClose` class and references to it.  These
changes are in preparation for making the close call after the response
has been dereferenced - to be done in a later commit.  The `persistent`
flag/option was also removed from request handling as it will no longer
be used for determining whether or not the client should be closed
following a request.
2014-11-12 11:37:44 -08:00
Jeremy Barlow
d437646203 (TK-103) Remove non-client based async APIs
This commit removes the non-client based APIs for doing async requests.
2014-11-12 11:04:11 -08:00
Jeremy Barlow
5b7c465f4f Merge pull request #25 from fpringvaldsen/TK-108-java-persistent-client
(TK-108) Add support for persistent Java clients
2014-11-12 10:35:09 -08:00
Preben Ingvaldsen
74185ba3ab (TK-108) Remove method option accessors
Remove the accessor for the method option in SimpleRequestOptions
and RequestOptions, as it would always be overridden by whichever
Java request method was called by the user.
2014-11-12 09:32:21 -08:00
Preben Ingvaldsen
a6fb04697e (TK-108) Address PR comments
Remove the client option from SimpleRequestOptions and
RequestOptions as it was not being used. Correct initialization
of the Logger in various classes to use the correct class.
2014-11-11 12:08:01 -08:00
Preben Ingvaldsen
ff76e719b3 (TK-108) Separate SimpleRequestOptions in request
Separate SimpleRequestOptions in the JavaClient request() method,
rather than in every individual simple API function.
2014-11-11 09:57:27 -08:00
Preben Ingvaldsen
c77e449f11 (TK-108) Remove failing close test
Remove the tests to ensure that the persistent async and sync
Java clients close correctly due to a race condition that
was present in the tests.
2014-11-11 09:45:18 -08:00
Preben Ingvaldsen
fb6772b623 (TK-108) Return interface in createClient methods
Return interfaces in the createClient methods rather than the
implementation classes themselves.
2014-11-10 11:24:36 -08:00
Preben Ingvaldsen
8126f13100 (TK-108) Add SimpleRequestOptions class
Add SimpleRequestOptions class, which unifies the Client and
Request options under a single class used for the simple API
calls.
2014-11-10 11:05:15 -08:00
Preben Ingvaldsen
c6ce8dd301 (TK-108) Add a persistent sync Java client
Add a PersistentSyncHttpClient class, which is a wrapper around
CloseableHttpAsyncClient and allows multiple requests to be made
with a persistent synchronous client.
2014-11-10 10:08:13 -08:00
Preben Ingvaldsen
018fe70153 (TK-108) Add a persistent async Java client
Add a new class, PersistentAsyncHttpClient, that is a wrapped
CloseableHttpAsyncClient that is persistent.
2014-11-07 13:29:17 -08:00
Preben Ingvaldsen
972de1e9e9 (TK-108) Separate Java RequestOptions class
Separate the Java RequestOptions class into two new classes:
RequestOptions, which contains options related to the request,
and ClientOptions, which contains options related to the client.
Both are now required when calling the request methods in
AsyncHttpClient and SyncHttpClient.
2014-11-07 10:44:20 -08:00
Jenkins CI
6ec9d10867 lein-release plugin: bumped version from 0.3.1 to 0.3.2-SNAPSHOT for next development cycle 2014-10-22 16:22:43 -07:00
Jenkins CI
b9628bce0d lein-release plugin: preparing 0.3.1 release 2014-10-22 16:22:23 -07:00
Preben Ingvaldsen
631f26061f Update CHANGELOG for 0.3.1 release. 2014-10-22 16:21:09 -07:00
Kevin Corcoran
fa852c9b7c Merge pull request #21 from camlow325/bug/master/TK-101-clients-leaked-on-fail
(TK-101) Move closing of http clients to a separate thread
2014-10-21 15:36:35 -07:00
Jeremy Barlow
0ad887a589 Merge pull request #22 from cprice404/bug/master/TK-97-bug-in-tests-on-oraclejdk
(TK-97) Fix bug in tests on Oracle JDKs
2014-10-21 15:18:28 -07:00
Chris Price
b70ac50b17 (TK-97) Fix bug in tests on Oracle JDKs
The test code related to the configurable SSL protocols was
written using some ciphers that are available in OpenJDK, but
are not available by default in Oracle JDK.  This caused the
tests to fail on Oracle JDKs.

This commit changes the test to use some older ciphers that
are available in the Oracle JDK out of the box.
2014-10-21 15:08:15 -07:00
Jenkins CI
f447810c9d lein-release plugin: bumped version from 0.3.0 to 0.3.1-SNAPSHOT for next development cycle 2014-10-21 14:39:55 -07:00
Jenkins CI
dffa48cbc1 lein-release plugin: preparing 0.3.0 release 2014-10-21 14:39:35 -07:00
Preben Ingvaldsen
6815653183 Update CHANGELOG and version for 0.3.0 release 2014-10-21 14:34:26 -07:00
Jeremy Barlow
88fdad7c05 Merge pull request #20 from cprice404/feature/master/TK-97-configurable-ssl-protocols
(TK-97) configurable ssl protocols
2014-10-21 12:15:17 -07:00
Jeremy Barlow
cbeacd1860 (TK-101) Re-throw IOException from AsyncClose/close call
This commit rethrows any `IOException` caught on a closeable close call
made from the `AsyncClose` class.
2014-10-20 22:53:34 -07:00
Jeremy Barlow
f859bd907a (TK-101) Move closing of http clients to a separate thread
This commit moves each close call made on a `CloseableHttpAsyncClient`
from the thread on which the request callback is made over to a
different thread in order to avoid a deadlock.

Previously, the client close call was made in the context of thread from
which the callback was invoked.  The Apache HTTP async client library
makes these calls from one of its i/o reactor threads.  In the case of a
"failed" request, e.g., failure to make the client connection, this call
occurs in the context of the primary i/o reactor thread.  The client
close call does an indefinite join on the primary i/o reactor thread
and, therefore, this call causes a deadlock.  The client never closes
and all resources associated with it - threads, file descriptors, etc. -
remain open until the process is shutdown.

This commit introduces a new class, `AsyncClose`, which manages a small,
fixed size thread pool from which client close calls can be executed.
The `async` Clojure and `JavaClient` APIs were updated to use `AsyncClose`
whenever a client needs to be closed from a callback.
2014-10-20 14:22:56 -07:00
Chris Price
251d859d10 (TK-97) Expose configuration settings for protocols/cipher suites
This commit adds configuration settings for the SSL protocols
and cipher suites, in both the java and clojure clients.  It
also adds a list of default protocols which will be used if
the protocols setting is not explicitly set.
2014-10-17 23:35:05 -07:00
Chris Price
180a4bf78d (TK-97) Switch from .setSSLContext to .setSSLStrategy
Prior to this commit, we were using `HttpAsyncClientBuilder.setSSLContext`
to set up our HTTPS SSL configuration.  That method doesn't provide
a mechanism for specifying a list of acceptable protocols or ciphers.

This commit simply ports the code over to use `.setSSLStrategy`
instead, because it allows a larger number of configuration options.
2014-10-17 20:18:40 -07:00
Chris Price
2d0e45e9f8 (TK-97) DRY up client construction 2014-10-17 20:01:19 -07:00
Chris Price
c2cbb11d5d (TK-97) Update dependencies to latest versions
Update dependencies (trapperkeeper, trapperkeeper-webserver-jetty9,
etc.) to the latest versions and fix tests accordingly.
2014-10-17 19:50:08 -07:00