use of org.opendaylight.yangtools.yang.binding.Augmentation in project bgpcep by opendaylight.
the class BgpConditionsRegistry method matchImportConditions.
public boolean matchImportConditions(final RouteEntryBaseAttributes entryInfo, final BGPRouteEntryImportParameters routeEntryImportParameters, final Attributes attributes, final Conditions conditions) {
final Conditions1 bgpConditionsAug = conditions.getAugmentation(Conditions1.class);
if (bgpConditionsAug != null) {
final BgpConditions bgpConditions = bgpConditionsAug.getBgpConditions();
synchronized (this) {
if (!matchImportCondition(entryInfo, routeEntryImportParameters, attributes, bgpConditions)) {
return false;
}
}
final Map<Class<? extends Augmentation<?>>, Augmentation<?>> bgpAug = BindingReflections.getAugmentations(bgpConditions);
for (final Map.Entry<Class<? extends Augmentation<?>>, Augmentation<?>> entry : bgpAug.entrySet()) {
final BgpConditionsAugmentationPolicy handler = this.bgpConditionsAugRegistry.get(entry.getKey());
if (handler == null) {
continue;
}
if (!handler.matchImportCondition(entryInfo, routeEntryImportParameters, handler.getConditionParameter(attributes), entry.getValue())) {
return false;
}
}
}
return true;
}
use of org.opendaylight.yangtools.yang.binding.Augmentation in project bgpcep by opendaylight.
the class BgpConditionsRegistry method matchExportConditions.
@SuppressWarnings("unchecked")
public boolean matchExportConditions(final RouteEntryBaseAttributes entryInfo, final BGPRouteEntryExportParameters routeEntryExportParameters, final Attributes attributes, final Conditions conditions) {
final Conditions1 bgpConditionsAug = conditions.getAugmentation(Conditions1.class);
if (bgpConditionsAug != null) {
final BgpConditions bgpConditions = bgpConditionsAug.getBgpConditions();
if (!matchExportCondition(entryInfo, routeEntryExportParameters, attributes, bgpConditions)) {
return false;
}
final Map<Class<? extends Augmentation<?>>, Augmentation<?>> bgpAug = BindingReflections.getAugmentations(bgpConditions);
for (final Map.Entry<Class<? extends Augmentation<?>>, Augmentation<?>> entry : bgpAug.entrySet()) {
final BgpConditionsAugmentationPolicy handler = this.bgpConditionsAugRegistry.get(entry.getKey());
if (handler == null) {
continue;
}
if (!handler.matchExportCondition(entryInfo, routeEntryExportParameters, handler.getConditionParameter(attributes), entry.getValue())) {
return false;
}
}
}
return true;
}
use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.
the class ArpShaConvertorTest method setUp.
@Before
public void setUp() throws Exception {
final NxmNxArpShaBuilder nxmNxArpShaBuilder = new NxmNxArpShaBuilder().setMacAddress(MAC_ADDRESS);
final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder().setNxmNxArpSha(nxmNxArpShaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
arpShaConvertor = new ArpShaConvertor();
}
use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.
the class CtStateConvertorTest method setUp.
@Before
public void setUp() throws Exception {
final NxmNxCtStateBuilder nxmNxCtStateBuilder = new NxmNxCtStateBuilder().setCtState(1L).setMask(2L);
final NxAugMatchNodesNodeTableFlowBuilder nxAugMatchNotifUpdateFlowStatsBuilder = new NxAugMatchNodesNodeTableFlowBuilder();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtState(nxmNxCtStateBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
ctStateConvertor = new CtStateConvertor();
}
use of org.opendaylight.yangtools.yang.binding.Augmentation in project openflowplugin by opendaylight.
the class ArpTpaConvertorTest method setUp.
@Before
public void setUp() throws Exception {
final NxmOfArpTpaBuilder nxmOfArpTpaBuilder = new NxmOfArpTpaBuilder().setIpv4Address(IPV4_ADDRESS);
final NxAugMatchRpcAddFlowBuilder nxAugMatchRpcAddFlowBuilder = new NxAugMatchRpcAddFlowBuilder();
nxAugMatchRpcAddFlowBuilder.setNxmOfArpTpa(nxmOfArpTpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any())).thenReturn(extensionAugmentation);
arpTpaConvertor = new ArpTpaConvertor();
}
Aggregations