Class DefaultL2TunnelHandler

    • Constructor Detail

      • DefaultL2TunnelHandler

        public DefaultL2TunnelHandler​(SegmentRoutingManager segmentRoutingManager)
        Create a l2 tunnel handler for the deploy and for the tear down of pseudo wires.
        Parameters:
        segmentRoutingManager - the segment routing manager
    • Method Detail

      • init

        public void init()
        Used by manager only in initialization.
        Specified by:
        init in interface L2TunnelHandler
      • getL2Descriptions

        public Set<L2TunnelDescription> getL2Descriptions​(boolean pending)
        Description copied from interface: L2TunnelHandler
        Combines policies and tunnels to create descriptions.
        Specified by:
        getL2Descriptions in interface L2TunnelHandler
        Parameters:
        pending - if it is true return pending to be installed pseudowires from the appropriate store, else return installed pseudowires
        Returns:
        Set of l2 tunnel descriptions.
      • getInitNext

        public com.google.common.collect.ImmutableMap<String,​org.onosproject.net.flowobjective.NextObjective> getInitNext()
        Description copied from interface: L2TunnelHandler
        Returns the PW init next objective store.
        Specified by:
        getInitNext in interface L2TunnelHandler
        Returns:
        current contents of the l2InitiationNextObjStore
      • getTermNext

        public com.google.common.collect.ImmutableMap<String,​org.onosproject.net.flowobjective.NextObjective> getTermNext()
        Description copied from interface: L2TunnelHandler
        Returns the PW termination next objective store.
        Specified by:
        getTermNext in interface L2TunnelHandler
        Returns:
        current contents of the l2TerminationNextObjStore
      • removeNextId

        public void removeNextId​(int nextId)
        Description copied from interface: L2TunnelHandler
        Removes given next ID from both PW init/term next obj store.
        Specified by:
        removeNextId in interface L2TunnelHandler
        Parameters:
        nextId - next ID
      • checkIfPwExists

        public L2TunnelHandler.Result checkIfPwExists​(long tunnelId,
                                                      boolean pending)
        Description copied from interface: L2TunnelHandler
        Check if pseudowire exists in the store.
        Specified by:
        checkIfPwExists in interface L2TunnelHandler
        Parameters:
        tunnelId - The tunnel id to check for.
        pending - Check in pending store for pseudowires.
        Returns:
        The result of the operation.
      • tearDownPseudowire

        public L2TunnelHandler.Result tearDownPseudowire​(long l2TunnelId)
        Helper function for removing a single pseudowire. Tries to remove pseudowire from any store it might reside (pending or installed).
        Parameters:
        l2TunnelId - the id of the pseudowire to tear down
        Returns:
        Returns SUCCESS if no error is obeserved or an appropriate error on a failure
      • tearDown

        @Deprecated
        public void tearDown​(Set<L2TunnelDescription> pwToRemove)
        Deprecated.
        Description copied from interface: L2TunnelHandler
        Helper function to handle the pw removal.

        This method should for the mastership of the device because it is used only from network configuration updates, thus we only want one instance only to program each pseudowire.

        Specified by:
        tearDown in interface L2TunnelHandler
        Parameters:
        pwToRemove - the pseudo wires to remove