sangho | 6a9ff0d | 2017-03-27 11:23:37 +0900 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2017-present 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.openstacknetworking.api; |
| 18 | |
| 19 | import org.onosproject.store.Store; |
| 20 | import org.openstack4j.model.network.SecurityGroup; |
| 21 | import org.openstack4j.model.network.SecurityGroupRule; |
| 22 | |
| 23 | /** |
| 24 | * Manages inventory of OpenStack security group states; not intended for direct use. |
| 25 | */ |
| 26 | public interface OpenstackSecurityGroupStore |
| 27 | extends Store<OpenstackSecurityGroupEvent, OpenstackSecurityGroupStoreDelegate> { |
| 28 | |
| 29 | /** |
| 30 | * Creates a security group. |
| 31 | * |
| 32 | * @param sg security group |
| 33 | */ |
| 34 | void createSecurityGroup(SecurityGroup sg); |
| 35 | |
| 36 | /** |
| 37 | * Updates the security group with the security group ID with the security group object. |
| 38 | * |
| 39 | * @param sgId security group ID |
| 40 | * @param sg new SecurityGroup object |
| 41 | * @return old SecurityGroup object |
| 42 | */ |
| 43 | SecurityGroup updateSecurityGroup(String sgId, SecurityGroup sg); |
| 44 | |
| 45 | /** |
| 46 | * Removes the security group with the security group ID. |
| 47 | * |
| 48 | * @param sgId security group Id |
| 49 | * @return SecurityGroup object removed |
| 50 | */ |
| 51 | SecurityGroup removeSecurityGroup(String sgId); |
| 52 | |
| 53 | /** |
| 54 | * Creates a security group rule. |
| 55 | * |
| 56 | * @param sgRule security group rule |
| 57 | */ |
| 58 | void createSecurityGroupRule(SecurityGroupRule sgRule); |
| 59 | |
| 60 | /** |
| 61 | * Removes the security group rule with the security group rule ID. |
| 62 | * |
| 63 | * @param sgRuleId security group rule ID to remove |
| 64 | * @return SecurityGroupRule object removed |
| 65 | */ |
| 66 | SecurityGroupRule removeSecurityGroupRule(String sgRuleId); |
| 67 | |
| 68 | /** |
| 69 | * Returns the security group with the security group ID. |
| 70 | * |
| 71 | * @param sgId security group ID |
| 72 | * @return Security Group |
| 73 | */ |
| 74 | SecurityGroup securityGroup(String sgId); |
| 75 | |
| 76 | /** |
| 77 | * Returns the security group rule with the security group ID. |
| 78 | * |
| 79 | * @param sgRuleId security group rule ID |
| 80 | * @return Security Group Rule |
| 81 | */ |
| 82 | SecurityGroupRule securityGroupRule(String sgRuleId); |
| 83 | |
| 84 | } |