connection manager type hierarchy

This commit is contained in:
Zlatin Balevsky
2018-07-21 22:21:39 +01:00
parent 9d32aae459
commit d708939f61
3 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package com.muwire.core.connection
import com.muwire.core.EventBus
abstract class ConnectionManager {
final EventBus eventBus
ConnectionManager(EventBus eventBus) {
this.eventBus = eventBus
}
}

View File

@@ -0,0 +1,14 @@
package com.muwire.core.connection
import com.muwire.core.EventBus
class LeafConnectionManager extends ConnectionManager {
final int maxConnections
public LeafConnectionManager(EventBus eventBus, int maxConnections) {
super(eventBus)
this.maxConnections = maxConnections
}
}

View File

@@ -0,0 +1,15 @@
package com.muwire.core.connection
import com.muwire.core.EventBus
class UltrapeerConnectionManager extends ConnectionManager {
final int maxPeers, maxLeafs
public UltrapeerConnectionManager(EventBus eventBus, int maxPeers, int maxLeafs) {
super(eventBus)
this.maxPeers = maxPeers
this.maxLeafs = maxLeafs
}
}