Search in sources :

Example 1 with SffDataPlaneLocatorName

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName in project netvirt by opendaylight.

the class PortPairGroupTranslator method buildServiceFunctionForwarder.

public static ServiceFunctionForwarder buildServiceFunctionForwarder(PortPairGroup portPairGroup, List<PortPair> portPairs) {
    Preconditions.checkNotNull(portPairGroup, "Port pair group must not be null");
    Preconditions.checkNotNull(portPairs, "Port pairs must not be null");
    Preconditions.checkElementIndex(0, portPairs.size(), "There must be at least one port pair");
    // Currently we only support one SF per type. Mean, one port-pair per port-pair-group.
    final PortPair portPair = portPairs.get(0);
    ServiceFunctionForwarderBuilder sffBuilder = new ServiceFunctionForwarderBuilder();
    sffBuilder.setName(new SffName(SfcMdsalHelper.NETVIRT_LOGICAL_SFF_NAME));
    DataPlaneLocatorBuilder forwardDplBuilder = new DataPlaneLocatorBuilder();
    forwardDplBuilder.setTransport(Mac.class);
    String forwardPort = portPair.getIngress().getValue();
    LogicalInterface forwardInterface = new LogicalInterfaceBuilder().setInterfaceName(forwardPort).build();
    forwardDplBuilder.setLocatorType(forwardInterface);
    SffDataPlaneLocatorBuilder sffForwardDplBuilder = new SffDataPlaneLocatorBuilder();
    sffForwardDplBuilder.setDataPlaneLocator(forwardDplBuilder.build());
    String forwardDplName = portPair.getName() + DPL_INGRESS_SUFFIX;
    sffForwardDplBuilder.setName(new SffDataPlaneLocatorName(forwardDplName));
    DataPlaneLocatorBuilder reverseDplBuilder = new DataPlaneLocatorBuilder();
    reverseDplBuilder.setTransport(Mac.class);
    String reversePort = portPair.getEgress().getValue();
    LogicalInterface reverseInterface = new LogicalInterfaceBuilder().setInterfaceName(reversePort).build();
    reverseDplBuilder.setLocatorType(reverseInterface);
    SffDataPlaneLocatorBuilder sffReverseDplBuilder = new SffDataPlaneLocatorBuilder();
    sffReverseDplBuilder.setDataPlaneLocator(reverseDplBuilder.build());
    String reverseDplName = portPair.getName() + DPL_EGRESS_SUFFIX;
    sffReverseDplBuilder.setName(new SffDataPlaneLocatorName(reverseDplName));
    List<SffDataPlaneLocator> sffDataPlaneLocator = new ArrayList<>();
    sffDataPlaneLocator.add(sffForwardDplBuilder.build());
    sffDataPlaneLocator.add(sffReverseDplBuilder.build());
    sffBuilder.setSffDataPlaneLocator(sffDataPlaneLocator);
    SffSfDataPlaneLocatorBuilder sffSfDataPlaneLocatorBuilder = new SffSfDataPlaneLocatorBuilder();
    sffSfDataPlaneLocatorBuilder.setSffForwardDplName(new SffDataPlaneLocatorName(forwardDplName));
    sffSfDataPlaneLocatorBuilder.setSfForwardDplName(new SfDataPlaneLocatorName(forwardDplName));
    sffSfDataPlaneLocatorBuilder.setSffReverseDplName(new SffDataPlaneLocatorName(reverseDplName));
    sffSfDataPlaneLocatorBuilder.setSfReverseDplName(new SfDataPlaneLocatorName(reverseDplName));
    ServiceFunctionDictionaryBuilder sfdBuilder = new ServiceFunctionDictionaryBuilder();
    sfdBuilder.setName(new SfName(portPair.getName()));
    sfdBuilder.setSffSfDataPlaneLocator(sffSfDataPlaneLocatorBuilder.build());
    List<ServiceFunctionDictionary> sfdList = new ArrayList<>();
    sfdList.add(sfdBuilder.build());
    sffBuilder.setServiceFunctionDictionary(sfdList);
    return sffBuilder.build();
}
Also used : SffSfDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocatorBuilder) DataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.sff.data.plane.locator.DataPlaneLocatorBuilder) SffDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocatorBuilder) ServiceFunctionForwarderBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderBuilder) ArrayList(java.util.ArrayList) SffName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName) SffDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocatorBuilder) SffDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName) SfDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfDataPlaneLocatorName) LogicalInterfaceBuilder(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterfaceBuilder) LogicalInterface(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterface) PortPair(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.port.pairs.PortPair) SffSfDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocatorBuilder) SfName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName) ServiceFunctionDictionary(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionary) SffDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocator) ServiceFunctionDictionaryBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionaryBuilder)

