Fixed discard-changes for mdsal netconf, mapping code cleanup.
[controller.git] / opendaylight / md-sal / compatibility / sal-compatibility / src / main / java / org / opendaylight / controller / sal / compatibility / MDSalNodeConnectorFactory.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
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 package org.opendaylight.controller.sal.compatibility;
9
10 import org.opendaylight.controller.sal.core.ConstructionException;
11 import org.opendaylight.controller.sal.core.Node;
12 import org.opendaylight.controller.sal.core.NodeConnector;
13 import org.opendaylight.controller.sal.utils.INodeConnectorFactory;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 public class MDSalNodeConnectorFactory implements INodeConnectorFactory{
18     private Logger logger = LoggerFactory.getLogger(MDSalNodeConnectorFactory.class);
19
20     @Override
21     public NodeConnector fromStringNoNode(String type, String id, Node node) {
22         try {
23             return new NodeConnector(type, id, node);
24         } catch (ConstructionException e) {
25             logger.error("Could not construct NodeConnector", e);
26         }
27         return null;
28
29     }
30 }