Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
Thomas Vachuska | 83e090e | 2014-10-22 14:25:35 -0700 | [diff] [blame] | 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.flow; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.event.AbstractEvent; |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 19 | |
| 20 | /** |
| 21 | * Describes flow rule event. |
| 22 | */ |
| 23 | public class FlowRuleEvent extends AbstractEvent<FlowRuleEvent.Type, FlowRule> { |
| 24 | |
| 25 | /** |
| 26 | * Type of flow rule events. |
| 27 | */ |
| 28 | public enum Type { |
| 29 | /** |
| 30 | * Signifies that a new flow rule has been detected. |
| 31 | */ |
| 32 | RULE_ADDED, |
| 33 | |
| 34 | /** |
| 35 | * Signifies that a flow rule has been removed. |
| 36 | */ |
alshabib | 219ebaa | 2014-09-22 15:41:24 -0700 | [diff] [blame] | 37 | RULE_REMOVED, |
| 38 | |
| 39 | /** |
| 40 | * Signifies that a rule has been updated. |
| 41 | */ |
Yuta HIGUCHI | f3d51bd | 2014-10-21 01:05:33 -0700 | [diff] [blame] | 42 | RULE_UPDATED, |
| 43 | |
| 44 | // internal event between Manager <-> Store |
| 45 | |
| 46 | /* |
| 47 | * Signifies that a request to add flow rule has been added to the store. |
| 48 | */ |
| 49 | RULE_ADD_REQUESTED, |
| 50 | /* |
| 51 | * Signifies that a request to remove flow rule has been added to the store. |
| 52 | */ |
| 53 | RULE_REMOVE_REQUESTED, |
tom | 8bb1606 | 2014-09-12 14:47:46 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Creates an event of a given type and for the specified flow rule and the |
| 58 | * current time. |
| 59 | * |
| 60 | * @param type flow rule event type |
| 61 | * @param flowRule event flow rule subject |
| 62 | */ |
| 63 | public FlowRuleEvent(Type type, FlowRule flowRule) { |
| 64 | super(type, flowRule); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Creates an event of a given type and for the specified flow rule and time. |
| 69 | * |
| 70 | * @param type flow rule event type |
| 71 | * @param flowRule event flow rule subject |
| 72 | * @param time occurrence time |
| 73 | */ |
| 74 | public FlowRuleEvent(Type type, FlowRule flowRule, long time) { |
| 75 | super(type, flowRule, time); |
| 76 | } |
| 77 | |
| 78 | } |