Example 2 with SffDataPlaneLocatorName

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName in project netvirt by opendaylight.

the class SfcProvider method getHopSfInterface.

private Optional<String> getHopSfInterface(RenderedServicePathHop hop, boolean useForwardDpl) {
    LOG.trace("getHopSfInterface of hop {}", hop);
    SfName sfName = hop.getServiceFunctionName();
    if (sfName == null) {
        LOG.warn("getHopSfInterface hop has no SF");
        return Optional.empty();
    }
    SffName sffName = hop.getServiceFunctionForwarder();
    if (sffName == null) {
        LOG.warn("getHopSfInterface hop has no SFF");
        return Optional.empty();
    }
    Optional<ServiceFunctionForwarder> sff = getServiceFunctionForwarder(sffName);
    if (!sff.isPresent()) {
        LOG.warn("getHopSfInterface SFF [{}] does not exist", sffName.getValue());
        return Optional.empty();
    }
    // Find the SFF-SF data plane locator for the SF pair
    SffSfDataPlaneLocator sffSfDataPlaneLocator = sff.map(ServiceFunctionForwarder::getServiceFunctionDictionary).orElse(Collections.emptyList()).stream().filter(serviceFunctionDictionary -> serviceFunctionDictionary.getName().equals(sfName)).findAny().map(ServiceFunctionDictionary::getSffSfDataPlaneLocator).orElse(null);
    if (sffSfDataPlaneLocator == null) {
        LOG.warn("getHopSfInterface SFF [{}] has not dictionary for SF [{}]", sffName.getValue(), sffName.getValue());
        return Optional.empty();
    }
    // Get the forward or reverse locator name as appropriate if any,
    // otherwise default to non directional locator
    SffDataPlaneLocatorName sffDataPlaneLocatorName = null;
    if (useForwardDpl) {
        sffDataPlaneLocatorName = sffSfDataPlaneLocator.getSffForwardDplName();
    } else {
        sffDataPlaneLocatorName = sffSfDataPlaneLocator.getSffReverseDplName();
    }
    if (sffDataPlaneLocatorName == null) {
        sffDataPlaneLocatorName = sffSfDataPlaneLocator.getSffDplName();
    }
    // Get the interface name value of the locator with such name
    SffDataPlaneLocatorName locatorName = sffDataPlaneLocatorName;
    Optional<String> interfaceName = sff.map(ServiceFunctionForwarderBase::getSffDataPlaneLocator).orElse(Collections.emptyList()).stream().filter(sffDataPlaneLocator -> sffDataPlaneLocator.getName().equals(locatorName)).findAny().map(SffDataPlaneLocator::getDataPlaneLocator).filter(dataPlaneLocator -> dataPlaneLocator.getLocatorType() instanceof LogicalInterface).map(dataPlaneLocator -> (LogicalInterfaceLocator) dataPlaneLocator.getLocatorType()).map(LogicalInterfaceLocator::getInterfaceName);
    return interfaceName;
}
Also used : RenderedServicePaths(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.RenderedServicePaths) LogicalInterfaceLocator(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.LogicalInterfaceLocator) SffSfDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocator) LoggerFactory(org.slf4j.LoggerFactory) SfpName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfpName) Singleton(javax.inject.Singleton) Inject(javax.inject.Inject) RspName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.RspName) ServiceFunctionDictionary(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionary) SffDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocator) ServiceFunctionForwarderBase(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.ServiceFunctionForwarderBase) RenderedServicePathHop(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.rendered.service.path.RenderedServicePathHop) RenderedServicePathKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePathKey) MDSALUtil(org.opendaylight.genius.mdsalutil.MDSALUtil) ServiceFunctionForwarder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder) SfName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName) Logger(org.slf4j.Logger) RenderedServicePath(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePath) ServiceFunctionForwarders(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.ServiceFunctionForwarders) ServiceFunctionPathStateKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.service.function.paths.state.ServiceFunctionPathStateKey) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) SffDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName) Collectors(java.util.stream.Collectors) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) ServiceFunctionPathState(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.service.function.paths.state.ServiceFunctionPathState) List(java.util.List) ServiceFunctionForwarderKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) SffName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName) Optional(java.util.Optional) Collections(java.util.Collections) LogicalInterface(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterface) ServiceFunctionPathsState(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.ServiceFunctionPathsState) LogicalInterfaceLocator(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.LogicalInterfaceLocator) SffDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName) SffSfDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocator) ServiceFunctionForwarder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder) LogicalInterface(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterface) ServiceFunctionForwarderBase(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.ServiceFunctionForwarderBase) SfName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName) SffName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName)

