blob: 7313aa97810fd9a0b9d36e02e1aa4fc20a7e3ffe [file] [log] [blame]
Jian Licaa03922021-02-26 18:15:20 +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 org.onosproject.store.Store;
19
20import java.util.Set;
21
22/**
23 * Manages inventory of kubevirt router states; not intended for direct use.
24 */
25public interface KubevirtRouterStore
26 extends Store<KubevirtRouterEvent, KubevirtRouterStoreDelegate> {
27
28 /**
29 * Creates a new kubevirt router.
30 *
31 * @param router kubevirt router
32 */
33 void createRouter(KubevirtRouter router);
34
35 /**
36 * Updates the kubevirt router.
37 *
38 * @param router kubevirt router
39 */
40 void updateRouter(KubevirtRouter router);
41
42 /**
43 * Removes the kubevirt router with the given router identifier.
44 *
45 * @param name router name
46 * @return remove kubevirt router; null if failed
47 */
48 KubevirtRouter removeRouter(String name);
49
50 /**
51 * Returns the kubevirt router with the given router name.
52 *
53 * @param name router name
54 * @return removed kubevirt router; null if failed
55 */
56 KubevirtRouter router(String name);
57
58 /**
59 * Returns all kubevirt routes.
60 *
61 * @return set of kubevirt routers
62 */
63 Set<KubevirtRouter> routers();
64
65 /**
Jian Li073f1ba2021-02-28 03:50:15 +090066 * Creates a new kubevirt floating IP.
67 *
68 * @param floatingIp kubevirt floating IP
69 */
70 void createFloatingIp(KubevirtFloatingIp floatingIp);
71
72 /**
73 * Updates the kubevirt floating IP.
74 *
75 * @param floatingIp kubevirt floating IP
76 */
77 void updateFloatingIp(KubevirtFloatingIp floatingIp);
78
79 /**
80 * Removes the kubevirt floating IP with the given identifier.
81 *
82 * @param id floating IP identifier
83 * @return removed kubevirt floating IP; null if failed
84 */
85 KubevirtFloatingIp removeFloatingIp(String id);
86
87 /**
88 * Returns the kubevirt floating IP with the given identifier.
89 *
90 * @param id floating IP identifier
91 * @return kubevirt floating IP; null if not found
92 */
93 KubevirtFloatingIp floatingIp(String id);
94
95 /**
96 * Returns all kubevirt floating IPs.
97 *
98 * @return set of kubevirt floating IPs
99 */
100 Set<KubevirtFloatingIp> floatingIps();
101
102 /**
103 * Removes all kubevirt routers and floating IPs.
Jian Licaa03922021-02-26 18:15:20 +0900104 */
105 void clear();
106}