use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project bgpcep by opendaylight.
the class SetExtCommunityHandler method setExtComm.
private Attributes setExtComm(final Attributes attributes, final SetExtCommunityMethod setExtCommunityMethod, final BgpSetCommunityOptionType options) {
if (setExtCommunityMethod instanceof Inline) {
final Inline inline = (Inline) setExtCommunityMethod;
final List<ExtendedCommunities> list = inline.getExtCommunityMember().stream().map(ge -> new ExtendedCommunitiesBuilder().setExtendedCommunity(ge.getExtendedCommunity()).setTransitive(ge.isTransitive()).build()).collect(Collectors.toList());
return inlineSetExtComm(attributes, list, options);
}
return referenceSetExtComm(attributes, ((Reference) setExtCommunityMethod).getExtCommunitySetRef(), options);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project bgpcep by opendaylight.
the class SetCommunityTest method testReferenceRemove.
@Test
public void testReferenceRemove() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("set-community-reference-remove-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(this.multipleCom);
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertEquals(this.emptyCom, result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project bgpcep by opendaylight.
the class SetCommunityTest method testReferenceAdd.
@Test
public void testReferenceAdd() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("set-community-reference-add-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertEquals(this.multipleCom, result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project bgpcep by opendaylight.
the class SetExtCommunityTest method testReferenceRemove.
@Test
public void testReferenceRemove() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("set-ext-community-reference-remove-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(this.multipleExtCom);
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertEquals(this.emptyExtCom, result.getAttributes());
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.community.set.community.method.Reference in project bgpcep by opendaylight.
the class SetExtCommunityTest method testReferenceReplace.
@Test
public void testReferenceReplace() {
Statement statement = this.basicStatements.stream().filter(st -> st.getName().equals("set-ext-community-reference-replace-test")).findFirst().get();
RouteAttributeContainer attributeContainer = routeAttributeContainerFalse(new AttributesBuilder().build());
RouteAttributeContainer result = this.statementRegistry.applyExportStatement(this.baseAttributes, this.exportParameters, attributeContainer, statement);
assertEquals(this.multipleExtCom, result.getAttributes());
}
Aggregations