separate to two methods, one taking single address and one taking a list

This commit is contained in:
Shay Banon 2012-05-03 23:24:08 +03:00
parent 2d26cbcde3
commit 1e60f4b255
2 changed files with 16 additions and 3 deletions

View File

@ -199,8 +199,21 @@ public class TransportClient extends AbstractClient {
* <p/>
* <p>In order to get the list of all the current connected nodes, please see {@link #connectedNodes()}.
*/
public TransportClient addTransportAddress(TransportAddress... transportAddress) {
nodesService.addTransportAddress(transportAddress);
public TransportClient addTransportAddress(TransportAddress 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;
}

View File

@ -125,7 +125,7 @@ public class TransportClientNodesService extends AbstractComponent {
return this.listedNodes;
}
public TransportClientNodesService addTransportAddress(TransportAddress... transportAddresses) {
public TransportClientNodesService addTransportAddresses(TransportAddress... transportAddresses) {
synchronized (transportMutex) {
List<TransportAddress> filtered = Lists.newArrayListWithExpectedSize(transportAddresses.length);
for (TransportAddress transportAddress : transportAddresses) {