blob: b6a9f03c51a6a69c90efdeb2c0fcbaa30d6b3bee [file] [log] [blame]
Jian Lib230e07c2020-12-21 11:25:12 +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 KubevirtNode; not intended for direct use.
24 */
25public interface KubevirtNodeStore extends Store<KubevirtNodeEvent, KubevirtNodeStoreDelegate> {
26
27 /**
28 * Creates a new node.
29 *
30 * @param node kubevirt node
31 */
32 void createNode(KubevirtNode node);
33
34 /**
35 * Updates the node.
36 *
37 * @param node kubevirt node
38 */
39 void updateNode(KubevirtNode node);
40
41 /**
42 * Removes the node.
43 *
44 * @param hostname kubevirt node hostname
45 * @return removed kubevirt node; null if no node mapped for the hostname
46 */
47 KubevirtNode removeNode(String hostname);
48
49 /**
50 * Returns all registered nodes.
51 *
52 * @return set of kubevirt nodes
53 */
54 Set<KubevirtNode> nodes();
55
56 /**
57 * Returns the node with the specified hostname.
58 *
59 * @param hostname hostname
60 * @return kubevirt node
61 */
62 KubevirtNode node(String hostname);
63}