Search in sources :

Example 1 with SetExtCommunityMethod

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.ext.community.SetExtCommunityMethod 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);
}
Also used : BGPRouteEntryExportParameters(org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryExportParameters) Inline(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.set.ext.community.method.Inline) BgpActionPolicy(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.action.BgpActionPolicy) ExtendedCommunitiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunitiesBuilder) BgpSetCommunityOptionType(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.BgpSetCommunityOptionType) SetExtCommunity(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.SetExtCommunity) Collectors(java.util.stream.Collectors) StringUtils(org.apache.commons.lang3.StringUtils) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) AttributesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.AttributesBuilder) ArrayList(java.util.ArrayList) Reference(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.set.ext.community.method.Reference) ExtendedCommunities(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunities) List(java.util.List) AbstractExtCommunityHandler(org.opendaylight.protocol.bgp.openconfig.routing.policy.statement.AbstractExtCommunityHandler) SetExtCommunityMethod(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.SetExtCommunityMethod) BGPRouteEntryImportParameters(org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryImportParameters) RouteEntryBaseAttributes(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.RouteEntryBaseAttributes) Attributes(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes) ExtendedCommunities(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunities) Inline(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.set.ext.community.method.Inline) ExtendedCommunitiesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunitiesBuilder)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 StringUtils (org.apache.commons.lang3.StringUtils)1 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)1 RouteEntryBaseAttributes (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.RouteEntryBaseAttributes)1 BgpActionPolicy (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.action.BgpActionPolicy)1 AbstractExtCommunityHandler (org.opendaylight.protocol.bgp.openconfig.routing.policy.statement.AbstractExtCommunityHandler)1 BGPRouteEntryExportParameters (org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryExportParameters)1 BGPRouteEntryImportParameters (org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryImportParameters)1 BgpSetCommunityOptionType (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.BgpSetCommunityOptionType)1 SetExtCommunity (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.SetExtCommunity)1 SetExtCommunityMethod (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.SetExtCommunityMethod)1 Inline (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.set.ext.community.method.Inline)1 Reference (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.set.ext.community.set.ext.community.method.Reference)1 Attributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes)1 AttributesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.AttributesBuilder)1 ExtendedCommunities (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunities)1 ExtendedCommunitiesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.attributes.ExtendedCommunitiesBuilder)1