blob: 9c4643ab4c3251f6ff333a22639bcabfdbbcb28b [file] [log] [blame]
Yi Tseng890dc3f2018-11-01 13:23:11 -07001/*
2 * Copyright 2018-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 */
Carmelo Cascone3370c962019-02-07 18:24:19 -080016
17package org.onosproject.gnmi.ctl;
Yi Tseng890dc3f2018-11-01 13:23:11 -070018
19import io.grpc.ManagedChannel;
Yi Tseng890dc3f2018-11-01 13:23:11 -070020import org.onosproject.gnmi.api.GnmiClient;
21import org.onosproject.gnmi.api.GnmiClientKey;
22import org.onosproject.gnmi.api.GnmiController;
Ray Milkey5739b2c2018-11-06 14:04:51 -080023import org.onosproject.gnmi.api.GnmiEvent;
24import org.onosproject.gnmi.api.GnmiEventListener;
25import org.onosproject.grpc.ctl.AbstractGrpcClientController;
Ray Milkey5739b2c2018-11-06 14:04:51 -080026import org.osgi.service.component.annotations.Component;
Yi Tseng890dc3f2018-11-01 13:23:11 -070027
28/**
29 * Implementation of gNMI controller.
30 */
Ray Milkey5739b2c2018-11-06 14:04:51 -080031@Component(immediate = true, service = GnmiController.class)
Yi Tseng890dc3f2018-11-01 13:23:11 -070032public class GnmiControllerImpl
Carmelo Cascone3977ea42019-02-28 13:43:42 -080033 extends AbstractGrpcClientController
34 <GnmiClientKey, GnmiClient, GnmiEvent, GnmiEventListener>
Yi Tseng890dc3f2018-11-01 13:23:11 -070035 implements GnmiController {
Carmelo Casconea46f5542018-12-12 23:41:01 -080036
Carmelo Cascone3977ea42019-02-28 13:43:42 -080037 public GnmiControllerImpl() {
38 super(GnmiEvent.class);
Yi Tseng890dc3f2018-11-01 13:23:11 -070039 }
40
41 @Override
Carmelo Cascone3977ea42019-02-28 13:43:42 -080042 protected GnmiClient createClientInstance(
43 GnmiClientKey clientKey, ManagedChannel channel) {
Yi Tsenge616d752018-11-27 10:53:27 -080044 return new GnmiClientImpl(clientKey, channel, this);
45 }
Yi Tseng890dc3f2018-11-01 13:23:11 -070046}