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.impl;
11 import static java.util.Objects.requireNonNull;
13 import org.opendaylight.mdsal.binding.api.DataBroker;
14 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.BGPRibRoutingPolicyFactory;
15 import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistryConsumer;
16 import org.opendaylight.protocol.bgp.rib.spi.policy.BGPRibRoutingPolicy;
17 import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.apply.policy.group.apply.policy.Config;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.ClusterIdentifier;
21 public final class BGPRibRoutingPolicyFactoryImpl implements BGPRibRoutingPolicyFactory {
22 private final StatementRegistryConsumer statementRegistryConsumer;
23 private final DataBroker databroker;
25 public BGPRibRoutingPolicyFactoryImpl(
26 final DataBroker databroker,
27 final StatementRegistryConsumer statementRegistryConsumer) {
28 this.databroker = requireNonNull(databroker);
29 this.statementRegistryConsumer = requireNonNull(statementRegistryConsumer);
33 public BGPRibRoutingPolicy buildBGPRibPolicy(final long localAs, final Ipv4Address bgpId,
34 final ClusterIdentifier clusterId, final Config policyConfig) {
35 requireNonNull(policyConfig);
36 return new BGPRibPolicyImpl(this.databroker, this.statementRegistryConsumer,
37 localAs, bgpId, clusterId, policyConfig);