2 * Copyright (c) 2015 Brocade Communications Systems, Inc. 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
8 package org.opendaylight.ovsdb.compatibility.plugin.impl;
10 import java.util.List;
13 import org.opendaylight.controller.sal.core.Node;
14 import org.opendaylight.ovsdb.compatibility.plugin.api.OvsdbConnectionService;
15 import org.opendaylight.ovsdb.plugin.api.Connection;
16 import org.opendaylight.ovsdb.plugin.api.ConnectionConstants;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
21 * This is a proxy class for ovsdb plugin's OvsdbConnectionService class
22 * It just forward the call to OvsdbConnectionService instance and pass
23 * back the response to the caller.
25 * @author Anil Vishnoi (vishnoianil@gmail.com)
28 public class ConnectionServiceImpl implements OvsdbConnectionService{
29 protected static final Logger logger = LoggerFactory.getLogger(ConnectionServiceImpl.class);
31 org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService pluginOvsdbConnectionService;
37 * Function called by the dependency manager when at least one dependency
38 * become unsatisfied or when the component is shutting down because for
39 * example bundle is being stopped.
45 * Function called by dependency manager after "init ()" is called and after
46 * the services provided by the class are registered in the service registry
52 * Function called by the dependency manager before the services exported by
53 * the component are unregistered, this will be followed by a "destroy ()"
59 public void setOvsdbConnectionService(org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService pluginOvsdbConnectionService){
60 this.pluginOvsdbConnectionService = pluginOvsdbConnectionService;
63 public void unsetOvsdbConnectionService(org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService pluginOvsdbConnectionService){
64 if(this.pluginOvsdbConnectionService != null)
65 this.pluginOvsdbConnectionService = null;
68 public Connection getConnection(Node node) {
69 return pluginOvsdbConnectionService.getConnection(node);
73 public Node getNode (String identifier) {
74 return pluginOvsdbConnectionService.getNode(identifier);
78 public List<Node> getNodes() {
79 return pluginOvsdbConnectionService.getNodes();
83 public Node connect(String identifier, Map<ConnectionConstants, String> params) {
84 return pluginOvsdbConnectionService.connect(identifier, params);