Bug 3302: fix for GroupTable
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / flow / OfTable.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
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.flow;
10
11 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfWriter;
12 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfContext;
13 import org.opendaylight.groupbasedpolicy.resolver.PolicyInfo;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 /**
19  * Manage the state of a openflow  table by reacting to any events and updating
20  * the table state.  This is an abstract class that must be extended for
21  * each specific table being managed.
22  * @author readams
23  */
24 public abstract class OfTable {
25     protected static final Logger LOG =
26             LoggerFactory.getLogger(OfTable.class);
27
28     protected final OfContext ctx;
29
30     public OfTable(OfContext ctx) {
31         super();
32         this.ctx = ctx;
33     }
34
35
36     // *******
37     // OfTable
38     // *******
39
40     /**
41      * Update the relevant flow table for the node
42      * @param nodeId the node to update
43      * @param policyInfo
44      * @param ofWriter
45      * @throws Exception
46      */
47     public abstract void update(NodeId nodeId,
48                                 PolicyInfo policyInfo,
49                                 OfWriter ofWriter) throws Exception;
50 }