blob: 941cc0f6b60d4eaede50aa4e6b66def866d9dcef [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 */
16package org.onosproject.cpman;
17
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;
21import org.apache.felix.scr.annotations.Modified;
Jian Li60804322015-12-02 14:46:31 -080022import org.apache.felix.scr.annotations.Reference;
23import org.apache.felix.scr.annotations.ReferenceCardinality;
Jian Li60804322015-12-02 14:46:31 -080024import org.onosproject.core.ApplicationId;
25import org.onosproject.core.CoreService;
26import org.onosproject.net.device.DeviceService;
Jian Li0967cd72015-11-25 17:38:48 -080027import org.slf4j.Logger;
Jian Lic132c112016-01-28 20:27:34 -080028import org.slf4j.LoggerFactory;
Jian Li0967cd72015-11-25 17:38:48 -080029
30/**
Jian Lic132c112016-01-28 20:27:34 -080031 * Skeletal ONOS application component.
Jian Li0967cd72015-11-25 17:38:48 -080032 */
Jian Li60804322015-12-02 14:46:31 -080033@Component(immediate = true)
Jian Li0967cd72015-11-25 17:38:48 -080034public class ControlPlaneManager {
35
Jian Lic132c112016-01-28 20:27:34 -080036 private final Logger log = LoggerFactory.getLogger(getClass());
Jian Li60804322015-12-02 14:46:31 -080037
38 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
39 protected CoreService coreService;
40
41 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
Jian Lic132c112016-01-28 20:27:34 -080042 protected DeviceService deviceService;
43
44 private ApplicationId appId;
Jian Li0967cd72015-11-25 17:38:48 -080045
46 @Activate
Jian Lic132c112016-01-28 20:27:34 -080047 protected void activate() {
Jian Li60804322015-12-02 14:46:31 -080048 appId = coreService.registerApplication("org.onosproject.cpman");
Jian Lic132c112016-01-28 20:27:34 -080049 deviceService.getAvailableDevices();
Jian Li60804322015-12-02 14:46:31 -080050 log.info("Started");
Jian Li0967cd72015-11-25 17:38:48 -080051 }
52
53 @Deactivate
Jian Lic132c112016-01-28 20:27:34 -080054 protected void deactivate() {
Jian Li60804322015-12-02 14:46:31 -080055 log.info("Stopped");
Jian Li0967cd72015-11-25 17:38:48 -080056 }
57
58 @Modified
Jian Lic132c112016-01-28 20:27:34 -080059 protected void modified() {
Jian Li0967cd72015-11-25 17:38:48 -080060 }
Jian Li60804322015-12-02 14:46:31 -080061
Jian Li60804322015-12-02 14:46:31 -080062}