Make use of NetUtils.getBroadcastMacAddr()
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / utils / NodeTableCreator.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 package org.opendaylight.controller.sal.utils;
9
10 import org.opendaylight.controller.sal.core.ConstructionException;
11 import org.opendaylight.controller.sal.core.Node;
12 import org.opendaylight.controller.sal.core.NodeTable;
13 import org.opendaylight.controller.sal.core.NodeTable.NodeTableIDType;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 public class NodeTableCreator {
18     protected static final Logger logger = LoggerFactory
19             .getLogger(NodeTableCreator.class);
20
21     /**
22      * Generic NodeTable creator
23      * The nodeTable type is OPENFLOW only for the time being
24      *
25      * @param portId
26      * @param node
27      * @return
28      */
29     public static NodeTable createNodeTable(byte tableId, Node node) {
30         try {
31             return new NodeTable(NodeTableIDType.OPENFLOW, tableId, node);
32         } catch (ConstructionException e1) {
33             logger.error("",e1);
34             return null;
35         }
36     }
37
38     public static NodeTable createOFNodeTable(byte tableId, Node node) {
39         try {
40             return new NodeTable(NodeTableIDType.OPENFLOW, tableId, node);
41         } catch (ConstructionException e1) {
42             logger.error("",e1);
43             return null;
44         }
45     }
46
47 }