Class Relayer

  • Direct Known Subclasses:
    Relayer2, Relayer3

    public abstract class Relayer
    extends java.lang.Object
    Base class for all relayers
    Since:
    5.2.17
    Author:
    Bela Ban
    • Field Detail

      • relay

        protected final RELAY relay
      • log

        protected final Log log
      • done

        protected volatile boolean done
        Flag set when stop() is called. Since a Relayer should not be used after stop() has been called, a new instance needs to be created
      • stats

        protected boolean stats
      • routes

        protected final java.util.Map<java.lang.String,​java.util.List<Route>> routes
        The routing table. Site IDs are the keys (e.g. "sfo", and list of routes are the values
      • forward_routes

        protected final java.util.Set<ForwardingRoute> forward_routes
    • Constructor Detail

      • Relayer

        public Relayer​(RELAY relay,
                       Log log)
    • Method Detail

      • stop

        public abstract void stop()
      • relay

        public RELAY relay()
      • log

        public Log log()
      • done

        public boolean done()
      • getBridgeView

        protected abstract View getBridgeView​(java.lang.String cluster_name)
      • getRoute

        protected Route getRoute​(java.lang.String site)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getNumRoutes

        public int getNumRoutes()
      • getRoute

        protected Route getRoute​(java.lang.String site,
                                 Address sender)
      • getRoutes

        protected java.util.List<Route> getRoutes​(java.lang.String... excluded_sites)
      • addRoutes

        protected void addRoutes​(java.lang.String site,
                                 java.util.List<Route> new_routes)
      • hasRouteTo

        protected boolean hasRouteTo​(java.lang.String r)
      • removeRoute

        protected void removeRoute​(java.lang.String site)
      • getRoutes

        protected java.util.List<Route> getRoutes​(java.lang.String site)
        Gets routes for a given site. The result is the real value, which can be modified, so make a copy!
      • printRoutes

        protected java.lang.String printRoutes()
      • getForwardingRouteMatching

        protected Route getForwardingRouteMatching​(java.lang.String site,
                                                   Address sender)
        Returns a Route matching any of the ForwardingRoutes, or null if none matches
      • getSiteNames

        protected java.util.Collection<java.lang.String> getSiteNames()
      • isExcluded

        protected static boolean isExcluded​(Route route,
                                            java.lang.String... excluded_sites)