Hyunsun Moon | 0d45736 | 2017-06-27 17:19:41 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Laboratory |
| 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 | */ |
| 16 | package org.onosproject.openstacknode.api; |
| 17 | |
| 18 | import org.onosproject.store.Store; |
| 19 | |
| 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
| 23 | * Manages inventory of OpenstackNode; not intended for direct use. |
| 24 | */ |
| 25 | public interface OpenstackNodeStore extends Store<OpenstackNodeEvent, OpenstackNodeStoreDelegate> { |
| 26 | |
| 27 | /** |
| 28 | * Creates a new node. |
| 29 | * |
| 30 | * @param osNode openstack node |
| 31 | */ |
| 32 | void createNode(OpenstackNode osNode); |
| 33 | |
| 34 | /** |
| 35 | * Updates the node. |
| 36 | * |
| 37 | * @param osNode openstack node |
| 38 | */ |
| 39 | void updateNode(OpenstackNode osNode); |
| 40 | |
| 41 | /** |
| 42 | * Removes the node. |
| 43 | * |
| 44 | * @param hostname openstack node hostname |
| 45 | * @return removed openstack node; null if no node mapped for the hostname |
| 46 | */ |
| 47 | OpenstackNode removeNode(String hostname); |
| 48 | |
| 49 | /** |
| 50 | * Returns all registered nodes. |
| 51 | * |
| 52 | * @return set of openstack nodes |
| 53 | */ |
| 54 | Set<OpenstackNode> nodes(); |
| 55 | |
| 56 | /** |
| 57 | * Returns the node with the specified hostname. |
| 58 | * |
| 59 | * @param hostname hostname |
| 60 | * @return openstack node |
| 61 | */ |
| 62 | OpenstackNode node(String hostname); |
| 63 | } |