blob: 2971f9fc6eb0bafeea1418897e3feb0bbbbdb623 [file] [log] [blame]
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -08001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Ramon Casellas390efe92018-03-01 11:45:27 +010015 *
16 *
17 * This work was partially supported by EC H2020 project METRO-HAUL (761727).
18 * Contact: Ramon Casellas <ramon.casellas@cttc.es>
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -080019 */
Ramon Casellas390efe92018-03-01 11:45:27 +010020
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -080021package org.onosproject.odtn.impl;
22
Ray Milkeyd84f89b2018-08-17 14:54:17 -070023import org.osgi.service.component.annotations.Activate;
24import org.osgi.service.component.annotations.Component;
25import org.osgi.service.component.annotations.Deactivate;
26import org.osgi.service.component.annotations.Reference;
27import org.osgi.service.component.annotations.ReferenceCardinality;
Ramon Casellas247a68f2019-01-18 13:36:14 +010028
hirokifca084b2018-06-02 08:29:42 -070029import org.onosproject.net.ConnectPoint;
Ramon Casellas247a68f2019-01-18 13:36:14 +010030import org.onosproject.net.device.DeviceEvent;
31import org.onosproject.net.device.DeviceListener;
32import org.onosproject.net.device.DeviceService;
33import org.onosproject.net.Port;
hirokib8ddc3f2018-06-02 08:29:42 -070034import org.onosproject.net.DeviceId;
hirokibca3e932018-05-15 15:25:54 -070035import org.onosproject.net.Link;
Ramon Casellas247a68f2019-01-18 13:36:14 +010036
hirokifca084b2018-06-02 08:29:42 -070037import org.onosproject.net.config.ConfigFactory;
hirokif4ed5212018-05-26 22:39:38 -070038import org.onosproject.net.config.NetworkConfigEvent;
39import org.onosproject.net.config.NetworkConfigListener;
hirokifca084b2018-06-02 08:29:42 -070040import org.onosproject.net.config.NetworkConfigRegistry;
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -080041import org.onosproject.net.config.NetworkConfigService;
Ramon Casellas247a68f2019-01-18 13:36:14 +010042
43import static com.google.common.base.Preconditions.checkNotNull;
44import static org.onosproject.net.config.NetworkConfigEvent.Type.CONFIG_ADDED;
45import static org.onosproject.net.config.NetworkConfigEvent.Type.CONFIG_REMOVED;
46import static org.onosproject.net.config.NetworkConfigEvent.Type.CONFIG_UPDATED;
47import static org.onosproject.net.config.basics.SubjectFactories.CONNECT_POINT_SUBJECT_FACTORY;
48
49
hirokibca3e932018-05-15 15:25:54 -070050import org.onosproject.net.link.LinkEvent;
51import org.onosproject.net.link.LinkListener;
52import org.onosproject.net.link.LinkService;
Ramon Casellas247a68f2019-01-18 13:36:14 +010053
hirokif4ed5212018-05-26 22:39:38 -070054import org.onosproject.odtn.TapiResolver;
Ramon Casellas247a68f2019-01-18 13:36:14 +010055import org.onosproject.odtn.TapiConnectivityConfig;
56import org.onosproject.odtn.TapiConnectivityService;
hirokif4ed5212018-05-26 22:39:38 -070057import org.onosproject.odtn.TapiTopologyManager;
hirokifca084b2018-06-02 08:29:42 -070058import org.onosproject.odtn.config.TerminalDeviceConfig;
hirokif4ed5212018-05-26 22:39:38 -070059import org.onosproject.odtn.internal.DcsBasedTapiCommonRpc;
60import org.onosproject.odtn.internal.DcsBasedTapiConnectivityRpc;
hirokib8ddc3f2018-06-02 08:29:42 -070061import org.onosproject.odtn.internal.DefaultOdtnTerminalDeviceDriver;
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -080062import org.slf4j.Logger;
63import org.slf4j.LoggerFactory;
64
hirokif4ed5212018-05-26 22:39:38 -070065// DCS / onos-yang-tools
66import org.onosproject.config.DynamicConfigEvent;
67import org.onosproject.config.DynamicConfigListener;
68import org.onosproject.config.DynamicConfigService;
Ramon Casellas390efe92018-03-01 11:45:27 +010069import org.onosproject.yang.model.RpcRegistry;
Ramon Casellas390efe92018-03-01 11:45:27 +010070
hiroki684aa2f2018-05-19 20:48:49 -070071import static org.onosproject.config.DynamicConfigEvent.Type.NODE_ADDED;
72import static org.onosproject.config.DynamicConfigEvent.Type.NODE_DELETED;
Ramon Casellas247a68f2019-01-18 13:36:14 +010073import org.onosproject.core.ApplicationId;
74import org.onosproject.core.CoreService;
75import static org.onosproject.net.optical.device.OpticalDeviceServiceView.opticalView;
76
77import org.onosproject.net.intent.IntentService;
78import org.onosproject.net.intent.Intent;
79import org.onosproject.net.intent.IntentState;
80import org.onosproject.net.intent.IntentEvent;
81import org.onosproject.net.intent.IntentListener;
82import static org.onosproject.net.intent.IntentState.FAILED;
83import static org.onosproject.net.intent.IntentState.WITHDRAWN;
84import org.onosproject.net.intent.Key;
85import org.onosproject.net.intent.OpticalConnectivityIntent;
86import org.onosproject.net.optical.OchPort;
Ramon Casellas247a68f2019-01-18 13:36:14 +010087import org.onosproject.net.OduSignalType;
88
89import java.util.Objects;
90import java.util.concurrent.CountDownLatch;
91import java.util.concurrent.TimeUnit;
hiroki684aa2f2018-05-19 20:48:49 -070092
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -080093/**
94 * OSGi Component for ODTN Service application.
95 */
Ramon Casellas247a68f2019-01-18 13:36:14 +010096@Component(immediate = true, service = TapiConnectivityService.class)
97public class ServiceApplicationComponent implements TapiConnectivityService {
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -080098
99 private final Logger log = LoggerFactory.getLogger(getClass());
100
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700101 @Reference(cardinality = ReferenceCardinality.MANDATORY)
hiroki684aa2f2018-05-19 20:48:49 -0700102 protected DynamicConfigService dynConfigService;
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -0800103
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700104 @Reference(cardinality = ReferenceCardinality.MANDATORY)
hirokibca3e932018-05-15 15:25:54 -0700105 protected DeviceService deviceService;
106
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700107 @Reference(cardinality = ReferenceCardinality.MANDATORY)
Ramon Casellas247a68f2019-01-18 13:36:14 +0100108 protected IntentService intentService;
109
110 @Reference(cardinality = ReferenceCardinality.MANDATORY)
hirokibca3e932018-05-15 15:25:54 -0700111 protected LinkService linkService;
112
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700113 @Reference(cardinality = ReferenceCardinality.MANDATORY)
Ramon Casellas247a68f2019-01-18 13:36:14 +0100114 protected CoreService coreService;
115
116 @Reference(cardinality = ReferenceCardinality.MANDATORY)
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -0800117 protected NetworkConfigService netcfgService;
118
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700119 @Reference(cardinality = ReferenceCardinality.MANDATORY)
hirokifca084b2018-06-02 08:29:42 -0700120 protected NetworkConfigRegistry netcfgRegistry;
121
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700122 @Reference(cardinality = ReferenceCardinality.MANDATORY)
Ramon Casellas390efe92018-03-01 11:45:27 +0100123 protected RpcRegistry rpcRegistry;
124
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700125 @Reference(cardinality = ReferenceCardinality.MANDATORY)
hirokibca3e932018-05-15 15:25:54 -0700126 protected TapiTopologyManager tapiTopologyManager;
Ramon Casellas390efe92018-03-01 11:45:27 +0100127
Ray Milkeyd84f89b2018-08-17 14:54:17 -0700128 @Reference(cardinality = ReferenceCardinality.MANDATORY)
hiroki684aa2f2018-05-19 20:48:49 -0700129 protected TapiResolver resolver;
130
Ramon Casellas247a68f2019-01-18 13:36:14 +0100131 private static final int WITHDRAW_EVENT_TIMEOUT_SECONDS = 5;
132
133 private static final String APP_ID = "org.onosproject.odtn-service";
134
135 private ApplicationId appId;
136
Ramon Casellas390efe92018-03-01 11:45:27 +0100137 // Listener for events from the DCS
hiroki684aa2f2018-05-19 20:48:49 -0700138 private final DynamicConfigListener dynamicConfigServiceListener =
139 new InternalDynamicConfigListener();
hirokibca3e932018-05-15 15:25:54 -0700140
141 private DeviceListener deviceListener = new InternalDeviceListener();
142 private final LinkListener linkListener = new InternalLinkListener();
hirokif4ed5212018-05-26 22:39:38 -0700143 private final NetworkConfigListener netcfgListener = new InternalNetCfgListener();
Ramon Casellas390efe92018-03-01 11:45:27 +0100144
145 // Rpc Service for TAPI Connectivity
hirokif4ed5212018-05-26 22:39:38 -0700146 private final DcsBasedTapiConnectivityRpc rpcTapiConnectivity = new DcsBasedTapiConnectivityRpc();
147 private final DcsBasedTapiCommonRpc rpcTapiCommon = new DcsBasedTapiCommonRpc();
hiroki684aa2f2018-05-19 20:48:49 -0700148
hirokifca084b2018-06-02 08:29:42 -0700149 // FIXME create factory and register for all behaviours
150 private final ConfigFactory<ConnectPoint, TerminalDeviceConfig> factory =
151 new ConfigFactory<ConnectPoint, TerminalDeviceConfig>(CONNECT_POINT_SUBJECT_FACTORY,
152 TerminalDeviceConfig.class, TerminalDeviceConfig.CONFIG_KEY) {
Ramon Casellas247a68f2019-01-18 13:36:14 +0100153
hirokifca084b2018-06-02 08:29:42 -0700154 @Override
155 public TerminalDeviceConfig createConfig() {
156 return new TerminalDeviceConfig();
157 }
158 };
159
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -0800160 @Activate
161 protected void activate() {
162 log.info("Started");
Ramon Casellas247a68f2019-01-18 13:36:14 +0100163 appId = coreService.registerApplication(APP_ID);
hiroki684aa2f2018-05-19 20:48:49 -0700164 dynConfigService.addListener(dynamicConfigServiceListener);
hirokibca3e932018-05-15 15:25:54 -0700165 deviceService.addListener(deviceListener);
166 linkService.addListener(linkListener);
hirokif4ed5212018-05-26 22:39:38 -0700167 netcfgService.addListener(netcfgListener);
hirokifca084b2018-06-02 08:29:42 -0700168 netcfgRegistry.registerConfigFactory(factory);
Ramon Casellas390efe92018-03-01 11:45:27 +0100169 rpcRegistry.registerRpcService(rpcTapiConnectivity);
hiroki684aa2f2018-05-19 20:48:49 -0700170 rpcRegistry.registerRpcService(rpcTapiCommon);
hirokifca084b2018-06-02 08:29:42 -0700171
hirokif4ed5212018-05-26 22:39:38 -0700172 rpcTapiConnectivity.init();
173 rpcTapiCommon.init();
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -0800174 }
175
176 @Deactivate
177 protected void deactivate() {
178 log.info("Stopped");
hiroki684aa2f2018-05-19 20:48:49 -0700179 rpcRegistry.unregisterRpcService(rpcTapiCommon);
Ramon Casellas390efe92018-03-01 11:45:27 +0100180 rpcRegistry.unregisterRpcService(rpcTapiConnectivity);
hirokifca084b2018-06-02 08:29:42 -0700181 netcfgRegistry.unregisterConfigFactory(factory);
hirokif4ed5212018-05-26 22:39:38 -0700182 netcfgService.removeListener(netcfgListener);
hirokibca3e932018-05-15 15:25:54 -0700183 linkService.removeListener(linkListener);
hirokiec18d3a2018-05-16 15:27:37 -0700184 deviceService.removeListener(deviceListener);
hiroki684aa2f2018-05-19 20:48:49 -0700185 dynConfigService.removeListener(dynamicConfigServiceListener);
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -0800186 }
187
Ramon Casellas390efe92018-03-01 11:45:27 +0100188
hirokibca3e932018-05-15 15:25:54 -0700189 /**
Ramon Casellas247a68f2019-01-18 13:36:14 +0100190 * Process TAPI Event from NBI.
191 *
192 * @param config TAPI Connectivity config for the event
193 */
194 public void processTapiEvent(TapiConnectivityConfig config) {
195 checkNotNull(config, "Config can't be null");
196 Key key = Key.of(config.uuid(), appId);
197 // Setup the Intent
198 if (config.isSetup()) {
199 log.debug("TAPI config: {} to setup intent", config);
200 Intent intent = createOpticalIntent(config.leftCp(), config.rightCp(), key, appId);
201 intentService.submit(intent);
202 } else {
203 // Release the intent
204 Intent intent = intentService.getIntent(key);
205 if (intent == null) {
206 log.error("Intent for uuid {} does not exist", config.uuid());
207 return;
208 }
209 log.debug("TAPI config: {} to purge intent {}", config, intent);
210 CountDownLatch latch = new CountDownLatch(1);
211 IntentListener listener = new DeleteListener(key, latch);
212 intentService.addListener(listener);
213 try {
214 /*
215 * RCAS: Note, withdraw is asynchronous. We cannot call purge
216 * directly, because at this point it remains in the "INSTALLED"
217 * state.
218 */
219 intentService.withdraw(intent);
220
221 /*
222 * org.onosproject.onos-core-net - 2.1.0.SNAPSHOT |
223 * Purge for intent 0x0 is rejected because intent state is INSTALLED
224 * intentService.purge(intent);
225 */
226 try {
227 latch.await(WITHDRAW_EVENT_TIMEOUT_SECONDS, TimeUnit.SECONDS);
228 } catch (InterruptedException e) {
229 Thread.currentThread().interrupt();
230 }
231 // double check the state
232 IntentState state = intentService.getIntentState(key);
233 if (state == WITHDRAWN || state == FAILED) {
234 intentService.purge(intent);
235 }
236 } finally {
237 intentService.removeListener(listener);
238 }
239 }
240 }
241
242 /**
243 * Returns a new optical intent created from the method parameters.
244 *
245 * @param ingress ingress description (device/port)
246 * @param egress egress description (device/port)
247 * @param key intent key
248 * @param appId application id. As per Intent class, it cannot be null
249 *
250 * @return created intent
251 */
252 protected Intent createOpticalIntent(ConnectPoint ingress, ConnectPoint egress,
253 Key key, ApplicationId appId) {
Andrea Campanella9da8e722019-03-12 18:35:39 -0700254
Ramon Casellas247a68f2019-01-18 13:36:14 +0100255 if (ingress == null || egress == null) {
256 log.error("Invalid endpoint(s) for optical intent: ingress {}, egress {}",
257 ingress, egress);
258 return null;
259 }
260 DeviceService ds = opticalView(deviceService);
261 Port srcPort = ds.getPort(ingress.deviceId(), ingress.port());
262 Port dstPort = ds.getPort(egress.deviceId(), egress.port());
263 if (srcPort == null || dstPort == null) {
264 log.error("Invalid port(s) for optical intent: src {}, dst {}",
265 srcPort, dstPort);
266 return null;
267 }
268
Ramon Casellas247a68f2019-01-18 13:36:14 +0100269 OduSignalType signalType = ((OchPort) srcPort).signalType();
Andrea Campanella9da8e722019-03-12 18:35:39 -0700270 return OpticalConnectivityIntent.builder()
Ramon Casellas247a68f2019-01-18 13:36:14 +0100271 .appId(appId)
272 .key(key)
273 .src(ingress)
274 .dst(egress)
275 .signalType(signalType)
Andrea Campanella9da8e722019-03-12 18:35:39 -0700276 .bidirectional(true) //TODO Revisit this.
Ramon Casellas247a68f2019-01-18 13:36:14 +0100277 .build();
Ramon Casellas247a68f2019-01-18 13:36:14 +0100278 }
279
280
281 /**
hirokibca3e932018-05-15 15:25:54 -0700282 * Representation of internal listener, listening for device event.
283 */
284 private class InternalDeviceListener implements DeviceListener {
hirokibca3e932018-05-15 15:25:54 -0700285 /**
286 * Process an Event from the Device Service.
287 *
288 * @param event device event
289 */
290 @Override
291 public void event(DeviceEvent event) {
hirokibca3e932018-05-15 15:25:54 -0700292
Andrea Campanella77e9b332018-11-29 13:33:19 -0800293 log.debug("Device event type: {}, subject: {}", event.type(), event.subject());
hirokibca3e932018-05-15 15:25:54 -0700294 switch (event.type()) {
295 case DEVICE_ADDED:
hirokiec18d3a2018-05-16 15:27:37 -0700296 tapiTopologyManager.addDevice(event.subject());
hirokibca3e932018-05-15 15:25:54 -0700297 break;
298 case DEVICE_REMOVED:
hirokiec18d3a2018-05-16 15:27:37 -0700299 tapiTopologyManager.removeDevice(event.subject());
hirokibca3e932018-05-15 15:25:54 -0700300 break;
301 case PORT_ADDED:
hirokiec18d3a2018-05-16 15:27:37 -0700302 tapiTopologyManager.addPort(event.port());
hirokibca3e932018-05-15 15:25:54 -0700303 break;
304 case PORT_REMOVED:
hirokiec18d3a2018-05-16 15:27:37 -0700305 tapiTopologyManager.removePort(event.port());
hirokibca3e932018-05-15 15:25:54 -0700306 break;
Ramon Casellas03f194f2018-11-15 16:06:02 +0100307 // TODO: Process device / port updated events
hirokibca3e932018-05-15 15:25:54 -0700308 default:
Ramon Casellas03f194f2018-11-15 16:06:02 +0100309 log.warn("Unprocessed Event {}", event.type());
hirokibca3e932018-05-15 15:25:54 -0700310 break;
311 }
312
313 }
314 }
315
316 /**
317 * Representation of internal listener, listening for link event.
318 */
319 private class InternalLinkListener implements LinkListener {
hirokibca3e932018-05-15 15:25:54 -0700320 /**
321 * Process an Event from the Device Service.
322 *
323 * @param event link event
324 */
325 @Override
326 public void event(LinkEvent event) {
327 Link link = event.subject();
328
329 switch (event.type()) {
330 case LINK_ADDED:
331 tapiTopologyManager.addLink(link);
332 break;
333 case LINK_REMOVED:
334 tapiTopologyManager.removeLink(link);
335 break;
336 default:
Ramon Casellas03f194f2018-11-15 16:06:02 +0100337 log.warn("Unknown Event {}", event.type());
hirokibca3e932018-05-15 15:25:54 -0700338 break;
339 }
340 }
341 }
Ramon Casellas390efe92018-03-01 11:45:27 +0100342
Ramon Casellas247a68f2019-01-18 13:36:14 +0100343
hiroki684aa2f2018-05-19 20:48:49 -0700344 /**
hirokif4ed5212018-05-26 22:39:38 -0700345 * Representation of internal listener, listening for netcfg event.
346 */
347 private class InternalNetCfgListener implements NetworkConfigListener {
hirokif4ed5212018-05-26 22:39:38 -0700348 /**
hirokifca084b2018-06-02 08:29:42 -0700349 * Check if the netcfg event should be further processed.
350 *
351 * @param event config event
352 * @return true if event is supported; false otherwise
353 */
354 @Override
355 public boolean isRelevant(NetworkConfigEvent event) {
hirokifca084b2018-06-02 08:29:42 -0700356 if (event.type() == CONFIG_ADDED || event.type() == CONFIG_UPDATED) {
357 if (event.config().orElse(null) instanceof TerminalDeviceConfig) {
358 return true;
359 }
360 }
361 if (event.type() == CONFIG_REMOVED) {
362 if (event.prevConfig().orElse(null) instanceof TerminalDeviceConfig) {
363 return true;
364 }
365 }
366 return false;
367 }
368
369 /**
hirokif4ed5212018-05-26 22:39:38 -0700370 * Process an Event from the NetCfg Service.
371 *
hirokifca084b2018-06-02 08:29:42 -0700372 * @param event event
hirokif4ed5212018-05-26 22:39:38 -0700373 */
374 @Override
375 public void event(NetworkConfigEvent event) {
Andrea Campanella77e9b332018-11-29 13:33:19 -0800376 log.debug("Event type: {}, subject: {}", event.type(), event.subject());
hirokib8ddc3f2018-06-02 08:29:42 -0700377 DeviceId did = ((ConnectPoint) event.subject()).deviceId();
Ramon Casellas247a68f2019-01-18 13:36:14 +0100378 TerminalDeviceConfig config = (TerminalDeviceConfig) event.config().get();
hirokib8ddc3f2018-06-02 08:29:42 -0700379 DefaultOdtnTerminalDeviceDriver driver = DefaultOdtnTerminalDeviceDriver.create();
Ramon Casellas247a68f2019-01-18 13:36:14 +0100380 log.debug("config: {}", config);
hirokib8ddc3f2018-06-02 08:29:42 -0700381 switch (event.type()) {
382 case CONFIG_ADDED:
383 case CONFIG_UPDATED:
hirokib8ddc3f2018-06-02 08:29:42 -0700384 driver.apply(did, config.clientCp().port(), config.subject().port(), config.isEnabled());
385 break;
Ramon Casellas247a68f2019-01-18 13:36:14 +0100386
hirokib8ddc3f2018-06-02 08:29:42 -0700387 case CONFIG_REMOVED:
hirokib8ddc3f2018-06-02 08:29:42 -0700388 driver.apply(did, config.clientCp().port(), config.subject().port(), false);
389 break;
390 default:
391 log.error("Unsupported event type.");
392 }
hirokif4ed5212018-05-26 22:39:38 -0700393 }
394 }
395
Ramon Casellas247a68f2019-01-18 13:36:14 +0100396
397 /**
398 * Internal listener for tracking the intent deletion events.
399 */
400 private class DeleteListener implements IntentListener {
401 final Key key;
402 final CountDownLatch latch;
403
404 /**
405 * Default constructor.
406 *
407 * @param key key
408 * @param latch count down latch
409 */
410 DeleteListener(Key key, CountDownLatch latch) {
411 this.key = key;
412 this.latch = latch;
413 }
414
415 @Override
416 public void event(IntentEvent event) {
417 if (Objects.equals(event.subject().key(), key) &&
418 (event.type() == IntentEvent.Type.WITHDRAWN ||
419 event.type() == IntentEvent.Type.FAILED)) {
420 latch.countDown();
421 }
422 }
423 }
424
hirokif4ed5212018-05-26 22:39:38 -0700425 /**
hiroki684aa2f2018-05-19 20:48:49 -0700426 * Representation of internal listener, listening for dynamic config event.
427 */
428 private class InternalDynamicConfigListener implements DynamicConfigListener {
429
430 /**
431 * Check if the DCS event should be further processed.
432 *
433 * @param event config event
434 * @return true if event is supported; false otherwise
435 */
436 @Override
437 public boolean isRelevant(DynamicConfigEvent event) {
438 // Only care about add and delete
439 if ((event.type() != NODE_ADDED) &&
440 (event.type() != NODE_DELETED)) {
441 return false;
442 }
443 return true;
444 }
445
446
447 /**
448 * Process an Event from the Dynamic Configuration Store.
449 *
450 * @param event config event
451 */
452 @Override
453 public void event(DynamicConfigEvent event) {
454 resolver.makeDirty();
hiroki684aa2f2018-05-19 20:48:49 -0700455 }
hiroki684aa2f2018-05-19 20:48:49 -0700456 }
Ramon Casellas390efe92018-03-01 11:45:27 +0100457
Yuta HIGUCHIa9ae6e62018-02-26 12:56:20 -0800458}