Daniel Park | a7d6e9f | 2016-01-18 17:54:14 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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; |
| 17 | |
| 18 | import java.util.List; |
| 19 | |
| 20 | /** |
| 21 | * Handles the bootstrap request for compute/gateway node. |
| 22 | */ |
| 23 | public interface OpenstackNodeService { |
| 24 | |
| 25 | public enum OpenstackNodeType { |
| 26 | /** |
| 27 | * Compute or Gateway Node. |
| 28 | */ |
| 29 | COMPUTENODE, |
| 30 | GATEWAYNODE |
| 31 | } |
| 32 | /** |
| 33 | * Adds a new node to the service. |
| 34 | * |
| 35 | * @param node openstack node |
| 36 | */ |
| 37 | void addNode(OpenstackNode node); |
| 38 | |
| 39 | /** |
| 40 | * Deletes a node from the service. |
| 41 | * |
| 42 | * @param node openstack node |
| 43 | */ |
| 44 | void deleteNode(OpenstackNode node); |
| 45 | |
| 46 | /** |
| 47 | * Returns nodes known to the service for designated openstacktype. |
| 48 | * |
| 49 | * @param openstackNodeType openstack node type |
| 50 | * @return list of nodes |
| 51 | */ |
| 52 | List<OpenstackNode> getNodes(OpenstackNodeType openstackNodeType); |
| 53 | |
| 54 | /** |
| 55 | * Returns the NodeState for a given node. |
| 56 | * |
| 57 | * @param node openstack node |
| 58 | * @return true if the NodeState for a given node is COMPLETE, false otherwise |
| 59 | */ |
| 60 | boolean isComplete(OpenstackNode node); |
| 61 | } |