File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
src/main/java/net/sharksystem/hub Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ public interface HubConnectionManager extends NewHubConnectionListenerManagement
2222 */
2323 void connectHub (HubConnectorDescription hcd ) throws SharkException , IOException ;
2424
25+ void connectHubs (List <HubConnectorDescription > hcdList ) throws SharkException , IOException ;
26+
2527 /**
2628 * Disconnect from a hub
2729 * @param hcd description
Original file line number Diff line number Diff line change 88import net .sharksystem .hub .peerside .HubConnectorDescription ;
99
1010import java .io .IOException ;
11+ import java .util .List ;
1112
1213/**
1314 * That class merges encounter and asap hub management
@@ -25,6 +26,15 @@ protected void syncLists() {
2526 super .syncLists ();
2627 }
2728
29+ public void connectHubs (List <HubConnectorDescription > hcdList ) throws SharkException , IOException {
30+ if (hcdList == null || hcdList .isEmpty ()) return ;
31+ this .syncLists ();
32+ for (HubConnectorDescription hcd : hcdList ) {
33+ super .connectHub (hcd );
34+ }
35+ this .connectionChanged (true );
36+ }
37+
2838 public void connectHub (HubConnectorDescription hcd ) throws SharkException , IOException {
2939 this .syncLists ();
3040 super .connectHub (hcd );
@@ -74,12 +84,18 @@ public void stopThreads() {
7484 this .hubManager .kill ();
7585 }
7686
87+ /* this first parameter hcd is useless ?? */
7788 @ Override
7889 public void connectionChanged (HubConnectorDescription hcd , boolean connect ) {
7990 // list are already in order - tell hub manager
8091 this .hubManager .connectASAPHubs (this .hcdList , this .asapPeer , true );
8192 }
8293
94+ public void connectionChanged (boolean connect ) {
95+ // list are already in order - tell hub manager
96+ this .hubManager .connectASAPHubs (this .hcdList , this .asapPeer , true );
97+ }
98+
8399 @ Override
84100 public void refreshHubList () {
85101 // ask hub manager for a fresh list
You can’t perform that action at this time.
0 commit comments