blob: e511be69de2dca8f82e991d9a07186c7ebe47910 [file] [log] [blame]
Thomas Vachuska83e090e2014-10-22 14:25:35 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
tom8bb16062014-09-12 14:47:46 -070019package org.onlab.onos.net.flow;
20
21import org.onlab.onos.event.AbstractEvent;
22
23/**
24 * Describes flow rule event.
25 */
26public class FlowRuleEvent extends AbstractEvent<FlowRuleEvent.Type, FlowRule> {
27
28 /**
29 * Type of flow rule events.
30 */
31 public enum Type {
32 /**
33 * Signifies that a new flow rule has been detected.
34 */
35 RULE_ADDED,
36
37 /**
38 * Signifies that a flow rule has been removed.
39 */
alshabib219ebaa2014-09-22 15:41:24 -070040 RULE_REMOVED,
41
42 /**
43 * Signifies that a rule has been updated.
44 */
Yuta HIGUCHIf3d51bd2014-10-21 01:05:33 -070045 RULE_UPDATED,
46
47 // internal event between Manager <-> Store
48
49 /*
50 * Signifies that a request to add flow rule has been added to the store.
51 */
52 RULE_ADD_REQUESTED,
53 /*
54 * Signifies that a request to remove flow rule has been added to the store.
55 */
56 RULE_REMOVE_REQUESTED,
tom8bb16062014-09-12 14:47:46 -070057 }
58
59 /**
60 * Creates an event of a given type and for the specified flow rule and the
61 * current time.
62 *
63 * @param type flow rule event type
64 * @param flowRule event flow rule subject
65 */
66 public FlowRuleEvent(Type type, FlowRule flowRule) {
67 super(type, flowRule);
68 }
69
70 /**
71 * Creates an event of a given type and for the specified flow rule and time.
72 *
73 * @param type flow rule event type
74 * @param flowRule event flow rule subject
75 * @param time occurrence time
76 */
77 public FlowRuleEvent(Type type, FlowRule flowRule, long time) {
78 super(type, flowRule, time);
79 }
80
81}