2 * Copyright (c) 2017 Cisco Systems, Inc. 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
8 package org.opendaylight.lispflowmapping.neutron.intenthandler;
10 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
11 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
12 import org.opendaylight.lispflowmapping.neutron.intenthandler.listener.service.VbridgeTopologyListenerService;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
17 * Created by Shakib Ahmed on 1/19/17.
21 * This is the bean instantiated when lisp neutron service is installed. This bean
22 * registers and maintain listeners for getting updates of Neutron Topology
23 * maintained by groupbasedpolicy and honeycomb vbd.
25 public class GroupBasedPolicyNeutronIntentHandlerBean implements AutoCloseable {
26 private static final Logger LOG = LoggerFactory.getLogger(GroupBasedPolicyNeutronIntentHandlerBean.class);
28 private final DataBroker dataBroker;
29 private final MountPointService mountService;
31 private VbridgeTopologyListenerService vbridgeTopologyListenerService;
33 private final IntentHandlerAsyncExecutorProvider intentHandlerAsyncExecutorProvider =
34 IntentHandlerAsyncExecutorProvider.getInstace();
36 public GroupBasedPolicyNeutronIntentHandlerBean(DataBroker dataBroker, MountPointService mountService) {
37 this.dataBroker = dataBroker;
38 this.mountService = mountService;
43 public void close() throws Exception {
44 LOG.info("Clustering provider closed for {}", this.getClass().getSimpleName());
45 intentHandlerAsyncExecutorProvider.close();
49 LOG.info("LFM neutron handler service registered", this.getClass().getSimpleName());
50 vbridgeTopologyListenerService = VbridgeTopologyListenerService.initialize(dataBroker, mountService);