blob: 550685ad91e8798d1d6da8e8e27131feb22695c4 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska83e090e2014-10-22 14:25:35 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * 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 Vachuska83e090e2014-10-22 14:25:35 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * 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 Vachuska83e090e2014-10-22 14:25:35 -070015 */
tom8bb16062014-09-12 14:47:46 -070016package org.onlab.onos.net.flow;
17
18import org.onlab.onos.event.AbstractEvent;
19
20/**
21 * Describes flow rule event.
22 */
23public 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 */
alshabib219ebaa2014-09-22 15:41:24 -070037 RULE_REMOVED,
38
39 /**
40 * Signifies that a rule has been updated.
41 */
Yuta HIGUCHIf3d51bd2014-10-21 01:05:33 -070042 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,
tom8bb16062014-09-12 14:47:46 -070054 }
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}