Search in sources :

Example 6 with Service

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.Service in project netvirt by opendaylight.

the class ElanServiceProvider method removeKnownL3DmacAddress.

@Override
public void removeKnownL3DmacAddress(String macAddress, String elanInstanceName) {
    if (!isL2BeforeL3) {
        LOG.trace("ELAN service is after L3VPN in the Netvirt pipeline skip known L3DMAC flows installation");
        return;
    }
    ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
    if (elanInstance == null) {
        LOG.warn("Null elan instance {}", elanInstanceName);
        return;
    }
    List<BigInteger> dpnsIdsForElanInstance = elanUtils.getParticipatingDpnsInElanInstance(elanInstanceName);
    if (dpnsIdsForElanInstance.isEmpty()) {
        LOG.warn("No DPNs for elan instance {}", elanInstance);
        return;
    }
    elanUtils.removeDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), macAddress, dpnsIdsForElanInstance);
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) BigInteger(java.math.BigInteger)

Example 7 with Service

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.Service in project netvirt by opendaylight.

the class ElanServiceProvider method addKnownL3DmacAddress.

@Override
public void addKnownL3DmacAddress(String macAddress, String elanInstanceName) {
    if (!isL2BeforeL3) {
        LOG.trace("ELAN service is after L3VPN in the Netvirt pipeline skip known L3DMAC flows installation");
        return;
    }
    ElanInstance elanInstance = elanInstanceCache.get(elanInstanceName).orNull();
    if (elanInstance == null) {
        LOG.warn("Null elan instance {}", elanInstanceName);
        return;
    }
    List<BigInteger> dpnsIdsForElanInstance = elanUtils.getParticipatingDpnsInElanInstance(elanInstanceName);
    if (dpnsIdsForElanInstance.isEmpty()) {
        LOG.warn("No DPNs for elan instance {}", elanInstance);
        return;
    }
    elanUtils.addDmacRedirectToDispatcherFlows(elanInstance.getElanTag(), elanInstanceName, macAddress, dpnsIdsForElanInstance);
}
Also used : ElanInstance(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance) BigInteger(java.math.BigInteger)

Example 8 with Service

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.Service in project netvirt by opendaylight.

the class StatisticsImpl method createIdPool.

private void createIdPool() {
    if (checkPoolExists()) {
        return;
    }
    CreateIdPoolInput createPool = new CreateIdPoolInputBuilder().setPoolName(CountersServiceUtils.COUNTERS_PULL_NAME).setLow(CountersServiceUtils.COUNTERS_PULL_START).setHigh(CountersServiceUtils.COUNTERS_PULL_START + CountersServiceUtils.COUNTERS_PULL_END).build();
    Future<RpcResult<Void>> result = idManagerService.createIdPool(createPool);
    Futures.addCallback(JdkFutureAdapters.listenInPoolThread(result), new FutureCallback<RpcResult<Void>>() {

        @Override
        public void onFailure(Throwable error) {
            LOG.error("Failed to create idPool for Aliveness Monitor Service", error);
        }

        @Override
        public void onSuccess(@Nonnull RpcResult<Void> rpcResult) {
            if (rpcResult.isSuccessful()) {
                LOG.debug("Created IdPool for tap");
            } else {
                LOG.error("RPC to create Idpool failed {}", rpcResult.getErrors());
            }
        }
    }, MoreExecutors.directExecutor());
}
Also used : RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) CreateIdPoolInput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInput) CreateIdPoolInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.CreateIdPoolInputBuilder)

Example 9 with Service

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.Service 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 10 with Service

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.Service in project netvirt by opendaylight.

the class PortChainTranslator method buildServiceFunctionPath.

public static ServiceFunctionPath buildServiceFunctionPath(ServiceFunctionChain sfc) {
    Preconditions.checkNotNull(sfc, "Service Function Chain must not be null");
    ServiceFunctionPathBuilder sfpBuilder = new ServiceFunctionPathBuilder();
    // Set the name
    sfpBuilder.setName(new SfpName(SFP_NAME_PREFIX + sfc.getName().getValue()));
    sfpBuilder.setSymmetric(sfc.isSymmetric());
    // Set related SFC name
    sfpBuilder.setServiceChainName(sfc.getName());
    return sfpBuilder.build();
}
Also used : ServiceFunctionPathBuilder(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.service.function.paths.ServiceFunctionPathBuilder) SfpName(org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.common.rev151017.SfpName)

Aggregations

ArrayList (java.util.ArrayList)36 BigInteger (java.math.BigInteger)33 Connector (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Connector)22 Service (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Service)22 RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)21 ExecutionException (java.util.concurrent.ExecutionException)19 CoreException (org.eclipse.core.runtime.CoreException)18 List (java.util.List)15 Test (org.junit.Test)15 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)15 Logger (org.slf4j.Logger)14 LoggerFactory (org.slf4j.LoggerFactory)14 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)13 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)12 BoundServices (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices)12 NwConstants (org.opendaylight.genius.mdsalutil.NwConstants)10 ServerPort (org.eclipse.wst.server.core.ServerPort)9 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)9 LogicalDatastoreType (org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType)9 MatchInfo (org.opendaylight.genius.mdsalutil.MatchInfo)9