sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 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.openstacknetworking.api; |
| 18 | |
| 19 | import org.onosproject.store.Store; |
| 20 | import org.openstack4j.model.network.SecurityGroup; |
Hyunsun Moon | ae51e73 | 2017-04-25 17:46:21 +0900 | [diff] [blame] | 21 | |
| 22 | import java.util.Set; |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Manages inventory of OpenStack security group states; not intended for direct use. |
| 26 | */ |
| 27 | public interface OpenstackSecurityGroupStore |
| 28 | extends Store<OpenstackSecurityGroupEvent, OpenstackSecurityGroupStoreDelegate> { |
| 29 | |
| 30 | /** |
| 31 | * Creates a security group. |
| 32 | * |
| 33 | * @param sg security group |
| 34 | */ |
| 35 | void createSecurityGroup(SecurityGroup sg); |
| 36 | |
| 37 | /** |
| 38 | * Updates the security group with the security group ID with the security group object. |
| 39 | * |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 40 | * @param sg new SecurityGroup object |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 41 | */ |
Hyunsun Moon | ae51e73 | 2017-04-25 17:46:21 +0900 | [diff] [blame] | 42 | void updateSecurityGroup(SecurityGroup sg); |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Removes the security group with the security group ID. |
| 46 | * |
| 47 | * @param sgId security group Id |
| 48 | * @return SecurityGroup object removed |
| 49 | */ |
| 50 | SecurityGroup removeSecurityGroup(String sgId); |
| 51 | |
| 52 | /** |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 53 | * Returns the security group with the security group ID. |
| 54 | * |
| 55 | * @param sgId security group ID |
| 56 | * @return Security Group |
| 57 | */ |
| 58 | SecurityGroup securityGroup(String sgId); |
| 59 | |
| 60 | /** |
Hyunsun Moon | ae51e73 | 2017-04-25 17:46:21 +0900 | [diff] [blame] | 61 | * Returns all security groups. |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 62 | * |
Hyunsun Moon | ae51e73 | 2017-04-25 17:46:21 +0900 | [diff] [blame] | 63 | * @return set of security groups |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 64 | */ |
Hyunsun Moon | ae51e73 | 2017-04-25 17:46:21 +0900 | [diff] [blame] | 65 | Set<SecurityGroup> securityGroups(); |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 66 | |
Hyunsun Moon | ae51e73 | 2017-04-25 17:46:21 +0900 | [diff] [blame] | 67 | /** |
| 68 | * Clears the security group store. |
| 69 | */ |
| 70 | void clear(); |
sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame] | 71 | } |