Changhoon Yoon | b856b81 | 2015-08-10 03:47:19 +0900 | [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 | |
| 17 | package org.onosproject.security; |
| 18 | |
Thomas Vachuska | 4c571ae | 2015-09-10 16:31:59 -0700 | [diff] [blame] | 19 | import com.google.common.annotations.Beta; |
Changhoon Yoon | b856b81 | 2015-08-10 03:47:19 +0900 | [diff] [blame] | 20 | import org.onosproject.core.ApplicationId; |
| 21 | |
| 22 | import java.security.Permission; |
| 23 | import java.util.List; |
| 24 | import java.util.Map; |
| 25 | |
| 26 | /** |
| 27 | * Security-Mode ONOS service. |
| 28 | */ |
Thomas Vachuska | 4c571ae | 2015-09-10 16:31:59 -0700 | [diff] [blame] | 29 | @Beta |
Changhoon Yoon | b856b81 | 2015-08-10 03:47:19 +0900 | [diff] [blame] | 30 | public 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); |
Changhoon Yoon | b856b81 | 2015-08-10 03:47:19 +0900 | [diff] [blame] | 77 | } |