blob: 48788ef161876884adcbbea3e556d921316d3ffd [file] [log] [blame]
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +09001/*
Brian O'Connor80dff972017-08-03 22:46:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon2c3f0ee2017-04-06 16:47:21 +09003 *
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.opencord.cordvtn.api.node;
17
18import org.onosproject.store.Store;
19
20import java.util.Set;
21
22/**
23 * Manages the inventory of cordvtn nodes; not intended for direct use.
24 */
25public interface CordVtnNodeStore extends Store<CordVtnNodeEvent, CordVtnNodeStoreDelegate> {
26
27 /**
28 * Returns all nodes.
29 *
30 * @return set of nodes; empty set if no node presents
31 */
32 Set<CordVtnNode> nodes();
33
34 /**
35 * Returns the node with the given hostname.
36 *
37 * @param hostname hostname of the node
38 * @return cordvtn node; null if no node present with the hostname
39 */
40 CordVtnNode node(String hostname);
41
42 /**
43 * Creates a new node.
44 *
45 * @param node cordvtn node
46 */
47 void createNode(CordVtnNode node);
48
49 /**
50 * Updates the node.
51 *
52 * @param node cordvtn node
53 */
54 void updateNode(CordVtnNode node);
55
56 /**
57 * Removes the node with the supplied hostname.
58 *
59 * @param hostname hostname of the node
60 * @return removed node; null if it failed
61 */
62 CordVtnNode removeNode(String hostname);
63}