Jian Li | 1c10cf2 | 2021-03-05 01:32:04 +0900 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2021-present Open Networking Foundation |
| 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.kubevirtnetworking.api; |
| 17 | |
| 18 | import org.onosproject.event.ListenerService; |
| 19 | |
| 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
| 23 | * Service for interfacing kubevirt SecurityGroup events and SecurityGroup store. |
| 24 | */ |
| 25 | public interface KubevirtSecurityGroupService |
| 26 | extends ListenerService<KubevirtSecurityGroupEvent, KubevirtSecurityGroupListener> { |
| 27 | |
| 28 | /** |
| 29 | * Returns all security groups. |
| 30 | * |
| 31 | * @return set of security group |
| 32 | */ |
| 33 | Set<KubevirtSecurityGroup> securityGroups(); |
| 34 | |
| 35 | /** |
| 36 | * Returns the security group for the sgId. |
| 37 | * |
| 38 | * @param sgId security group Id |
| 39 | * @return security group |
| 40 | */ |
| 41 | KubevirtSecurityGroup securityGroup(String sgId); |
| 42 | |
| 43 | /** |
| 44 | * Returns the security group rule for the sgId. |
| 45 | * |
| 46 | * @param sgrId security group rule Id |
| 47 | * @return security group rule |
| 48 | */ |
| 49 | KubevirtSecurityGroupRule securityGroupRule(String sgrId); |
| 50 | |
| 51 | /** |
| 52 | * Returns whether security group is enabled or not. |
| 53 | * |
| 54 | * @return true security group is enabled, false otherwise |
| 55 | */ |
| 56 | boolean isSecurityGroupEnabled(); |
| 57 | |
| 58 | /** |
| 59 | * Sets security group enable option. |
| 60 | * |
| 61 | * @param option security group enable option |
| 62 | */ |
| 63 | void setSecurityGroupEnabled(boolean option); |
| 64 | } |