blob: 5bd654800abb7ef536a232d8c873b0157cc9ed7b [file] [log] [blame]
Jian Li9e43ec12019-01-21 23:04:23 +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.k8snode.api;
17
18import org.onosproject.store.Store;
19
20import java.util.Set;
21
22/**
23 * Manages inventory of Kubernetes Node; not intended for direct use.
24 */
25public interface K8sNodeStore extends Store<K8sNodeEvent, K8sNodeStoreDelegate> {
26
27 /**
28 * Creates a new node.
29 *
30 * @param node kubernetes node
31 */
32 void createNode(K8sNode node);
33
34 /**
35 * Updates the node.
36 *
37 * @param node kubernetes node
38 */
39 void updateNode(K8sNode node);
40
41 /**
42 * Removes the node with the given hostname.
43 *
44 * @param hostname kubernetes node hostname
45 * @return removed kubernetes node; null if no node is associated with the hostname
46 */
47 K8sNode removeNode(String hostname);
48
49 /**
50 * Returns all registered nodes.
51 *
52 * @return set of kubernetes nodes
53 */
54 Set<K8sNode> nodes();
55
56 /**
57 * Returns the node with the specified hostname.
58 *
59 * @param hostname hostname
60 * @return kubernetes node
61 */
62 K8sNode node(String hostname);
63}