blob: fc4bc5b0064c37daded258357e9f0b8d738abef2 [file] [log] [blame]
Jian Li47e7af72021-03-05 01:32:04 +09001/*
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 */
16package org.onosproject.kubevirtnetworking.api;
17
18import java.util.Set;
19
20/**
21 * Representation of security group.
22 */
23public interface KubevirtSecurityGroup {
24
25 /**
26 * Returns the security group identifier.
27 *
28 * @return security group identifier
29 */
30 String id();
31
32 /**
33 * Returns the security group name.
34 *
35 * @return security group name
36 */
37 String name();
38
39 /**
40 * Returns the description.
41 *
42 * @return description
43 */
44 String description();
45
46 /**
47 * Returns rules associated with this security group.
48 *
49 * @return security group rules
50 */
51 Set<KubevirtSecurityGroupRule> rules();
52
53 /**
54 * Returns new kubevirt security group instance with given rules.
55 *
56 * @param updatedRules set of updated security group rules
57 * @return updated kubevirt security group
58 */
59 KubevirtSecurityGroup updateRules(Set<KubevirtSecurityGroupRule> updatedRules);
60
61 /**
62 * A default builder interface.
63 */
64 interface Builder {
65 /**
66 * Builds an immutable security group instance.
67 *
68 * @return kubevirt security group
69 */
70 KubevirtSecurityGroup build();
71
72 /**
73 * Returns kubevirt security group builder with supplied identifier.
74 *
75 * @param id security group identifier
76 * @return security group builder
77 */
78 Builder id(String id);
79
80 /**
81 * Returns kubevirt security group builder with supplied name.
82 *
83 * @param name security group name
84 * @return security group builder
85 */
86 Builder name(String name);
87
88 /**
89 * Returns kubevirt security group builder with supplied description.
90 *
91 * @param description security group description
92 * @return security group builder
93 */
94 Builder description(String description);
95
96 /**
97 * Returns kubevirt security group builder with supplied security group rules.
98 *
99 * @param rules security group rules
100 * @return security group builder
101 */
102 Builder rules(Set<KubevirtSecurityGroupRule> rules);
103 }
104}