blob: ef11466c610978aa2472d7216eec721224613bb0 [file] [log] [blame]
Jian Li0967cd72015-11-25 17:38:48 -08001/*
Jian Lic132c112016-01-28 20:27:34 -08002 * Copyright 2016 Open Networking Laboratory
Jian Li0967cd72015-11-25 17:38:48 -08003 *
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 */
Jian Li6b86a762016-01-29 09:30:40 -080016package org.onosproject.cpman.impl;
Jian Li0967cd72015-11-25 17:38:48 -080017
Jian Li0967cd72015-11-25 17:38:48 -080018import org.apache.felix.scr.annotations.Activate;
Jian Lic132c112016-01-28 20:27:34 -080019import org.apache.felix.scr.annotations.Component;
Jian Li0967cd72015-11-25 17:38:48 -080020import org.apache.felix.scr.annotations.Deactivate;
Jian Li60804322015-12-02 14:46:31 -080021import org.apache.felix.scr.annotations.Reference;
22import org.apache.felix.scr.annotations.ReferenceCardinality;
Jian Li60804322015-12-02 14:46:31 -080023import org.onosproject.core.ApplicationId;
24import org.onosproject.core.CoreService;
25import org.onosproject.net.device.DeviceService;
Jian Li0967cd72015-11-25 17:38:48 -080026import org.slf4j.Logger;
Jian Lic132c112016-01-28 20:27:34 -080027import org.slf4j.LoggerFactory;
Jian Li0967cd72015-11-25 17:38:48 -080028
29/**
Jian Li6b86a762016-01-29 09:30:40 -080030 * Skeletal control plane management component.
Jian Li0967cd72015-11-25 17:38:48 -080031 */
Jian Li60804322015-12-02 14:46:31 -080032@Component(immediate = true)
Jian Li0967cd72015-11-25 17:38:48 -080033public class ControlPlaneManager {
34
Jian Lic132c112016-01-28 20:27:34 -080035 private final Logger log = LoggerFactory.getLogger(getClass());
Jian Li60804322015-12-02 14:46:31 -080036
37 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
38 protected CoreService coreService;
39
40 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
Jian Lic132c112016-01-28 20:27:34 -080041 protected DeviceService deviceService;
42
43 private ApplicationId appId;
Jian Li0967cd72015-11-25 17:38:48 -080044
45 @Activate
Jian Lic132c112016-01-28 20:27:34 -080046 protected void activate() {
Jian Li60804322015-12-02 14:46:31 -080047 appId = coreService.registerApplication("org.onosproject.cpman");
Jian Lic132c112016-01-28 20:27:34 -080048 deviceService.getAvailableDevices();
Jian Li60804322015-12-02 14:46:31 -080049 log.info("Started");
Jian Li0967cd72015-11-25 17:38:48 -080050 }
51
52 @Deactivate
Jian Lic132c112016-01-28 20:27:34 -080053 protected void deactivate() {
Jian Li60804322015-12-02 14:46:31 -080054 log.info("Stopped");
Jian Li0967cd72015-11-25 17:38:48 -080055 }
56
Jian Li6b86a762016-01-29 09:30:40 -080057}