Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.app; |
| 17 | |
| 18 | import org.onosproject.core.Application; |
| 19 | import org.onosproject.core.ApplicationId; |
Thomas Vachuska | 42e8cce | 2015-07-29 19:25:18 -0700 | [diff] [blame] | 20 | import org.onosproject.event.ListenerService; |
Changhoon Yoon | b856b81 | 2015-08-10 03:47:19 +0900 | [diff] [blame] | 21 | import org.onosproject.security.Permission; |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 22 | |
| 23 | import java.util.Set; |
| 24 | |
| 25 | /** |
| 26 | * Service for inspecting inventory of network control applications. |
| 27 | */ |
Thomas Vachuska | 42e8cce | 2015-07-29 19:25:18 -0700 | [diff] [blame] | 28 | public interface ApplicationService |
| 29 | extends ListenerService<ApplicationEvent, ApplicationListener> { |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Returns the set of all installed applications. |
| 33 | * |
| 34 | * @return set of installed apps |
| 35 | */ |
| 36 | Set<Application> getApplications(); |
| 37 | |
| 38 | /** |
| 39 | * Returns the registered id of the application with the given name. |
| 40 | * |
| 41 | * @param name application name |
| 42 | * @return registered application id |
| 43 | */ |
| 44 | ApplicationId getId(String name); |
| 45 | |
| 46 | /** |
| 47 | * Returns the application with the supplied application identifier. |
| 48 | * |
| 49 | * @param appId application identifier |
| 50 | * @return application descriptor |
| 51 | */ |
| 52 | Application getApplication(ApplicationId appId); |
| 53 | |
| 54 | /** |
| 55 | * Return the application state. |
| 56 | * |
| 57 | * @param appId application identifier |
| 58 | * @return application state |
| 59 | */ |
| 60 | ApplicationState getState(ApplicationId appId); |
| 61 | |
| 62 | /** |
| 63 | * Returns the permissions currently granted to the applications. |
| 64 | * |
| 65 | * @param appId application identifier |
| 66 | * @return set of granted permissions |
| 67 | */ |
| 68 | Set<Permission> getPermissions(ApplicationId appId); |
| 69 | |
Thomas Vachuska | c65dd71 | 2015-11-04 17:19:10 -0800 | [diff] [blame] | 70 | /** |
| 71 | * Registers application pre-deactivation processing hook. |
| 72 | * |
| 73 | * @param appId application identifier |
| 74 | * @param hook pre-deactivation hook |
| 75 | */ |
| 76 | void registerDeactivateHook(ApplicationId appId, Runnable hook); |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 77 | } |