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.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 public class L2GatewayProvider {
20 private static final Logger LOG = LoggerFactory.getLogger(L2GatewayProvider.class);
22 private L2GatewayListener l2GatewayListener;
24 public L2GatewayProvider(DataBroker broker, RpcProviderRegistry rpcRegistry,
25 EntityOwnershipService entityOwnershipService,
26 BindingNormalizedNodeSerializer bindingNormalizedNodeSerializer) {
27 L2GatewayCacheUtils.createL2DeviceCache();
28 l2GatewayListener = new L2GatewayListener(broker, rpcRegistry, entityOwnershipService,
29 bindingNormalizedNodeSerializer);
30 LOG.info("L2GatewayProvider Initialized");
33 public void close() throws Exception {
34 l2GatewayListener.close();
35 LOG.info("L2GatewayProvider Closed");