Merge "BUG-2329 Add test for anyxmls inside rpc resonse for netcfon-connector"
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / TableConverter.java
1 /*
2  * Copyright (c) 2013 Big Switch Networks, Inc.  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
9 package org.opendaylight.controller.protocol_plugin.openflow.internal;
10
11 import org.opendaylight.controller.sal.core.Node;
12 import org.opendaylight.controller.sal.core.NodeTable;
13 import org.opendaylight.controller.sal.utils.NodeTableCreator;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 public class TableConverter {
18     private static final Logger log = LoggerFactory
19             .getLogger(TableConverter.class);
20
21     public static NodeTable toNodeTable(byte tableId, Node node) {
22         log.trace("Openflow table ID: {}", Byte.toString(tableId));
23         return NodeTableCreator.createNodeTable(tableId, node);
24     }
25
26     public static byte toOFTable(NodeTable salTable) {
27         log.trace("SAL Table: {}", salTable);
28         return (Byte) salTable.getID();
29     }
30 }