blob: 294972a9e119f4f5844d561966fe7e6598b6502a [file] [log] [blame]
Thomas Vachuska02aeb032015-01-06 22:36:30 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
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.core.ApplicationId;
Changhoon Yoonb856b812015-08-10 03:47:19 +090020import org.onosproject.security.Permission;
Thomas Vachuska02aeb032015-01-06 22:36:30 -080021
22import java.io.InputStream;
23import java.util.Set;
24
25/**
26 * Service for managing network control applications.
27 */
28public interface ApplicationAdminService extends ApplicationService {
29
30 /**
31 * Installs the application contained in the specified application archive
Thomas Vachuska62ad95f2015-02-18 12:11:36 -080032 * 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 Vachuska02aeb032015-01-06 22:36:30 -080035 *
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}