Jonghwan Hyun | 13a430d | 2018-07-22 17:02:51 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015-present Open Networking Foundation |
| 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.inbandtelemetry.app; |
| 17 | |
| 18 | import org.apache.felix.scr.annotations.Activate; |
| 19 | import org.apache.felix.scr.annotations.Deactivate; |
| 20 | import org.apache.felix.scr.annotations.Reference; |
| 21 | import org.apache.felix.scr.annotations.Component; |
| 22 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 23 | import org.onosproject.core.CoreService; |
| 24 | import org.onosproject.inbandtelemetry.api.IntService; |
| 25 | import org.onosproject.net.host.HostService; |
| 26 | import org.slf4j.Logger; |
| 27 | import org.slf4j.LoggerFactory; |
| 28 | |
| 29 | @Component(immediate = true) |
| 30 | public class IntControl { |
| 31 | private final Logger log = LoggerFactory.getLogger(getClass()); |
| 32 | // private ApplicationId appId; |
| 33 | // private static final int collectorPort = 1234; |
| 34 | // private static final IpAddress collectorIp = IpAddress.valueOf("10.0.0.3"); |
| 35 | |
| 36 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 37 | protected CoreService coreService; |
| 38 | |
| 39 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 40 | protected IntService intService; |
| 41 | |
| 42 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 43 | protected HostService hostService; |
| 44 | |
| 45 | @Activate |
| 46 | protected void activate() { |
| 47 | coreService.registerApplication("org.onosproject.inbandtelemetry.app"); |
| 48 | log.info("Started"); |
| 49 | } |
| 50 | |
| 51 | @Deactivate |
| 52 | protected void deactivate() { |
| 53 | log.info("Stopped"); |
| 54 | } |
| 55 | } |