blob: 1487b8e9396c6e8fb19ff0362eff093847ac5d9b [file] [log] [blame]
Thomas Vachuska02aeb032015-01-06 22:36:30 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Thomas Vachuska02aeb032015-01-06 22:36:30 -08003 *
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.app;
17
18import org.onosproject.core.Application;
19import org.onosproject.event.AbstractEvent;
20
21/**
22 * Describes application lifecycle event.
23 */
24public class ApplicationEvent extends AbstractEvent<ApplicationEvent.Type, Application> {
25
26 public enum Type {
27 /**
28 * Signifies that an application has been installed.
29 */
30 APP_INSTALLED,
31
32 /**
33 * Signifies that an application has been activated.
34 */
35 APP_ACTIVATED,
36
37 /**
38 * Signifies that an application has been deactivated.
39 */
40 APP_DEACTIVATED,
41
42 /**
43 * Signifies that an application has been uninstalled.
44 */
45 APP_UNINSTALLED,
46
47 /**
48 * Signifies that application granted permissions have changed.
49 */
50 APP_PERMISSIONS_CHANGED
51 }
52
53 /**
54 * Creates an event of a given type and for the specified app and the
55 * current time.
56 *
57 * @param type app event type
58 * @param app event app subject
59 */
60 public ApplicationEvent(Type type, Application app) {
61 super(type, app);
62 }
63
64 /**
65 * Creates an event of a given type and for the specified app and time.
66 *
67 * @param type app event type
68 * @param app event app subject
69 * @param time occurrence time
70 */
71 public ApplicationEvent(Type type, Application app, long time) {
72 super(type, app, time);
73 }
74
75}