blob: 7bbc1e353c0c8c430dbdab11b86859369d86ca58 [file] [log] [blame]
Hyunsun Moon950f6392015-09-10 17:54:10 -07001/*
2 * Copyright 2014-2015 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 */
16package org.onosproject.cordvtn;
17
18import java.util.List;
19
20/**
21 * Service for provisioning overlay virtual networks on compute nodes.
22 */
23public interface CordVtnService {
Hyunsun Moon9661d642015-09-23 13:24:35 -070024
25 String CORDVTN_APP_ID = "org.onosproject.cordvtn";
Hyunsun Moon950f6392015-09-10 17:54:10 -070026 /**
Hyunsun Moone9d75992015-09-15 22:39:16 -070027 * Adds a new node to the service.
Hyunsun Moon950f6392015-09-10 17:54:10 -070028 *
Hyunsun Moon4edb0172015-11-07 22:08:43 -080029 * @param node cordvtn node
Hyunsun Moon950f6392015-09-10 17:54:10 -070030 */
Hyunsun Moon4edb0172015-11-07 22:08:43 -080031 void addNode(CordVtnNode node);
Hyunsun Moon950f6392015-09-10 17:54:10 -070032
33 /**
Hyunsun Moon9661d642015-09-23 13:24:35 -070034 * Deletes a node from the service.
Hyunsun Moon950f6392015-09-10 17:54:10 -070035 *
Hyunsun Moon4edb0172015-11-07 22:08:43 -080036 * @param node cordvtn node
Hyunsun Moon950f6392015-09-10 17:54:10 -070037 */
Hyunsun Moon4edb0172015-11-07 22:08:43 -080038 void deleteNode(CordVtnNode node);
Hyunsun Moon9661d642015-09-23 13:24:35 -070039
40 /**
Hyunsun Moon4edb0172015-11-07 22:08:43 -080041 * Initiates node to serve virtual tenant network.
Hyunsun Moon9661d642015-09-23 13:24:35 -070042 *
Hyunsun Moon4edb0172015-11-07 22:08:43 -080043 * @param node cordvtn node
Hyunsun Moon9661d642015-09-23 13:24:35 -070044 */
Hyunsun Moon4edb0172015-11-07 22:08:43 -080045 void initNode(CordVtnNode node);
Hyunsun Moon950f6392015-09-10 17:54:10 -070046
47 /**
48 * Returns the number of the nodes known to the service.
49 *
50 * @return number of nodes
51 */
52 int getNodeCount();
53
54 /**
Hyunsun Moon4edb0172015-11-07 22:08:43 -080055 * Returns node initialization state.
Hyunsun Moon9661d642015-09-23 13:24:35 -070056 *
Hyunsun Moon4edb0172015-11-07 22:08:43 -080057 * @param node cordvtn node
58 * @return true if initial node setup is completed, otherwise false
Hyunsun Moon9661d642015-09-23 13:24:35 -070059 */
Hyunsun Moon4edb0172015-11-07 22:08:43 -080060 boolean getNodeInitState(CordVtnNode node);
Hyunsun Moon7dca9b32015-10-08 22:25:30 -070061
62 /**
Hyunsun Moon950f6392015-09-10 17:54:10 -070063 * Returns all nodes known to the service.
64 *
65 * @return list of nodes
66 */
Hyunsun Moon4edb0172015-11-07 22:08:43 -080067 List<CordVtnNode> getNodes();
Hyunsun Moon9274aaf2015-12-04 11:35:25 -080068
69 /**
70 * Creates a dependency between two services.
71 *
72 * @param tenantServiceId id of the service which has a dependency
73 * @param providerServiceId id of the service which provides dependency
74 */
75 void createServiceDependency(ServiceId tenantServiceId, ServiceId providerServiceId);
76
77 /**
78 * Removes a dependency between two services.
79 *
80 * @param tenantServiceId id of the service which has a dependency
81 * @param providerServiceId id of the service which provides dependency
82 */
83 void removeServiceDependency(ServiceId tenantServiceId, ServiceId providerServiceId);
Hyunsun Moon950f6392015-09-10 17:54:10 -070084}