blob: b683375b8a6f16d16459b74f4bf4659e24fe27ca [file] [log] [blame]
Jian Li95edb592017-01-29 08:42:07 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Jian Li95edb592017-01-29 08:42:07 +09003 *
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
7 *
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.
15 */
16package org.onosproject.mapping;
17
18import org.onosproject.event.AbstractEvent;
19
20/**
21 * Describes mapping event.
22 */
23public class MappingEvent extends AbstractEvent<MappingEvent.Type, Mapping> {
24
Jian Li98763102017-02-19 23:48:46 +090025 /**
26 * Type of mapping events.
27 */
Jian Li95edb592017-01-29 08:42:07 +090028 public enum Type {
29
30 /**
31 * Signifies that a new mapping has been detected.
32 */
33 MAPPING_ADDED,
34
35 /**
36 * Signifies that a new mapping has been removed.
37 */
38 MAPPING_REMOVED,
39
40 /**
41 * Signifies that a mapping has been updated.
42 */
43 MAPPING_UPDATED,
44
45 // internal event between Manager <-> Store
46
47 /**
48 * Signifies that a request to add mapping has been added to the store.
49 */
50 MAPPING_ADD_REQUESTED,
51
52 /**
53 * Signifies that a request to update mapping has been added to the store.
54 */
55 MAPPING_UPDATE_REQUESTED,
56
57 /**
58 * Signifies that a request to remove flow rule has been added to the store.
59 */
Jian Li98763102017-02-19 23:48:46 +090060 MAPPING_REMOVE_REQUESTED
Jian Li95edb592017-01-29 08:42:07 +090061 }
62
Jian Li98763102017-02-19 23:48:46 +090063 /**
64 * Creates an event of a given type and for the specified mapping and the
65 * current time.
66 *
67 * @param type mapping event type
68 * @param mapping event mapping subject
69 */
Jian Li95edb592017-01-29 08:42:07 +090070 public MappingEvent(Type type, Mapping mapping) {
71 super(type, mapping);
72 }
Jian Li98763102017-02-19 23:48:46 +090073
74 /**
75 * Creates an event of a given type and for the specified mapping and time.
76 *
77 * @param type mapping event type
78 * @param mapping event mapping subject
79 * @param time occurrence time
80 */
81 public MappingEvent(Type type, Mapping mapping, long time) {
82 super(type, mapping, time);
83 }
Jian Li95edb592017-01-29 08:42:07 +090084}