Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import hudson.tasks.test.TestResult;
import jenkins.plugins.logstash.LogstashConfiguration;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
Expand All @@ -62,7 +63,7 @@
* @author Rusty Gerard
* @since 1.0.0
*/
public class BuildData {
public class BuildData implements Serializable {
// ISO 8601 date format
private final static Logger LOGGER = Logger.getLogger(MethodHandles.lookup().lookupClass().getCanonicalName());
public static class TestData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URI;
Expand All @@ -54,16 +55,19 @@

import jenkins.plugins.logstash.utils.SSLHelper;

import javax.annotation.CheckForNull;


/**
* Elastic Search Data Access Object.
*
* @author Liam Newman
* @since 1.0.4
*/
public class ElasticSearchDao extends AbstractLogstashIndexerDao {
public class ElasticSearchDao extends AbstractLogstashIndexerDao implements Serializable {

private final HttpClientBuilder clientBuilder;
@CheckForNull
private transient HttpClientBuilder clientBuilder;
private final URI uri;
private final String auth;
private final Range<Integer> successCodes = closedOpen(200,300);
Expand Down Expand Up @@ -106,7 +110,14 @@ public ElasticSearchDao(URI uri, String username, String password) {
auth = null;
}

clientBuilder = factory == null ? HttpClientBuilder.create() : factory;
clientBuilder = factory;
}

HttpClientBuilder clientBuilder() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instances of this class need to be thread safe, so I think it would be better to override readObject() instead

if (clientBuilder == null) {
clientBuilder = HttpClientBuilder.create();
}
return clientBuilder;
}


Expand Down