diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-07-14 09:14:22 +0200 |
---|---|---|
committer | Jan Srnicek <jsrnicek@cisco.com> | 2017-07-17 08:15:24 +0000 |
commit | a4a488f7cdd04498bfcda068bf171516a9afe4f0 (patch) | |
tree | 8601d776d71f5945bccd19e8394d61e412fbeb0d /infra/northbound/bgp/src/main/java | |
parent | 33f12d921cc503055ff82361f672fac7516d89ee (diff) |
Make BGP protocol instance name configurable
Change-Id: I49a201b8e027d229a60bb76abe9b5688af7b7cdf
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/northbound/bgp/src/main/java')
-rw-r--r-- | infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java | 17 | ||||
-rw-r--r-- | infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java | 8 |
2 files changed, 14 insertions, 11 deletions
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java index 6cc245af7..9335fb33d 100644 --- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java +++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpConfiguration.java @@ -45,17 +45,20 @@ public class BgpConfiguration { public Optional<String> bgpMultiplePaths; @InjectConfig("bgp-send-max-paths") public Optional<Integer> bgpSendMaxMaths; + @InjectConfig("bgp-protocol-instance-name") + public Optional<String> bgpProtocolInstanceName; @InjectConfig("bgp-netty-threads") public Integer bgpNettyThreads; @Override public String toString() { return MoreObjects.toStringHelper(this) - .add("bgpBindingAddress", bgpBindingAddress) - .add("bgpPort", bgpPort) - .add("bgp-as-number", bgpAsNumber) - .add("bgp-netty-threads", bgpNettyThreads) - .add("bgp-receive-multiple-paths", bgpMultiplePaths) - .add("bgp-send-max-paths", bgpSendMaxMaths) - .toString(); + .add("bgpBindingAddress", bgpBindingAddress) + .add("bgpPort", bgpPort) + .add("bgpAsNumber", bgpAsNumber) + .add("bgpMultiplePaths", bgpMultiplePaths) + .add("bgpSendMaxMaths", bgpSendMaxMaths) + .add("bgpProtocolInstanceName", bgpProtocolInstanceName) + .add("bgpNettyThreads", bgpNettyThreads) + .toString(); } } diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java index 9cd02b49e..7fcddfc5c 100644 --- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java +++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java @@ -52,7 +52,6 @@ import org.slf4j.LoggerFactory; final class BgpRIBProvider extends ProviderTrait<RIB> { private static final Logger LOG = LoggerFactory.getLogger(BgpRIBProvider.class); - private static final String HC_BGP_INSTANCE_NAME = "hc-bgp-instance"; @Inject private BgpConfiguration cfg; @@ -93,9 +92,10 @@ final class BgpRIBProvider extends ProviderTrait<RIB> { new TablesKey(entry.getKey().getAfi(), entry.getKey().getSafi()), Map.Entry::getValue)); // based on RIBImpl.createRib final RIBImpl rib = - new RIBImpl(new NoopClusterSingletonServiceProvider(), new RibId(HC_BGP_INSTANCE_NAME), asNumber, - new BgpId(routerId), clusterId, extensions, dispatcher, codec, new PingPongDataBroker(domBroker), - mappingService.toTableTypes(afiSafi), pathSelectionModes, extensions.getClassLoadingStrategy(), null); + new RIBImpl(new NoopClusterSingletonServiceProvider(), new RibId(cfg.bgpProtocolInstanceName.get()), + asNumber, new BgpId(routerId), clusterId, extensions, dispatcher, codec, + new PingPongDataBroker(domBroker), mappingService.toTableTypes(afiSafi), pathSelectionModes, + extensions.getClassLoadingStrategy(), null); // required for proper RIB's CodecRegistry initialization (based on RIBImpl.start) schemaService.registerSchemaContextListener(rib); |