Class InterVpnLinkUtil


  • @Singleton
    public final class InterVpnLinkUtil
    extends java.lang.Object
    This class contains methods to be used as utilities related with inter-vpn-link.
    • Constructor Summary

      Constructors 
      Constructor Description
      InterVpnLinkUtil​(VpnUtil vpnUtil, VpnFootprintService vpnFootprintService, org.opendaylight.mdsal.binding.api.DataBroker dataBroker, org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalManager, IBgpManager bgpManager, IFibManager fibManager)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FirstEndpointState buildFirstEndpointState​(FirstEndpointState original, java.util.Optional<java.util.List<org.opendaylight.yangtools.yang.common.Uint64>> new1stEndpointDpns, java.util.Optional<java.lang.Long> new1stEndpointLportTag)  
      static java.lang.String buildInterVpnLinkIfaceName​(java.lang.String vpnName, org.opendaylight.yangtools.yang.common.Uint64 dpnId)  
      static InterVpnLinkState buildIvlStateFromOriginal​(InterVpnLinkState original, java.util.Optional<FirstEndpointState> new1stEndpointState, java.util.Optional<SecondEndpointState> new2ndEndpointState, java.util.Optional<java.lang.String> errDescription)
      Creates an InterVpnLinkState out of an existing one and modifying only the desired attributes.
      static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow buildLPortDispatcherFlow​(java.lang.String interVpnLinkName, org.opendaylight.yangtools.yang.common.Uint32 vpnId, int lportTag)
      Builds a Flow to be installed into LPortDispatcher table, that matches on SI=2 + vpnLinkEndpointPseudoPortTag and sends to FIB.
      static java.util.Map<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey,​org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> buildLportDispatcherTableInstructions​(org.opendaylight.yangtools.yang.common.Uint32 vpnId)  
      static SecondEndpointState buildSecondEndpointState​(SecondEndpointState original, java.util.Optional<java.util.List<org.opendaylight.yangtools.yang.common.Uint64>> new2ndEndpointDpns, java.util.Optional<java.lang.Long> new2ndEndpointLportTag)  
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<InterVpnLink> getInterVpnLinkPath​(java.lang.String interVpnLinkName)
      Retrieves the Instance Identifier that points to an InterVpnLink object in MD-SAL.
      java.util.Optional<InterVpnLinkState> getInterVpnLinkState​(java.lang.String interVpnLinkName)
      Retrieves the State of an InterVpnLink.
      static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<InterVpnLinkState> getInterVpnLinkStateIid​(java.lang.String vpnLinkName)
      Retrieves the Instance Identifier that points to an InterVpnLinkState object in MD-SAL.
      static java.lang.String getLportDispatcherFlowRef​(java.lang.String interVpnLinkName, java.lang.Integer lportTag)
      Builds a flowRef to be assigned to the flow to be installed into LPortDispatcher table.
      void handleStaticRoute​(InterVpnLinkDataComposite interVpnLink, java.lang.String vpnName, java.lang.String destination, java.lang.String nexthop, org.opendaylight.yangtools.yang.common.Uint32 label)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InterVpnLinkUtil

        @Inject
        public InterVpnLinkUtil​(VpnUtil vpnUtil,
                                VpnFootprintService vpnFootprintService,
                                org.opendaylight.mdsal.binding.api.DataBroker dataBroker,
                                org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalManager,
                                IBgpManager bgpManager,
                                IFibManager fibManager)
    • Method Detail

      • getInterVpnLinkPath

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<InterVpnLink> getInterVpnLinkPath​(java.lang.String interVpnLinkName)
        Retrieves the Instance Identifier that points to an InterVpnLink object in MD-SAL.
        Parameters:
        interVpnLinkName - The name of the InterVpnLink
        Returns:
        The requested InstanceIdentifier
      • getInterVpnLinkStateIid

        public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<InterVpnLinkState> getInterVpnLinkStateIid​(java.lang.String vpnLinkName)
        Retrieves the Instance Identifier that points to an InterVpnLinkState object in MD-SAL.
        Parameters:
        vpnLinkName - The name of the InterVpnLink
        Returns:
        The requested InstanceIdentifier
      • buildInterVpnLinkIfaceName

        public static java.lang.String buildInterVpnLinkIfaceName​(java.lang.String vpnName,
                                                                  org.opendaylight.yangtools.yang.common.Uint64 dpnId)
      • buildFirstEndpointState

        public static FirstEndpointState buildFirstEndpointState​(FirstEndpointState original,
                                                                 java.util.Optional<java.util.List<org.opendaylight.yangtools.yang.common.Uint64>> new1stEndpointDpns,
                                                                 java.util.Optional<java.lang.Long> new1stEndpointLportTag)
      • buildSecondEndpointState

        public static SecondEndpointState buildSecondEndpointState​(SecondEndpointState original,
                                                                   java.util.Optional<java.util.List<org.opendaylight.yangtools.yang.common.Uint64>> new2ndEndpointDpns,
                                                                   java.util.Optional<java.lang.Long> new2ndEndpointLportTag)
      • buildIvlStateFromOriginal

        public static InterVpnLinkState buildIvlStateFromOriginal​(InterVpnLinkState original,
                                                                  java.util.Optional<FirstEndpointState> new1stEndpointState,
                                                                  java.util.Optional<SecondEndpointState> new2ndEndpointState,
                                                                  java.util.Optional<java.lang.String> errDescription)
        Creates an InterVpnLinkState out of an existing one and modifying only the desired attributes.
        Parameters:
        original - InterVpnLinkState to start from.
        new1stEndpointState - Sets this FirstEndpointState if present
        new2ndEndpointState - Sets this SecondEndpointState if present
        errDescription - Sets this ErrorDescription if present
        Returns:
        the newly build InterVpnLinkState
      • buildLPortDispatcherFlow

        public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow buildLPortDispatcherFlow​(java.lang.String interVpnLinkName,
                                                                                                                                        org.opendaylight.yangtools.yang.common.Uint32 vpnId,
                                                                                                                                        int lportTag)
        Builds a Flow to be installed into LPortDispatcher table, that matches on SI=2 + vpnLinkEndpointPseudoPortTag and sends to FIB.
        Parameters:
        interVpnLinkName - The name of the InterVpnLink
        vpnId - Dataplane identifier of the VPN, the Vrf Tag.
        lportTag - DataPlane identifier of the LogicalPort.
        Returns:
        the Flow ready to be installed
      • getLportDispatcherFlowRef

        public static java.lang.String getLportDispatcherFlowRef​(java.lang.String interVpnLinkName,
                                                                 java.lang.Integer lportTag)
        Builds a flowRef to be assigned to the flow to be installed into LPortDispatcher table.
        Parameters:
        interVpnLinkName - The name of the InterVpnLink
        lportTag - Dataplane identifier of the LogicalPort
        Returns:
        the flow reference string
      • buildLportDispatcherTableInstructions

        public static java.util.Map<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey,​org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> buildLportDispatcherTableInstructions​(org.opendaylight.yangtools.yang.common.Uint32 vpnId)
      • getInterVpnLinkState

        public java.util.Optional<InterVpnLinkState> getInterVpnLinkState​(java.lang.String interVpnLinkName)
        Retrieves the State of an InterVpnLink.
        Parameters:
        interVpnLinkName - The name of the InterVpnLink
        Returns:
        the object that contains the State of the specified InterVpnLink or Optional.empty() if it doesnt exist
      • handleStaticRoute

        public void handleStaticRoute​(InterVpnLinkDataComposite interVpnLink,
                                      java.lang.String vpnName,
                                      java.lang.String destination,
                                      java.lang.String nexthop,
                                      org.opendaylight.yangtools.yang.common.Uint32 label)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception