2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. 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.vpnservice.neutronvpn.l2gw;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
13 import org.opendaylight.vpnservice.neutronvpn.api.l2gw.utils.L2GatewayCacheUtils;
14 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public class L2GatewayProvider {
19 private static final Logger LOG = LoggerFactory.getLogger(L2GatewayProvider.class);
21 private L2GatewayListener l2GatewayListener;
23 public L2GatewayProvider(DataBroker broker, RpcProviderRegistry rpcRegistry,
24 EntityOwnershipService entityOwnershipService) {
25 L2GatewayCacheUtils.createL2DeviceCache();
26 l2GatewayListener = new L2GatewayListener(broker, rpcRegistry, entityOwnershipService);
27 LOG.info("L2GatewayProvider Initialized");
30 public void close() throws Exception {
31 l2GatewayListener.close();
32 LOG.info("L2GatewayProvider Closed");