public class Relayer
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
protected class |
Relayer.Bridge |
class |
Relayer.Route
Includes information about the site master of the route and the channel to be used
|
限定符和类型 | 字段和说明 |
---|---|
protected java.util.Queue<Relayer.Bridge> |
bridges
The bridges which are used to connect to different sites
|
protected boolean |
done
Flag set when stop() is called.
|
protected Log |
log |
protected RELAY2 |
relay |
protected java.util.concurrent.ConcurrentMap<java.lang.String,java.util.List<Relayer.Route>> |
routes
The routing table.
|
protected boolean |
stats |
限定符和类型 | 方法和说明 |
---|---|
boolean |
done() |
protected View |
getBridgeView(java.lang.String cluster_name) |
protected Relayer.Route |
getRoute(java.lang.String site)
Grabs a random route
|
protected java.util.List<Relayer.Route> |
getRoutes(java.lang.String... excluded_sites) |
protected java.util.List<java.lang.String> |
getSiteNames() |
protected static boolean |
isExcluded(Relayer.Route route,
java.lang.String... excluded_sites) |
java.lang.String |
printRoutes() |
void |
start(java.util.List<RelayConfig.BridgeConfig> bridge_configs,
java.lang.String bridge_name,
java.lang.String my_site_id)
Creates all bridges from site_config and connects them (joining the bridge clusters)
|
void |
stop()
Disconnects and destroys all bridges
|
protected java.util.concurrent.ConcurrentMap<java.lang.String,java.util.List<Relayer.Route>> routes
protected final java.util.Queue<Relayer.Bridge> bridges
protected final Log log
protected final RELAY2 relay
protected volatile boolean done
protected boolean stats
public boolean done()
public void start(java.util.List<RelayConfig.BridgeConfig> bridge_configs, java.lang.String bridge_name, java.lang.String my_site_id) throws java.lang.Throwable
bridge_configs
- A list of bridge configurationsbridge_name
- The name of the local bridge channel, prefixed with '_'.my_site_id
- The ID of this sitejava.lang.Throwable
public void stop()
public java.lang.String printRoutes()
protected Relayer.Route getRoute(java.lang.String site)
site
- protected java.util.List<java.lang.String> getSiteNames()
protected java.util.List<Relayer.Route> getRoutes(java.lang.String... excluded_sites)
protected View getBridgeView(java.lang.String cluster_name)
protected static boolean isExcluded(Relayer.Route route, java.lang.String... excluded_sites)