f60580d9b9fe242e30b919e28c105b65f4f67bdc
[bgpcep.git] / bgp / rib-spi / src / main / java / org / opendaylight / protocol / bgp / rib / spi / policy / BGPRibRoutingPolicy.java
1 /*
2  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.rib.spi.policy;
9
10 import java.util.Optional;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.types.rev151009.AfiSafiType;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev180329.path.attributes.Attributes;
14
15 /**
16  * Interface for BGP RIB Routing Policy. Apply Import/Export Routing Policy to route attributes.
17  */
18 public interface BGPRibRoutingPolicy {
19     /**
20      * Apply import policy to route attributes.
21      *
22      * @param policyParameters containing attributes and sender peer information
23      * @param attributes       Route attributes
24      * @param afiSafType       Afi Safi Type
25      * @return modified route attributes after apply policies
26      */
27     @Nonnull
28     Optional<Attributes> applyImportPolicies(
29             @Nonnull BGPRouteEntryImportParameters policyParameters,
30             @Nonnull Attributes attributes,
31             @Nonnull Class<? extends AfiSafiType> afiSafType
32     );
33
34     /**
35      * Apply export policy to route attributes.
36      *
37      * @param policyParameters containing attributes and sender/receiver peer information
38      * @param attributes       Route attributes
39      * @param afiSafType       Afi Safi Type
40      * @return modified route attributes after apply policies
41      */
42     @Nonnull
43     Optional<Attributes> applyExportPolicies(
44             @Nonnull BGPRouteEntryExportParameters policyParameters,
45             @Nonnull Attributes attributes,
46             @Nonnull Class<? extends AfiSafiType> afiSafType
47     );
48 }