separate to two methods, one taking single address and one taking a list
This commit is contained in:
parent
2d26cbcde3
commit
1e60f4b255
|
@ -199,8 +199,21 @@ public class TransportClient extends AbstractClient {
|
||||||
* <p/>
|
* <p/>
|
||||||
* <p>In order to get the list of all the current connected nodes, please see {@link #connectedNodes()}.
|
* <p>In order to get the list of all the current connected nodes, please see {@link #connectedNodes()}.
|
||||||
*/
|
*/
|
||||||
public TransportClient addTransportAddress(TransportAddress... transportAddress) {
|
public TransportClient addTransportAddress(TransportAddress transportAddress) {
|
||||||
nodesService.addTransportAddress(transportAddress);
|
nodesService.addTransportAddresses(transportAddress);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a list of transport addresses that will be used to connect to.
|
||||||
|
* <p/>
|
||||||
|
* <p>The Node this transport address represents will be used if its possible to connect to it.
|
||||||
|
* If it is unavailable, it will be automatically connected to once it is up.
|
||||||
|
* <p/>
|
||||||
|
* <p>In order to get the list of all the current connected nodes, please see {@link #connectedNodes()}.
|
||||||
|
*/
|
||||||
|
public TransportClient addTransportAddresses(TransportAddress... transportAddress) {
|
||||||
|
nodesService.addTransportAddresses(transportAddress);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class TransportClientNodesService extends AbstractComponent {
|
||||||
return this.listedNodes;
|
return this.listedNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TransportClientNodesService addTransportAddress(TransportAddress... transportAddresses) {
|
public TransportClientNodesService addTransportAddresses(TransportAddress... transportAddresses) {
|
||||||
synchronized (transportMutex) {
|
synchronized (transportMutex) {
|
||||||
List<TransportAddress> filtered = Lists.newArrayListWithExpectedSize(transportAddresses.length);
|
List<TransportAddress> filtered = Lists.newArrayListWithExpectedSize(transportAddresses.length);
|
||||||
for (TransportAddress transportAddress : transportAddresses) {
|
for (TransportAddress transportAddress : transportAddresses) {
|
||||||
|
|
Loading…
Reference in New Issue