Class CalcRouteBuilder


  • public class CalcRouteBuilder
    extends Object
    The type Calc route builder.
    • Constructor Detail

      • CalcRouteBuilder

        public CalcRouteBuilder​(int destNetwork)
      • CalcRouteBuilder

        public CalcRouteBuilder​(TopologyBuilder topologyBuilder)
        Instantiates a new Calc route builder. This CalcRouteBuilder is used to describe all routes in network topology with just one calcRoutes build. Provides auto completing of routes (route ws -> internet will be auto completed with route internet -> ws) which saves a lot of time.
        Parameters:
        topologyBuilder - the topology builder
      • CalcRouteBuilder

        public CalcRouteBuilder​(NetworkBuilder networkBuilder)
        Instantiates a new Calc route builder. This CalcRouteBuilder is used to describe CalculatedRoutes just for one network without auto complete etc...
        Parameters:
        networkBuilder - the network builder
    • Method Detail

      • viaRouter

        public CalcRouteBuilder viaRouter​(String routerName)
        Finds router based on it`s name and sets it as router attribute.
        Parameters:
        routerName - the router name
        Returns:
        the calc route builder
      • viaRouter

        public CalcRouteBuilder viaRouter​(Router router)
        Adds router attribute.
        Parameters:
        router - Router
        Returns:
        the calc route builder
      • withCost

        public CalcRouteBuilder withCost​(Integer cost)
        Adds cost attribute.
        Parameters:
        cost - the cost
        Returns:
        the calc route builder
      • withDestNetwork

        public CalcRouteBuilder withDestNetwork​(String targetNetworkName)
        Adds destination network attribute. Identified by name. This method has to be used with topology builder, not with network builder.
        Parameters:
        targetNetworkName - the target network name
        Returns:
        the calc route builder
      • withDestNetwork

        public CalcRouteBuilder withDestNetwork​(Integer targetNetworkIndex)
        With dest network calc route builder. Method has to be used with network builder.
        Parameters:
        targetNetworkIndex - the target network index
        Returns:
        the calc route builder
      • withSourceNetwork

        public CalcRouteBuilder withSourceNetwork​(String sourceNetworkName)
        Adds source network attribute. Identified by name. This method has to be used with topology builder, not with network builder.
        Parameters:
        sourceNetworkName - the source network name
        Returns:
        the calc route builder
      • withSourceNetwork

        public CalcRouteBuilder withSourceNetwork​(Integer sourceNetwork)
        With source network calc route builder.
        Parameters:
        sourceNetwork - the source network
        Returns:
        the calc route builder
      • addRoute

        public CalcRouteBuilder addRoute()
        Create route with opposite direction and add both routes into their positions in calcRoutesLists in networks.
        Returns:
        the calc route builder
      • buildRoutes

        public TopologyBuilder buildRoutes()
        Complete routes by route which point to themselves (N1 -> N1) and returns topology builder updated by added routes.
        Returns:
        the topology builder
      • createCalcRoute

        public CalcRoute createCalcRoute()
        Creates route.
        Returns:
        calcRoute