Example 3 with SffDataPlaneLocatorName

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName in project netvirt by opendaylight.

the class SfcProviderTest method createRsp.

private RenderedServicePathBuilder createRsp(RspName rspName, boolean hasHops, boolean hasSfName, boolean hasSffName, boolean hasDict, boolean hasSfDict, boolean createSff, boolean createSffDpl, boolean createLogicalSfDpl) {
    RenderedServicePathBuilder rspBuilder = createRsp(rspName);
    SffName sffName = new SffName(SFF_NAME);
    SfName sfName = new SfName(SF_NAME);
    RenderedServicePathHopBuilder rspHopBuilder = new RenderedServicePathHopBuilder();
    if (hasSfName) {
        rspHopBuilder.setServiceFunctionName(sfName);
    }
    if (hasSffName) {
        rspHopBuilder.setServiceFunctionForwarder(sffName);
    }
    if (hasHops) {
        List<RenderedServicePathHop> hops = new ArrayList<>();
        hops.add(rspHopBuilder.build());
        rspBuilder.setRenderedServicePathHop(hops);
    }
    ServiceFunctionForwarderBuilder sffBuilder = new ServiceFunctionForwarderBuilder();
    ServiceFunctionDictionaryBuilder serviceFunctionDictionaryBuilder = new ServiceFunctionDictionaryBuilder();
    serviceFunctionDictionaryBuilder.setName(sfName);
    if (hasSfDict) {
        SffSfDataPlaneLocatorBuilder sffSfDataPlaneLocatorBuilder = new SffSfDataPlaneLocatorBuilder();
        sffSfDataPlaneLocatorBuilder.setSffDplName(new SffDataPlaneLocatorName(SFF_DPL_NAME));
        serviceFunctionDictionaryBuilder.setSffSfDataPlaneLocator(sffSfDataPlaneLocatorBuilder.build());
    }
    if (hasDict) {
        sffBuilder.setServiceFunctionDictionary(Collections.singletonList(serviceFunctionDictionaryBuilder.build()));
    }
    SffDataPlaneLocatorBuilder sffDplBuilder = new SffDataPlaneLocatorBuilder();
    DataPlaneLocatorBuilder dataPlaneLocatorBuilder = new DataPlaneLocatorBuilder();
    if (createLogicalSfDpl) {
        LogicalInterfaceBuilder liBuilder = new LogicalInterfaceBuilder();
        liBuilder.setInterfaceName(LOGICAL_IF_NAME);
        dataPlaneLocatorBuilder.setLocatorType(liBuilder.build());
        sffDplBuilder.setDataPlaneLocator(dataPlaneLocatorBuilder.build());
    }
    if (createSffDpl) {
        List<SffDataPlaneLocator> sffDpls = new ArrayList<>();
        sffDplBuilder.setKey(new SffDataPlaneLocatorKey(new SffDataPlaneLocatorName(SFF_DPL_NAME)));
        sffDplBuilder.setName(new SffDataPlaneLocatorName(SFF_DPL_NAME));
        sffDpls.add(sffDplBuilder.build());
        sffBuilder.setSffDataPlaneLocator(sffDpls);
    }
    if (createSff) {
        sffBuilder.setName(sffName);
        storeSff(sffName, sffBuilder.build());
    }
    return rspBuilder;
}
Also used : SffSfDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocatorBuilder) DataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.sff.data.plane.locator.DataPlaneLocatorBuilder) SffDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocatorBuilder) ServiceFunctionForwarderBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderBuilder) ArrayList(java.util.ArrayList) SffName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName) RenderedServicePathHopBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.rendered.service.path.RenderedServicePathHopBuilder) SffDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocatorBuilder) RenderedServicePathHop(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.rendered.service.path.RenderedServicePathHop) SffDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName) RenderedServicePathBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePathBuilder) LogicalInterfaceBuilder(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterfaceBuilder) SffSfDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocatorBuilder) SfName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName) SffDataPlaneLocatorKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocatorKey) ServiceFunctionDictionaryBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionaryBuilder) SffDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocator)

Example 4 with SffDataPlaneLocatorName

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName in project netvirt by opendaylight.

the class PortPairGroupTranslator method removePortPairFromServiceFunctionForwarder.

