42
42
import java .util .function .Predicate ;
43
43
import java .util .regex .Pattern ;
44
44
import java .util .stream .Collectors ;
45
+ import java .util .stream .Stream ;
45
46
import java .util .stream .StreamSupport ;
46
47
47
48
import javax .annotation .Nullable ;
@@ -1426,9 +1427,7 @@ private FSM.State<BaseClientState, BaseClientData> retrieveConnectionStatus(fina
1426
1427
.info ("Responding early with static 'CLOSED' ResourceStatus for all sub-sources and " +
1427
1428
"-targets and SSH tunnel, because some children could not be started, due to a " +
1428
1429
"live status <{}> in the client actor." , clientConnectionStatus );
1429
- connection .getSources ().stream ()
1430
- .map (Source ::getAddresses )
1431
- .flatMap (Collection ::stream )
1430
+ getSourceAddresses ()
1432
1431
.map (sourceAddress -> ConnectivityModelFactory .newSourceStatus (getInstanceIdentifier (),
1433
1432
ConnectivityStatus .CLOSED ,
1434
1433
sourceAddress ,
@@ -1469,7 +1468,7 @@ private FSM.State<BaseClientState, BaseClientData> retrieveConnectionStatus(fina
1469
1468
}
1470
1469
1471
1470
/**
1472
- * Determines the number of consumers.
1471
+ * Determine the number of consumers.
1473
1472
*
1474
1473
* @return the number of consumers.
1475
1474
*/
@@ -1480,6 +1479,17 @@ protected int determineNumberOfConsumers() {
1480
1479
.sum ();
1481
1480
}
1482
1481
1482
+ /**
1483
+ * Get the source addresses as stream of strings.
1484
+ *
1485
+ * @return the stream of source addresses.
1486
+ */
1487
+ protected Stream <String > getSourceAddresses () {
1488
+ return connection .getSources ().stream ()
1489
+ .map (Source ::getAddresses )
1490
+ .flatMap (Collection ::stream );
1491
+ }
1492
+
1483
1493
private void retrieveAddressStatusFromChildren (final RetrieveConnectionStatus command , final ActorRef sender ,
1484
1494
final List <ActorRef > childrenToAsk ) {
1485
1495
childrenToAsk .forEach (child -> {
0 commit comments