blob: 4f590793f7f6c00c2aa5d203dd39bbd793cfd8fa [file] [log] [blame]
Carmelo Cascone1a7e4f92017-11-20 23:04:02 -08001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
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 */
16
17package org.onosproject.net.pi.service;
18
19import com.google.common.annotations.Beta;
20import org.onosproject.event.AbstractEvent;
21
22/**
23 * Signals an event related to the translation of a protocol-dependent (PD)
24 * entity to a protocol-independent (PI) one.
25 */
26@Beta
27public final class PiTranslationEvent
28 extends AbstractEvent<PiTranslationEvent.Type, PiTranslatedEntity> {
29
30 /**
31 * Type of event.
32 */
33 public enum Type {
34 /**
35 * Signals that A PD entity has been translated to a PI one, and the
36 * mapping between the two entities has been learned by the system.
37 */
38 LEARNED,
39
40 /**
41 * Signals that a previously learned mapping between a PD entity and its
42 * PI counterpart has been removed.
43 */
44 FORGOT,
45 }
46
47 /**
48 * Creates a new translation event.
49 *
50 * @param type type of event
51 * @param subject subject of event
52 */
53 public PiTranslationEvent(Type type, PiTranslatedEntity subject) {
54 super(type, subject);
55 }
56}