blob: fcac3eba590a8090621ecc83ddcb21d5f38ef41b [file] [log] [blame]
sangho6a9ff0d2017-03-27 11:23:37 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
sangho6a9ff0d2017-03-27 11:23:37 +09003 *
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.openstacknetworking.api;
18
19import org.onosproject.store.Store;
20import org.openstack4j.model.network.SecurityGroup;
Hyunsun Moonae51e732017-04-25 17:46:21 +090021
22import java.util.Set;
sangho6a9ff0d2017-03-27 11:23:37 +090023
24/**
25 * Manages inventory of OpenStack security group states; not intended for direct use.
26 */
27public 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 *
sangho6a9ff0d2017-03-27 11:23:37 +090040 * @param sg new SecurityGroup object
sangho6a9ff0d2017-03-27 11:23:37 +090041 */
Hyunsun Moonae51e732017-04-25 17:46:21 +090042 void updateSecurityGroup(SecurityGroup sg);
sangho6a9ff0d2017-03-27 11:23:37 +090043
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 /**
sangho6a9ff0d2017-03-27 11:23:37 +090053 * 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 Moonae51e732017-04-25 17:46:21 +090061 * Returns all security groups.
sangho6a9ff0d2017-03-27 11:23:37 +090062 *
Hyunsun Moonae51e732017-04-25 17:46:21 +090063 * @return set of security groups
sangho6a9ff0d2017-03-27 11:23:37 +090064 */
Hyunsun Moonae51e732017-04-25 17:46:21 +090065 Set<SecurityGroup> securityGroups();
sangho6a9ff0d2017-03-27 11:23:37 +090066
Hyunsun Moonae51e732017-04-25 17:46:21 +090067 /**
68 * Clears the security group store.
69 */
70 void clear();
sangho6a9ff0d2017-03-27 11:23:37 +090071}