Skip to content

Commit 8ba1e60

Browse files
authored
Merge pull request #302 from dellgreen/dpg/refactor/301/httpclientinterface
Fixed #301 Decoupled JenkinsServer and JenkinsHttpClient
2 parents f9ed73c + bf35f47 commit 8ba1e60

File tree

8 files changed

+344
-149
lines changed

8 files changed

+344
-149
lines changed

ReleaseNotes.md

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
## Release 0.3.8 (NOT RELEASED YET)
44

55

6+
* [Fixed Issue 301][issue-301]
7+
8+
Decoupled JenkinsServer and JenkinsHttpClient by extracting JenkinsHttpClient
9+
methods into public interface so that different implementations can be plugged
10+
into JenkinsServer if required
11+
12+
613
* [Fixed Issue 298][issue-298]
714

815
Added Closeable support to JenkinsServer and JenkinsHttpClient so that

jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.google.common.collect.ImmutableMap;
2626
import com.google.common.collect.Maps;
2727
import com.offbytwo.jenkins.client.JenkinsHttpClient;
28+
import com.offbytwo.jenkins.client.JenkinsHttpConnection;
2829
import com.offbytwo.jenkins.client.util.EncodingUtils;
2930
import com.offbytwo.jenkins.client.util.UrlUtils;
3031
import com.offbytwo.jenkins.helper.JenkinsVersion;
@@ -51,7 +52,10 @@
5152
public class JenkinsServer implements Closeable {
5253
private final Logger LOGGER = LoggerFactory.getLogger(getClass());
5354

54-
private final JenkinsHttpClient client;
55+
/**
56+
* The transport client instance to use.
57+
*/
58+
private final JenkinsHttpConnection client;
5559

5660
/**
5761
* Create a new Jenkins server reference given only the server address
@@ -80,7 +84,7 @@ public JenkinsServer(URI serverUri, String username, String passwordOrToken) {
8084
*
8185
* @param client Specialized client to use.
8286
*/
83-
public JenkinsServer(JenkinsHttpClient client) {
87+
public JenkinsServer(final JenkinsHttpConnection client) {
8488
this.client = client;
8589
}
8690

0 commit comments

Comments
 (0)