blob: a5255ff0a18978d3c8d318688443ad8d4bd8e412 [file] [log] [blame]
Jian Lifc55e422019-01-21 14:39:34 +09001/*
2 * Copyright 2019-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.k8snetworking.api;
17
18import org.onosproject.store.Store;
19
20import java.util.Set;
21
22/**
23 * Manages inventory of kubernetes network states; not intended for direct use.
24 */
25public interface K8sNetworkStore extends Store<K8sNetworkEvent, K8sNetworkStoreDelegate> {
26
27 /**
28 * Creates the new kubernetes network.
29 *
30 * @param network kubernetes network
31 */
32 void createNetwork(K8sNetwork network);
33
34 /**
35 * Update the kubernetes network.
36 *
37 * @param network kubernetes network
38 */
39 void updateNetwork(K8sNetwork network);
40
41 /**
42 * Removes the kubernetes network with the given network identifier.
43 *
44 * @param networkId network identifier
45 * @return removed kubernetes network; null if failed
46 */
47 K8sNetwork removeNetwork(String networkId);
48
49 /**
50 * Returns the kubernetes network with the given network identifier.
51 *
52 * @param networkId network identifier
53 * @return network; null if not found
54 */
55 K8sNetwork network(String networkId);
56
57 /**
58 * Returns all kubernetes networks.
59 *
60 * @return set of kubernetes networks
61 */
62 Set<K8sNetwork> networks();
63
64 /**
65 * Removes all kubernetes networks.
66 */
67 void clear();
68}