Skip to content

Commit 84f4df1

Browse files
BCaxelbeckerhkernbach
authored andcommitted
add support for acquireHostListInterval (#280)
* add support for acquireHostListInterval * change loading defaults
1 parent 5924501 commit 84f4df1

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/main/java/com/arangodb/ArangoDB.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,18 @@ public Builder acquireHostList(final Boolean acquireHostList) {
263263
setAcquireHostList(acquireHostList);
264264
return this;
265265
}
266+
267+
/**
268+
* Setting the Interval for acquireHostList
269+
*
270+
* @param acquireHostListInterval Interval in Seconds
271+
*
272+
* @return {@link ArangoDB.Builder}
273+
*/
274+
public Builder acquireHostListInterval(final Integer acquireHostListInterval) {
275+
setAcquireHostListInterval(acquireHostListInterval);
276+
return this;
277+
}
266278

267279
/**
268280
* Sets the load balancing strategy to be used in an ArangoDB cluster setup.

src/main/java/com/arangodb/internal/InternalArangoDBBuilder.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,22 @@ public InternalArangoDBBuilder() {
115115
}
116116

117117
public InternalArangoDBBuilder loadProperties(final InputStream in) throws ArangoDBException {
118+
119+
final Properties properties = new Properties();
120+
118121
if (in != null) {
119-
final Properties properties = new Properties();
122+
120123
try {
121124
properties.load(in);
122-
loadProperties(properties);
123125
} catch (final IOException e) {
124126
throw new ArangoDBException(e);
125127
}
126128
}
129+
130+
loadProperties(properties);
131+
127132
return this;
133+
128134
}
129135

130136
protected void loadProperties(final Properties properties) {
@@ -185,6 +191,10 @@ protected void setAcquireHostList(final Boolean acquireHostList) {
185191
this.acquireHostList = acquireHostList;
186192
}
187193

194+
protected void setAcquireHostListInterval(final Integer acquireHostListInterval) {
195+
this.acquireHostListInterval = acquireHostListInterval;
196+
}
197+
188198
protected void setLoadBalancingStrategy(final LoadBalancingStrategy loadBalancingStrategy) {
189199
this.loadBalancingStrategy = loadBalancingStrategy;
190200
}

0 commit comments

Comments
 (0)