2 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.protocol.bgp.openconfig.routing.policy.statement.actions;
11 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.RouteEntryBaseAttributes;
12 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.policy.action.BgpActionPolicy;
13 import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryExportParameters;
14 import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRouteEntryImportParameters;
15 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.policy.rev151009.routing.policy.policy.definitions.policy.definition.statements.statement.actions.bgp.actions.SetAsPathPrepend;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes;
20 * Prepend local AS, one time(n times not supported yet).
22 public final class AsPathPrepend extends AbstractPrependAsPath implements BgpActionPolicy<SetAsPathPrepend> {
24 public Attributes applyImportAction(
25 final RouteEntryBaseAttributes routeEntryInfo,
26 final BGPRouteEntryImportParameters routeEntryImportParameters,
27 final Attributes attributes,
28 final SetAsPathPrepend bgpActions) {
33 public Attributes applyExportAction(
34 final RouteEntryBaseAttributes routeEntryInfo,
35 final BGPRouteEntryExportParameters exportParameters,
36 final Attributes attributes,
37 final SetAsPathPrepend actions) {
38 return prependAS(attributes, new AsNumber(routeEntryInfo.getLocalAs()));