blob: 63e7cafbf4b2fa5189f4857099ae17fc178665cb [file] [log] [blame]
Jian Lif2483072020-12-25 02:24:16 +09001/*
2 * Copyright 2020-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.kubevirtnode.api;
17
18import org.onosproject.store.Store;
19
20import java.util.Set;
21
22/**
23 * Manages inventory of KubeVirt API config; not intended for direct use.
24 */
25public interface KubevirtApiConfigStore
26 extends Store<KubevirtApiConfigEvent, KubevirtApiConfigStoreDelegate> {
27
28 /**
29 * Creates a API config.
30 *
31 * @param config KubeVirt API server config
32 */
33 void createApiConfig(KubevirtApiConfig config);
34
35 /**
36 * Updates the API config.
37 *
38 * @param config KubeVirt API server config
39 */
40 void updateApiConfig(KubevirtApiConfig config);
41
42 /**
43 * Removes the KubeVirt API config with the given endpoint.
44 * Endpoint comprises of scheme (HTTP), IP address and port
45 *
46 * @param endpoint KubeVirt API endpoint
47 * @return removed KubeVirt API server config; null if no config
48 * associated with the endpoint
49 */
50 KubevirtApiConfig removeApiConfig(String endpoint);
51
52 /**
53 * Returns all registered KubeVirt API configs.
54 *
55 * @return set of KubeVirt API configs
56 */
57 Set<KubevirtApiConfig> apiConfigs();
58
59 /**
60 * Returns the API config.
61 *
62 * @param endpoint endpoint
63 * @return KubeVirt API config
64 */
65 KubevirtApiConfig apiConfig(String endpoint);
66}