blob: 1aaf0922218e725bf0aac0020456172afb25f851 [file] [log] [blame]
Thomas Vachuska02aeb032015-01-06 22:36:30 -08001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.app;
17
18import org.onosproject.core.Application;
19import org.onosproject.core.ApplicationId;
20import org.onosproject.core.Permission;
21
22import java.util.Set;
23
24/**
25 * Service for inspecting inventory of network control applications.
26 */
27public interface ApplicationService {
28
29 /**
30 * Returns the set of all installed applications.
31 *
32 * @return set of installed apps
33 */
34 Set<Application> getApplications();
35
36 /**
37 * Returns the registered id of the application with the given name.
38 *
39 * @param name application name
40 * @return registered application id
41 */
42 ApplicationId getId(String name);
43
44 /**
45 * Returns the application with the supplied application identifier.
46 *
47 * @param appId application identifier
48 * @return application descriptor
49 */
50 Application getApplication(ApplicationId appId);
51
52 /**
53 * Return the application state.
54 *
55 * @param appId application identifier
56 * @return application state
57 */
58 ApplicationState getState(ApplicationId appId);
59
60 /**
61 * Returns the permissions currently granted to the applications.
62 *
63 * @param appId application identifier
64 * @return set of granted permissions
65 */
66 Set<Permission> getPermissions(ApplicationId appId);
67
68 /**
69 * Adds the given listener for application lifecycle events.
70 *
71 * @param listener listener to be added
72 */
73 void addListener(ApplicationListener listener);
74
75 /**
76 * Removes the specified listener for application lifecycle events.
77 *
78 * @param listener listener to be removed
79 */
80 void removeListener(ApplicationListener listener);
81
82}