oleksandr.yashchuk@plvision.eu | 3dbcaaf | 2019-03-13 14:44:46 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-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.gnoi.ctl; |
| 17 | |
| 18 | import io.grpc.ManagedChannel; |
| 19 | import org.onosproject.event.AbstractEvent; |
| 20 | import org.onosproject.event.EventListener; |
| 21 | import org.onosproject.gnoi.api.GnoiClient; |
oleksandr.yashchuk@plvision.eu | 3dbcaaf | 2019-03-13 14:44:46 +0200 | [diff] [blame] | 22 | import org.onosproject.gnoi.api.GnoiController; |
| 23 | import org.onosproject.grpc.ctl.AbstractGrpcClientController; |
Carmelo Cascone | c2be50a | 2019-04-10 00:15:39 -0700 | [diff] [blame] | 24 | import org.onosproject.net.DeviceId; |
oleksandr.yashchuk@plvision.eu | 3dbcaaf | 2019-03-13 14:44:46 +0200 | [diff] [blame] | 25 | import org.osgi.service.component.annotations.Component; |
| 26 | |
| 27 | /** |
| 28 | * Implementation of gNOI controller. |
| 29 | */ |
| 30 | @Component(immediate = true, service = GnoiController.class) |
| 31 | public class GnoiControllerImpl |
Carmelo Cascone | c2be50a | 2019-04-10 00:15:39 -0700 | [diff] [blame] | 32 | extends AbstractGrpcClientController<GnoiClient, AbstractEvent, EventListener<AbstractEvent>> |
oleksandr.yashchuk@plvision.eu | 3dbcaaf | 2019-03-13 14:44:46 +0200 | [diff] [blame] | 33 | implements GnoiController { |
| 34 | |
| 35 | public GnoiControllerImpl() { |
Carmelo Cascone | c2be50a | 2019-04-10 00:15:39 -0700 | [diff] [blame] | 36 | super(AbstractEvent.class, "gNOI"); |
oleksandr.yashchuk@plvision.eu | 3dbcaaf | 2019-03-13 14:44:46 +0200 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | @Override |
Carmelo Cascone | c2be50a | 2019-04-10 00:15:39 -0700 | [diff] [blame] | 40 | protected GnoiClient createClientInstance(DeviceId deviceId, ManagedChannel channel) { |
| 41 | return new GnoiClientImpl(deviceId, channel, this); |
oleksandr.yashchuk@plvision.eu | 3dbcaaf | 2019-03-13 14:44:46 +0200 | [diff] [blame] | 42 | } |
Carmelo Cascone | c2be50a | 2019-04-10 00:15:39 -0700 | [diff] [blame] | 43 | } |