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; |
Changhoon Yoon | b856b81 | 2015-08-10 03:47:19 +0900 | [diff] [blame] | 20 | import org.onosproject.security.Permission; |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 21 | |
| 22 | import java.io.InputStream; |
| 23 | import java.util.Set; |
| 24 | |
| 25 | /** |
| 26 | * Service for managing network control applications. |
| 27 | */ |
| 28 | public interface ApplicationAdminService extends ApplicationService { |
| 29 | |
| 30 | /** |
| 31 | * Installs the application contained in the specified application archive |
Thomas Vachuska | 62ad95f | 2015-02-18 12:11:36 -0800 | [diff] [blame] | 32 | * input stream. This can be either a ZIP stream containing a compressed |
| 33 | * application archive or a plain XML stream containing just the |
| 34 | * {@code app.xml} application descriptor file. |
Thomas Vachuska | 02aeb03 | 2015-01-06 22:36:30 -0800 | [diff] [blame] | 35 | * |
| 36 | * @param appDescStream application descriptor input stream |
| 37 | * @return installed application descriptor |
| 38 | * @throws org.onosproject.app.ApplicationException if unable to read the app archive stream |
| 39 | */ |
| 40 | Application install(InputStream appDescStream); |
| 41 | |
| 42 | /** |
| 43 | * Uninstalls the specified application. |
| 44 | * |
| 45 | * @param appId application identifier |
| 46 | */ |
| 47 | void uninstall(ApplicationId appId); |
| 48 | |
| 49 | /** |
| 50 | * Activates the specified application. |
| 51 | * |
| 52 | * @param appId application identifier |
| 53 | */ |
| 54 | void activate(ApplicationId appId); |
| 55 | |
| 56 | /** |
| 57 | * Deactivates the specified application. |
| 58 | * |
| 59 | * @param appId application identifier |
| 60 | */ |
| 61 | void deactivate(ApplicationId appId); |
| 62 | |
| 63 | /** |
| 64 | * Updates the permissions granted to the applications. |
| 65 | * |
| 66 | * @param appId application identifier |
| 67 | * @param permissions set of granted permissions |
| 68 | */ |
| 69 | void setPermissions(ApplicationId appId, Set<Permission> permissions); |
| 70 | } |