Merge "Move utility function to common place."
[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 java.util.concurrent.ScheduledExecutorService;
12
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
15 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.EndpointManager;
16 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.OfContext;
17 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.PolicyManager;
18 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.PolicyManager.Dirty;
19 import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.SwitchManager;
20 import org.opendaylight.groupbasedpolicy.resolver.PolicyInfo;
21 import org.opendaylight.groupbasedpolicy.resolver.PolicyResolver;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25
26 /**
27  * Manage the state of a openflow  table by reacting to any events and updating
28  * the table state.  This is an abstract class that must be extended for
29  * each specific table being managed.
30  * @author readams
31  */
32 public abstract class OfTable {
33     protected static final Logger LOG =
34             LoggerFactory.getLogger(OfTable.class);
35
36     protected final OfContext ctx;
37
38     public OfTable(OfContext ctx) {
39         super();
40         this.ctx = ctx;
41     }
42
43
44     // *******
45     // OfTable
46     // *******
47
48     /**
49      * Update the relevant flow table for the node
50      * @param nodeId the node to update
51      * @param dirty the dirty set
52      * @throws Exception
53      */
54     public abstract void update(NodeId nodeId, 
55                                 PolicyInfo policyInfo,
56                                 Dirty dirty) throws Exception;
57 }