Search in sources :

Example 1 with ServiceFunctionForwarderKey

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey in project netvirt by opendaylight.

the class NeutronPortPairListener method remove.

/**
 * Method removes PortPair which is identified by InstanceIdentifier.
 *
 * @param deletedPortPair        - PortPair for removing
 */
@Override
public void remove(PortPair deletedPortPair) {
    LOG.info("Received remove port pair event {}", deletedPortPair);
    ServiceFunctionKey sfKey = PortPairTranslator.getSFKey(deletedPortPair);
    LOG.info("Removing service function {}", sfKey);
    sfcMdsalHelper.removeServiceFunction(sfKey);
    ServiceFunctionForwarder sff;
    ServiceFunctionForwarder updatedSff;
    SffName sffName = new SffName(SfcMdsalHelper.NETVIRT_LOGICAL_SFF_NAME);
    sff = sfcMdsalHelper.readServiceFunctionForwarder(new ServiceFunctionForwarderKey(sffName));
    updatedSff = PortPairGroupTranslator.removePortPairFromServiceFunctionForwarder(sff, deletedPortPair);
    LOG.info("Updating service function forwarder as {}", updatedSff);
    sfcMdsalHelper.addServiceFunctionForwarder(updatedSff);
}
Also used : ServiceFunctionKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.functions.ServiceFunctionKey) ServiceFunctionForwarder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder) SffName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName) ServiceFunctionForwarderKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey)

Example 2 with ServiceFunctionForwarderKey

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey in project netvirt by opendaylight.

the class SfcProvider method getServiceFunctionForwarder.

private Optional<ServiceFunctionForwarder> getServiceFunctionForwarder(SffName name) {
    ServiceFunctionForwarderKey serviceFunctionForwarderKey = new ServiceFunctionForwarderKey(name);
    InstanceIdentifier<ServiceFunctionForwarder> sffIid;
    sffIid = InstanceIdentifier.builder(ServiceFunctionForwarders.class).child(ServiceFunctionForwarder.class, serviceFunctionForwarderKey).build();
    return MDSALUtil.read(dataBroker, LogicalDatastoreType.CONFIGURATION, sffIid).toJavaUtil();
}
Also used : ServiceFunctionForwarders(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.ServiceFunctionForwarders) ServiceFunctionForwarder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder) ServiceFunctionForwarderKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey)

Example 3 with ServiceFunctionForwarderKey

use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey in project netvirt by opendaylight.

the class SfcProviderTest method storeSff.

@SuppressWarnings("deprecation")
private void storeSff(SffName sffName, ServiceFunctionForwarder sff) {
    InstanceIdentifier<ServiceFunctionForwarder> sffIid;
    sffIid = InstanceIdentifier.builder(ServiceFunctionForwarders.class).child(ServiceFunctionForwarder.class, new ServiceFunctionForwarderKey(sffName)).build();
    MDSALUtil.syncWrite(getDataBroker(), LogicalDatastoreType.CONFIGURATION, sffIid, sff);
}
Also used : ServiceFunctionForwarders(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.ServiceFunctionForwarders) ServiceFunctionForwarder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder) ServiceFunctionForwarderKey(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey)

Aggregations

ServiceFunctionForwarder (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder)3 ServiceFunctionForwarderKey (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarderKey)3 ServiceFunctionForwarders (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.ServiceFunctionForwarders)2 SffName (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SffName)1 ServiceFunctionKey (org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sf.rev140701.service.functions.ServiceFunctionKey)1