tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.flow.impl; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 2 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 3 | import static com.google.common.base.Preconditions.checkNotNull; |
| 4 | import static org.slf4j.LoggerFactory.getLogger; |
| 5 | |
| 6 | import java.util.Iterator; |
| 7 | import java.util.List; |
| 8 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 9 | import org.apache.felix.scr.annotations.Activate; |
| 10 | import org.apache.felix.scr.annotations.Component; |
| 11 | import org.apache.felix.scr.annotations.Deactivate; |
| 12 | import org.apache.felix.scr.annotations.Reference; |
| 13 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 14 | import org.apache.felix.scr.annotations.Service; |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 15 | import org.onlab.onos.ApplicationId; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 16 | import org.onlab.onos.event.AbstractListenerRegistry; |
| 17 | import org.onlab.onos.event.EventDeliveryService; |
| 18 | import org.onlab.onos.net.Device; |
| 19 | import org.onlab.onos.net.DeviceId; |
| 20 | import org.onlab.onos.net.device.DeviceService; |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 21 | import org.onlab.onos.net.flow.FlowEntry; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 22 | import org.onlab.onos.net.flow.FlowRule; |
| 23 | import org.onlab.onos.net.flow.FlowRuleEvent; |
| 24 | import org.onlab.onos.net.flow.FlowRuleListener; |
| 25 | import org.onlab.onos.net.flow.FlowRuleProvider; |
| 26 | import org.onlab.onos.net.flow.FlowRuleProviderRegistry; |
| 27 | import org.onlab.onos.net.flow.FlowRuleProviderService; |
| 28 | import org.onlab.onos.net.flow.FlowRuleService; |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 29 | import org.onlab.onos.net.flow.FlowRuleStore; |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 30 | import org.onlab.onos.net.flow.FlowRuleStoreDelegate; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 31 | import org.onlab.onos.net.provider.AbstractProviderRegistry; |
| 32 | import org.onlab.onos.net.provider.AbstractProviderService; |
| 33 | import org.slf4j.Logger; |
| 34 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 35 | import com.google.common.collect.Lists; |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 36 | |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame] | 37 | /** |
| 38 | * Provides implementation of the flow NB & SB APIs. |
| 39 | */ |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 40 | @Component(immediate = true) |
| 41 | @Service |
tom | 202175a | 2014-09-19 19:00:11 -0700 | [diff] [blame] | 42 | public class FlowRuleManager |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 43 | extends AbstractProviderRegistry<FlowRuleProvider, FlowRuleProviderService> |
| 44 | implements FlowRuleService, FlowRuleProviderRegistry { |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 45 | |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 46 | public static final String FLOW_RULE_NULL = "FlowRule cannot be null"; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 47 | private final Logger log = getLogger(getClass()); |
| 48 | |
| 49 | private final AbstractListenerRegistry<FlowRuleEvent, FlowRuleListener> |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 50 | listenerRegistry = new AbstractListenerRegistry<>(); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 51 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 52 | private final FlowRuleStoreDelegate delegate = new InternalStoreDelegate(); |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 53 | |
tom | be98831 | 2014-09-19 18:38:47 -0700 | [diff] [blame] | 54 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 55 | protected FlowRuleStore store; |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 56 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 57 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 58 | protected EventDeliveryService eventDispatcher; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 59 | |
| 60 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
Ayaka Koshibe | b55524f | 2014-09-18 09:59:24 -0700 | [diff] [blame] | 61 | protected DeviceService deviceService; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 62 | |
| 63 | @Activate |
| 64 | public void activate() { |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 65 | store.setDelegate(delegate); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 66 | eventDispatcher.addSink(FlowRuleEvent.class, listenerRegistry); |
| 67 | log.info("Started"); |
| 68 | } |
| 69 | |
| 70 | @Deactivate |
| 71 | public void deactivate() { |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 72 | store.unsetDelegate(delegate); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 73 | eventDispatcher.removeSink(FlowRuleEvent.class); |
| 74 | log.info("Stopped"); |
| 75 | } |
| 76 | |
| 77 | @Override |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 78 | public Iterable<FlowEntry> getFlowEntries(DeviceId deviceId) { |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 79 | return store.getFlowEntries(deviceId); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | @Override |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 83 | public void applyFlowRules(FlowRule... flowRules) { |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 84 | for (int i = 0; i < flowRules.length; i++) { |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 85 | FlowRule f = flowRules[i]; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 86 | final Device device = deviceService.getDevice(f.deviceId()); |
| 87 | final FlowRuleProvider frp = getProvider(device.providerId()); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 88 | store.storeFlowRule(f); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 89 | frp.applyFlowRule(f); |
| 90 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | @Override |
| 94 | public void removeFlowRules(FlowRule... flowRules) { |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 95 | FlowRule f; |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 96 | FlowRuleProvider frp; |
| 97 | Device device; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 98 | for (int i = 0; i < flowRules.length; i++) { |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 99 | f = flowRules[i]; |
| 100 | device = deviceService.getDevice(f.deviceId()); |
| 101 | frp = getProvider(device.providerId()); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 102 | store.deleteFlowRule(f); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 103 | frp.removeFlowRule(f); |
| 104 | } |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 105 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 106 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 107 | @Override |
| 108 | public void removeFlowRulesById(ApplicationId id) { |
| 109 | Iterable<FlowRule> rules = getFlowRulesById(id); |
| 110 | FlowRuleProvider frp; |
| 111 | Device device; |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 112 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 113 | for (FlowRule f : rules) { |
| 114 | store.deleteFlowRule(f); |
| 115 | device = deviceService.getDevice(f.deviceId()); |
| 116 | frp = getProvider(device.providerId()); |
| 117 | frp.removeRulesById(id, f); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | @Override |
| 122 | public Iterable<FlowRule> getFlowRulesById(ApplicationId id) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 123 | return store.getFlowRulesByAppId(id); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | @Override |
| 127 | public void addListener(FlowRuleListener listener) { |
| 128 | listenerRegistry.addListener(listener); |
| 129 | } |
| 130 | |
| 131 | @Override |
| 132 | public void removeListener(FlowRuleListener listener) { |
| 133 | listenerRegistry.removeListener(listener); |
| 134 | } |
| 135 | |
| 136 | @Override |
| 137 | protected FlowRuleProviderService createProviderService( |
| 138 | FlowRuleProvider provider) { |
| 139 | return new InternalFlowRuleProviderService(provider); |
| 140 | } |
| 141 | |
| 142 | private class InternalFlowRuleProviderService |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 143 | extends AbstractProviderService<FlowRuleProvider> |
| 144 | implements FlowRuleProviderService { |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 145 | |
| 146 | protected InternalFlowRuleProviderService(FlowRuleProvider provider) { |
| 147 | super(provider); |
| 148 | } |
| 149 | |
| 150 | @Override |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 151 | public void flowRemoved(FlowEntry flowEntry) { |
| 152 | checkNotNull(flowEntry, FLOW_RULE_NULL); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 153 | checkValidity(); |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 154 | FlowEntry stored = store.getFlowEntry(flowEntry); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 155 | if (stored == null) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 156 | log.info("Rule already evicted from store: {}", flowEntry); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 157 | return; |
| 158 | } |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 159 | Device device = deviceService.getDevice(flowEntry.deviceId()); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 160 | FlowRuleProvider frp = getProvider(device.providerId()); |
| 161 | FlowRuleEvent event = null; |
| 162 | switch (stored.state()) { |
| 163 | case ADDED: |
| 164 | case PENDING_ADD: |
alshabib | 6eb438a | 2014-10-01 16:39:37 -0700 | [diff] [blame] | 165 | frp.applyFlowRule(stored); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 166 | break; |
| 167 | case PENDING_REMOVE: |
| 168 | case REMOVED: |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 169 | event = store.removeFlowRule(stored); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 170 | break; |
| 171 | default: |
| 172 | break; |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 173 | |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 174 | } |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 175 | if (event != null) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 176 | log.debug("Flow {} removed", flowEntry); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 177 | post(event); |
| 178 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 179 | } |
| 180 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 181 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 182 | private void flowMissing(FlowEntry flowRule) { |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 183 | checkNotNull(flowRule, FLOW_RULE_NULL); |
| 184 | checkValidity(); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 185 | Device device = deviceService.getDevice(flowRule.deviceId()); |
| 186 | FlowRuleProvider frp = getProvider(device.providerId()); |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 187 | FlowRuleEvent event = null; |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 188 | switch (flowRule.state()) { |
| 189 | case PENDING_REMOVE: |
| 190 | case REMOVED: |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 191 | event = store.removeFlowRule(flowRule); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 192 | frp.removeFlowRule(flowRule); |
| 193 | break; |
| 194 | case ADDED: |
| 195 | case PENDING_ADD: |
| 196 | frp.applyFlowRule(flowRule); |
| 197 | break; |
| 198 | default: |
| 199 | log.debug("Flow {} has not been installed.", flowRule); |
| 200 | } |
| 201 | |
alshabib | bb42cad | 2014-09-25 11:43:05 -0700 | [diff] [blame] | 202 | if (event != null) { |
| 203 | log.debug("Flow {} removed", flowRule); |
| 204 | post(event); |
| 205 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 206 | |
| 207 | } |
| 208 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 209 | |
| 210 | private void extraneousFlow(FlowRule flowRule) { |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 211 | checkNotNull(flowRule, FLOW_RULE_NULL); |
| 212 | checkValidity(); |
alshabib | a68eb96 | 2014-09-24 20:34:13 -0700 | [diff] [blame] | 213 | removeFlowRules(flowRule); |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 214 | log.debug("Flow {} is on switch but not in store.", flowRule); |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 215 | } |
| 216 | |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 217 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 218 | private void flowAdded(FlowEntry flowEntry) { |
| 219 | checkNotNull(flowEntry, FLOW_RULE_NULL); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 220 | checkValidity(); |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 221 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 222 | if (checkRuleLiveness(flowEntry, store.getFlowEntry(flowEntry))) { |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 223 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 224 | FlowRuleEvent event = store.addOrUpdateFlowRule(flowEntry); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 225 | if (event == null) { |
| 226 | log.debug("No flow store event generated."); |
| 227 | } else { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 228 | log.debug("Flow {} {}", flowEntry, event.type()); |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 229 | post(event); |
| 230 | } |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 231 | } else { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 232 | removeFlowRules(flowEntry); |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 233 | } |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 234 | |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 235 | } |
| 236 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 237 | private boolean checkRuleLiveness(FlowEntry swRule, FlowEntry storedRule) { |
| 238 | if (storedRule == null) { |
| 239 | return false; |
| 240 | } |
alshabib | 85c4197 | 2014-10-03 13:48:39 -0700 | [diff] [blame] | 241 | long timeout = storedRule.timeout() * 1000; |
| 242 | Long currentTime = System.currentTimeMillis(); |
| 243 | if (storedRule.packets() != swRule.packets()) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 244 | storedRule.setLastSeen(); |
alshabib | 85c4197 | 2014-10-03 13:48:39 -0700 | [diff] [blame] | 245 | return true; |
| 246 | } |
alshabib | 85c4197 | 2014-10-03 13:48:39 -0700 | [diff] [blame] | 247 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 248 | if ((currentTime - storedRule.lastSeen()) <= timeout) { |
alshabib | c274c90 | 2014-10-03 14:58:27 -0700 | [diff] [blame] | 249 | return true; |
| 250 | } |
| 251 | return false; |
alshabib | ba5ac48 | 2014-10-02 17:15:20 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Ayaka Koshibe | 08eabaa | 2014-09-17 14:59:25 -0700 | [diff] [blame] | 254 | // Posts the specified event to the local event dispatcher. |
| 255 | private void post(FlowRuleEvent event) { |
| 256 | if (event != null) { |
| 257 | eventDispatcher.post(event); |
| 258 | } |
| 259 | } |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 260 | |
| 261 | @Override |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 262 | public void pushFlowMetrics(DeviceId deviceId, Iterable<FlowEntry> flowEntries) { |
| 263 | List<FlowEntry> storedRules = Lists.newLinkedList(store.getFlowEntries(deviceId)); |
alshabib | bb8b128 | 2014-09-22 17:00:18 -0700 | [diff] [blame] | 264 | |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 265 | Iterator<FlowEntry> switchRulesIterator = flowEntries.iterator(); |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 266 | |
| 267 | while (switchRulesIterator.hasNext()) { |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 268 | FlowEntry rule = switchRulesIterator.next(); |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 269 | if (storedRules.remove(rule)) { |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 270 | // we both have the rule, let's update some info then. |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 271 | flowAdded(rule); |
| 272 | } else { |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 273 | // the device has a rule the store does not have |
| 274 | extraneousFlow(rule); |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 275 | } |
| 276 | } |
alshabib | 1c319ff | 2014-10-04 20:29:09 -0700 | [diff] [blame] | 277 | for (FlowEntry rule : storedRules) { |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 278 | // there are rules in the store that aren't on the switch |
| 279 | flowMissing(rule); |
alshabib | 54ce589 | 2014-09-23 17:50:51 -0700 | [diff] [blame] | 280 | |
alshabib | a7f7ca8 | 2014-09-22 11:41:23 -0700 | [diff] [blame] | 281 | } |
alshabib | 5c370ff | 2014-09-18 10:12:14 -0700 | [diff] [blame] | 282 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 283 | } |
| 284 | |
tom | c78acee | 2014-09-24 15:16:55 -0700 | [diff] [blame] | 285 | // Store delegate to re-post events emitted from the store. |
| 286 | private class InternalStoreDelegate implements FlowRuleStoreDelegate { |
| 287 | @Override |
| 288 | public void notify(FlowRuleEvent event) { |
| 289 | eventDispatcher.post(event); |
| 290 | } |
| 291 | } |
alshabib | 57044ba | 2014-09-16 15:58:01 -0700 | [diff] [blame] | 292 | } |