use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.Pattern in project netvirt by opendaylight.
the class VrfEntryListener method removeFibEntries.
// This method is temporary. Eventually Factory design pattern will be used to get
// right VrfEntryhandle and invoke its methods.
private void removeFibEntries(InstanceIdentifier<VrfEntry> identifier, VrfEntry vrfEntry, String rd) {
if (VrfEntry.EncapType.Vxlan.equals(vrfEntry.getEncapType())) {
LOG.info("EVPN flows to be deleted");
EvpnVrfEntryHandler evpnVrfEntryHandler = new EvpnVrfEntryHandler(dataBroker, this, bgpRouteVrfEntryHandler, nextHopManager, jobCoordinator, elanManager, fibUtil);
evpnVrfEntryHandler.removeFlows(identifier, vrfEntry, rd);
closeables.add(evpnVrfEntryHandler);
return;
}
RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
if (routerInt != null) {
// ping responder for router interfaces
routerInterfaceVrfEntryHandler.removeFlows(identifier, vrfEntry, rd);
return;
}
if (RouteOrigin.value(vrfEntry.getOrigin()) != RouteOrigin.BGP) {
deleteFibEntries(identifier, vrfEntry);
return;
}
if (RouteOrigin.value(vrfEntry.getOrigin()) == RouteOrigin.BGP) {
bgpRouteVrfEntryHandler.removeFlows(identifier, vrfEntry, rd);
return;
}
}
use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.Pattern in project netvirt by opendaylight.
the class VrfEntryListener method addFibEntries.
// This method is temporary. Eventually Factory design pattern will be used to get
// right VrfEntryhandle and invoke its methods.
private void addFibEntries(InstanceIdentifier<VrfEntry> identifier, VrfEntry vrfEntry, String rd) {
if (RouteOrigin.value(vrfEntry.getOrigin()) == RouteOrigin.BGP) {
bgpRouteVrfEntryHandler.createFlows(identifier, vrfEntry, rd);
return;
}
if (VrfEntry.EncapType.Vxlan.equals(vrfEntry.getEncapType())) {
LOG.info("EVPN flows need to be programmed.");
EvpnVrfEntryHandler evpnVrfEntryHandler = new EvpnVrfEntryHandler(dataBroker, this, bgpRouteVrfEntryHandler, nextHopManager, jobCoordinator, elanManager, fibUtil);
evpnVrfEntryHandler.createFlows(identifier, vrfEntry, rd);
closeables.add(evpnVrfEntryHandler);
return;
}
RouterInterface routerInt = vrfEntry.getAugmentation(RouterInterface.class);
if (routerInt != null) {
// ping responder for router interfaces
routerInterfaceVrfEntryHandler.createFlows(identifier, vrfEntry, rd);
return;
}
if (RouteOrigin.value(vrfEntry.getOrigin()) != RouteOrigin.BGP) {
createFibEntries(identifier, vrfEntry);
return;
}
}
use of org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.eventaggregator.rev141202.Pattern in project genius by opendaylight.
the class NodeConnectorStatsImpl method getCounter.
/*
* This method returns counter and also creates counter if does not exist.
*
* @param counterName name of the counter
* @param switchId datapath-id value
* @param port port-id value
* @param aliasId alias-id value
* @param tableId table-id value of switch
* @return counter object
*/
private Counter getCounter(String counterName, BigInteger switchId, String port, String aliasId, String tableId) {
/*
* Pattern to be followed for key generation:
*
* genius.interfacemanager.entitycounter{entitytype=port,switchid=value,portid=value,aliasid=value,
* name=counterName}
* genius.interfacemanager.entitycounter{entitytype=flowtable,switchid=value,flowtableid=value,name=counterName}
*/
Counter counter = null;
if (port != null) {
Labeled<Labeled<Labeled<Labeled<Labeled<Counter>>>>> labeledCounter = metricProvider.newCounter(MetricDescriptor.builder().anchor(this).project("genius").module("interfacemanager").id(CounterConstants.CNT_TYPE_ENTITY_CNT_ID).build(), CounterConstants.LBL_KEY_ENTITY_TYPE, CounterConstants.LBL_KEY_SWITCHID, CounterConstants.LBL_KEY_PORTID, CounterConstants.LBL_KEY_ALIASID, CounterConstants.LBL_KEY_COUNTER_NAME);
counter = labeledCounter.label(CounterConstants.LBL_VAL_ENTITY_TYPE_PORT).label(switchId.toString()).label(port).label(aliasId).label(counterName);
}
if (tableId != null) {
Labeled<Labeled<Labeled<Labeled<Counter>>>> labeledCounter = metricProvider.newCounter(MetricDescriptor.builder().anchor(this).project("genius").module("interfacemanager").id(CounterConstants.CNT_TYPE_ENTITY_CNT_ID).build(), CounterConstants.LBL_KEY_ENTITY_TYPE, CounterConstants.LBL_KEY_SWITCHID, CounterConstants.LBL_KEY_FLOWTBLID, CounterConstants.LBL_KEY_COUNTER_NAME);
counter = labeledCounter.label(CounterConstants.LBL_VAL_ENTITY_TYPE_FLOWTBL).label(switchId.toString()).label(tableId).label(counterName);
}
// create counters set for node if absent.
// and then populate counter set with counter object
// which will be needed to close counters when node is removed.
metricsCountersPerNodeMap.computeIfAbsent(switchId, counterSet -> ConcurrentHashMap.newKeySet()).add(counter);
return counter;
}
Aggregations