blob: 35449566612d7098454ba40ccd9dcc1e87a9e330 [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 -080021import org.onosproject.store.Store;
22
23import java.io.InputStream;
24import java.util.Set;
25
26/**
27 * Service for managing network control applications.
28 */
29public interface ApplicationStore extends Store<ApplicationEvent, ApplicationStoreDelegate> {
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 * Returns the current application state.
56 *
57 * @param appId application identifier
58 * @return application state
59 */
60 ApplicationState getState(ApplicationId appId);
61
62 /**
63 * Creates the application from the specified application descriptor
64 * input stream.
65 *
66 * @param appDescStream application archive input stream
67 * @return application descriptor
68 */
69 Application create(InputStream appDescStream);
70
71 /**
72 * Removes the specified application.
73 *
74 * @param appId application identifier
75 */
76 void remove(ApplicationId appId);
77
78 /**
Thomas Vachuska761f0042015-11-11 19:10:17 -080079 * Mark the application as active.
Thomas Vachuska02aeb032015-01-06 22:36:30 -080080 *
81 * @param appId application identifier
82 */
83 void activate(ApplicationId appId);
84
85 /**
86 * Mark the application as deactivated.
87 *
88 * @param appId application identifier
89 */
90 void deactivate(ApplicationId appId);
91
92 /**
93 * Returns the permissions granted to the applications.
94 *
95 * @param appId application identifier
96 * @return set of granted permissions
97 */
98 Set<Permission> getPermissions(ApplicationId appId);
99
100 /**
101 * Updates the permissions granted to the applications.
102 *
103 * @param appId application identifier
104 * @param permissions set of granted permissions
105 */
106 void setPermissions(ApplicationId appId, Set<Permission> permissions);
107
108}