blob: 30d143c0ca0a2784ffd7bcc1740a7ccda99cc69c [file] [log] [blame]
Changhoon Yoonb856b812015-08-10 03:47:19 +09001/*
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
17package org.onosproject.security;
18
Thomas Vachuska4c571ae2015-09-10 16:31:59 -070019import com.google.common.annotations.Beta;
Changhoon Yoonb856b812015-08-10 03:47:19 +090020import org.onosproject.core.ApplicationId;
21
22import java.security.Permission;
23import java.util.List;
24import java.util.Map;
25
26/**
27 * Security-Mode ONOS service.
28 */
Thomas Vachuska4c571ae2015-09-10 16:31:59 -070029@Beta
Changhoon Yoonb856b812015-08-10 03:47:19 +090030public interface SecurityAdminService {
31
32 /**
33 * Returns true if security policy has been enforced to specified application.
34 * @param appId application identifier
35 * @return true if secured.
36 */
37 boolean isSecured(ApplicationId appId);
38
39 /**
40 * Changes SecurityModeState of specified application to REVIEWED.
41 * @param appId application identifier
42 */
43 void review(ApplicationId appId);
44
45 /**
46 * Accepts and enforces security policy to specified application.
47 * @param appId application identifier
48 */
49 void acceptPolicy(ApplicationId appId);
50
51 /**
52 * Register application to SM-ONOS subsystem.
53 * @param appId application identifier
54 */
55 void register(ApplicationId appId);
56
57 /**
58 * Returns sorted developer specified permission Map.
59 * @param appId application identifier
60 * @return Map of list of permissions sorted by permission type
61 */
62 Map<Integer, List<Permission>> getPrintableSpecifiedPermissions(ApplicationId appId);
63
64 /**
65 * Returns sorted granted permission Map.
66 * @param appId application identifier
67 * @return Map of list of permissions sorted by permission type
68 */
69 Map<Integer, List<Permission>> getPrintableGrantedPermissions(ApplicationId appId);
70
71 /**
72 * Returns sorted requested permission Map.
73 * @param appId application identifier
74 * @return Map of list of permissions sorted by permission type
75 */
76 Map<Integer, List<Permission>> getPrintableRequestedPermissions(ApplicationId appId);
77
78
79}