public static ServiceFunctionForwarder removePortPairFromServiceFunctionForwarder(ServiceFunctionForwarder serviceFunctionForwarder, PortPair deletedPortPair) {
    Preconditions.checkNotNull(deletedPortPair, "Port pair must not be null");
    String portPairName = deletedPortPair.getName();
    ServiceFunctionForwarderBuilder sffBuilder = new ServiceFunctionForwarderBuilder(serviceFunctionForwarder);
    List<ServiceFunctionDictionary> serviceFunctionDictionaryList = sffBuilder.getServiceFunctionDictionary();
    if (serviceFunctionDictionaryList == null) {
        LOG.debug("SF dictionary is empty");
        return serviceFunctionForwarder;
    }
    ServiceFunctionDictionary serviceFunctionDictionary = serviceFunctionDictionaryList.stream().filter(sfDictionary -> sfDictionary.getName().getValue().equals(portPairName)).findFirst().orElse(null);
    if (serviceFunctionDictionary == null) {
        LOG.debug("SFF dictionary entry for port pair {} not found", portPairName);
        return serviceFunctionForwarder;
    }
    SffSfDataPlaneLocator sffSfDataPlaneLocator = serviceFunctionDictionary.getSffSfDataPlaneLocator();
    if (sffSfDataPlaneLocator != null) {
        List<SffDataPlaneLocatorName> locators = Arrays.asList(sffSfDataPlaneLocator.getSffDplName(), sffSfDataPlaneLocator.getSffForwardDplName(), sffSfDataPlaneLocator.getSffReverseDplName());
        List<SffDataPlaneLocator> sffDplList = sffBuilder.getSffDataPlaneLocator();
        if (sffDplList != null) {
            sffDplList.stream().filter(sffDataPlaneLocator -> locators.contains(sffDataPlaneLocator.getName())).map(sffDplList::remove);
        }
    }
    serviceFunctionDictionaryList.remove(serviceFunctionDictionary);
    return sffBuilder.build();
}
Also used : SfDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfDataPlaneLocatorName) PortPair(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.port.pairs.PortPair) Arrays(java.util.Arrays) SffSfDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocatorBuilder) ServiceFunctionForwarderBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderBuilder) SffSfDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocator) LoggerFactory(org.slf4j.LoggerFactory) SfcMdsalHelper(org.opendaylight.netvirt.sfc.translator.SfcMdsalHelper) LogicalInterfaceBuilder(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterfaceBuilder) ArrayList(java.util.ArrayList) ServiceFunctionDictionary(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionary) SffDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocator) ServiceFunctionForwarder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder) Mac(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sl.rev140701.Mac) SfName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName) Logger(org.slf4j.Logger) SffDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName) DataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.sff.data.plane.locator.DataPlaneLocatorBuilder) List(java.util.List) SffName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName) Preconditions(com.google.common.base.Preconditions) PortPairGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.port.pair.groups.PortPairGroup) LogicalInterface(org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterface) SffDataPlaneLocatorBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocatorBuilder) ServiceFunctionDictionaryBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionaryBuilder) SffDataPlaneLocatorName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName) ServiceFunctionForwarderBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderBuilder) SffSfDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocator) ServiceFunctionDictionary(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionary) SffDataPlaneLocator(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocator)

Aggregations

SfName (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfName)4 SffDataPlaneLocatorName (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffDataPlaneLocatorName)4 SffName (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName)4 SffDataPlaneLocator (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocator)4 ArrayList (java.util.ArrayList)3 SffDataPlaneLocatorBuilder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.SffDataPlaneLocatorBuilder)3 DataPlaneLocatorBuilder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarder.base.sff.data.plane.locator.DataPlaneLocatorBuilder)3 ServiceFunctionForwarderBuilder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderBuilder)3 ServiceFunctionDictionary (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionary)3 ServiceFunctionDictionaryBuilder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.ServiceFunctionDictionaryBuilder)3 SffSfDataPlaneLocatorBuilder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocatorBuilder)3 LogicalInterface (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterface)3 LogicalInterfaceBuilder (org.opendaylight.yang.gen.v1.urn.ericsson.params.xml.ns.yang.sfc.sff.logical.rev160620.service.function.forwarders.service.function.forwarder.sff.data.plane.locator.data.plane.locator.locator.type.LogicalInterfaceBuilder)3 List (java.util.List)2 SfDataPlaneLocatorName (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfDataPlaneLocatorName)2 RenderedServicePathHop (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.rendered.service.path.RenderedServicePathHop)2 ServiceFunctionForwarder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder)2 SffSfDataPlaneLocator (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.service.function.forwarder.service.function.dictionary.SffSfDataPlaneLocator)2 PortPair (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.port.pairs.PortPair)2 Preconditions (com.google.common.base.Preconditions)1