Bug 960 : Avoid adding redundant Openflow Controller entries
[netvirt.git] / plugin / src / main / java / org / opendaylight / ovsdb / plugin / impl / NodeConnectorFactory.java
1 /*
2  * Copyright (C) 2013 Red Hat, Inc.
3  *
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
7  *
8  * Authors : Madhu Venugopal, Brent Salisbury
9  */
10 package org.opendaylight.ovsdb.plugin.impl;
11
12 import org.opendaylight.controller.sal.core.NodeConnector;
13 import org.opendaylight.controller.sal.utils.INodeConnectorFactory;
14 import org.opendaylight.controller.sal.core.Node;
15
16 public class NodeConnectorFactory implements INodeConnectorFactory {
17     public NodeConnector fromStringNoNode(String typeStr, String IDStr,
18               Node n){
19           if(typeStr.equals("OVS")){
20               try {
21                   return new NodeConnector(typeStr, IDStr, n);
22               } catch (Exception ex) {
23                   return null;
24               }
25           }
26           return null;
27       }
28 }