Move adsal into its own subdirectory.
[controller.git] / opendaylight / adsal / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / TableConverter.java
diff --git a/opendaylight/adsal/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TableConverter.java b/opendaylight/adsal/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TableConverter.java
new file mode 100644 (file)
index 0000000..0b53284
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2013 Big Switch Networks, Inc.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.protocol_plugin.openflow.internal;
+
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.core.NodeTable;
+import org.opendaylight.controller.sal.utils.NodeTableCreator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TableConverter {
+    private static final Logger log = LoggerFactory
+            .getLogger(TableConverter.class);
+
+    public static NodeTable toNodeTable(byte tableId, Node node) {
+        log.trace("Openflow table ID: {}", Byte.toString(tableId));
+        return NodeTableCreator.createNodeTable(tableId, node);
+    }
+
+    public static byte toOFTable(NodeTable salTable) {
+        log.trace("SAL Table: {}", salTable);
+        return (Byte) salTable.getID();
+    }
+}