Yuta HIGUCHI
Committed by Gerrit Code Review

Update ProtoBuf 3 & gRPC

- Protocol Buffers: 3.0.0
- gRPC: 1.0.0-pre2

Change-Id: Ic80d3f660d4a0aa37a99d4e6d4dc45e0b70b073b
Showing 19 changed files with 67 additions and 64 deletions
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
36 <dependency> 36 <dependency>
37 <groupId>com.google.protobuf</groupId> 37 <groupId>com.google.protobuf</groupId>
38 <artifactId>protobuf-java</artifactId> 38 <artifactId>protobuf-java</artifactId>
39 - <version>3.0.0-beta-2</version> 39 + <version>3.0.0</version>
40 </dependency> 40 </dependency>
41 41
42 <dependency> 42 <dependency>
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
16 16
17 package org.onosproject.kafkaintegration.api; 17 package org.onosproject.kafkaintegration.api;
18 18
19 -import com.google.protobuf.GeneratedMessage; 19 +import com.google.protobuf.GeneratedMessageV3;
20 +
20 import org.onosproject.kafkaintegration.api.dto.OnosEvent.Type; 21 import org.onosproject.kafkaintegration.api.dto.OnosEvent.Type;
21 22
22 /** 23 /**
...@@ -30,5 +31,6 @@ public interface KafkaPublisherService { ...@@ -30,5 +31,6 @@ public interface KafkaPublisherService {
30 * @param eventType the ONOS eventtype 31 * @param eventType the ONOS eventtype
31 * @param message generated Protocol buffer message from ONOS event data 32 * @param message generated Protocol buffer message from ONOS event data
32 */ 33 */
33 - void publish(Type eventType, GeneratedMessage message); 34 + // FIXME reconsider message type, something similar to "OnosEvent"?
35 + void publish(Type eventType, GeneratedMessageV3 message);
34 } 36 }
......
...@@ -16,13 +16,14 @@ package org.onosproject.kafkaintegration.api.dto; ...@@ -16,13 +16,14 @@ package org.onosproject.kafkaintegration.api.dto;
16 16
17 import org.onosproject.event.AbstractEvent; 17 import org.onosproject.event.AbstractEvent;
18 18
19 -import com.google.protobuf.GeneratedMessage; 19 +import com.google.protobuf.GeneratedMessageV3;
20 20
21 /** 21 /**
22 * Represents the converted Onos Event data into protobuf format. 22 * Represents the converted Onos Event data into protobuf format.
23 * 23 *
24 */ 24 */
25 -public class OnosEvent extends AbstractEvent<OnosEvent.Type, GeneratedMessage> { 25 +// FIXME lack of abstraction in subject type is biting us
26 +public class OnosEvent extends AbstractEvent<OnosEvent.Type, GeneratedMessageV3> {
26 27
27 /** 28 /**
28 * Creates a new Onos Event. 29 * Creates a new Onos Event.
...@@ -30,7 +31,7 @@ public class OnosEvent extends AbstractEvent<OnosEvent.Type, GeneratedMessage> { ...@@ -30,7 +31,7 @@ public class OnosEvent extends AbstractEvent<OnosEvent.Type, GeneratedMessage> {
30 * @param type The Type of Onos Event 31 * @param type The Type of Onos Event
31 * @param subject Protobuf message corresponding to the Onos Event 32 * @param subject Protobuf message corresponding to the Onos Event
32 */ 33 */
33 - public OnosEvent(Type type, GeneratedMessage subject) { 34 + public OnosEvent(Type type, GeneratedMessageV3 subject) {
34 super(type, subject); 35 super(type, subject);
35 } 36 }
36 37
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
50 <dependency> 50 <dependency>
51 <groupId>org.osgi</groupId> 51 <groupId>org.osgi</groupId>
52 <artifactId>org.osgi.core</artifactId> 52 <artifactId>org.osgi.core</artifactId>
53 - <version>4.3.1</version>
54 </dependency> 53 </dependency>
55 54
56 <dependency> 55 <dependency>
...@@ -74,7 +73,7 @@ ...@@ -74,7 +73,7 @@
74 <dependency> 73 <dependency>
75 <groupId>com.google.protobuf</groupId> 74 <groupId>com.google.protobuf</groupId>
76 <artifactId>protobuf-java</artifactId> 75 <artifactId>protobuf-java</artifactId>
77 - <version>3.0.0-beta-2</version> 76 + <version>3.0.0</version>
78 </dependency> 77 </dependency>
79 <dependency> 78 <dependency>
80 <groupId>org.onosproject</groupId> 79 <groupId>org.onosproject</groupId>
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
14 */ 14 */
15 package org.onosproject.kafkaintegration.converter; 15 package org.onosproject.kafkaintegration.converter;
16 16
17 -import com.google.protobuf.GeneratedMessage; 17 +import com.google.protobuf.GeneratedMessageV3;
18 +
18 import org.onosproject.event.Event; 19 import org.onosproject.event.Event;
19 import org.onosproject.grpc.net.Device.DeviceCore; 20 import org.onosproject.grpc.net.Device.DeviceCore;
20 import org.onosproject.grpc.net.Device.DeviceType; 21 import org.onosproject.grpc.net.Device.DeviceType;
...@@ -34,7 +35,7 @@ public class DeviceEventConverter implements EventConverter { ...@@ -34,7 +35,7 @@ public class DeviceEventConverter implements EventConverter {
34 private final Logger log = LoggerFactory.getLogger(getClass()); 35 private final Logger log = LoggerFactory.getLogger(getClass());
35 36
36 @Override 37 @Override
37 - public GeneratedMessage convertToProtoMessage(Event<?, ?> event) { 38 + public GeneratedMessageV3 convertToProtoMessage(Event<?, ?> event) {
38 39
39 DeviceEvent deviceEvent = (DeviceEvent) event; 40 DeviceEvent deviceEvent = (DeviceEvent) event;
40 41
......
...@@ -16,7 +16,7 @@ package org.onosproject.kafkaintegration.converter; ...@@ -16,7 +16,7 @@ package org.onosproject.kafkaintegration.converter;
16 16
17 import org.onosproject.event.Event; 17 import org.onosproject.event.Event;
18 18
19 -import com.google.protobuf.GeneratedMessage; 19 +import com.google.protobuf.GeneratedMessageV3;
20 20
21 /** 21 /**
22 * 22 *
...@@ -32,5 +32,6 @@ public interface EventConverter { ...@@ -32,5 +32,6 @@ public interface EventConverter {
32 * @param event ONOS Event object 32 * @param event ONOS Event object
33 * @return converted data in protobuf format. 33 * @return converted data in protobuf format.
34 */ 34 */
35 - GeneratedMessage convertToProtoMessage(Event<?, ?> event); 35 + // FIXME reconsider return type, something similar to "OnosEvent"?
36 + GeneratedMessageV3 convertToProtoMessage(Event<?, ?> event);
36 } 37 }
......
...@@ -25,7 +25,7 @@ import org.onosproject.net.link.LinkEvent; ...@@ -25,7 +25,7 @@ import org.onosproject.net.link.LinkEvent;
25 import org.slf4j.Logger; 25 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 26 import org.slf4j.LoggerFactory;
27 27
28 -import com.google.protobuf.GeneratedMessage; 28 +import com.google.protobuf.GeneratedMessageV3;
29 29
30 /** 30 /**
31 * Converts for ONOS Link event message to protobuf format. 31 * Converts for ONOS Link event message to protobuf format.
...@@ -35,7 +35,7 @@ public class LinkEventConverter implements EventConverter { ...@@ -35,7 +35,7 @@ public class LinkEventConverter implements EventConverter {
35 private final Logger log = LoggerFactory.getLogger(getClass()); 35 private final Logger log = LoggerFactory.getLogger(getClass());
36 36
37 @Override 37 @Override
38 - public GeneratedMessage convertToProtoMessage(Event<?, ?> event) { 38 + public GeneratedMessageV3 convertToProtoMessage(Event<?, ?> event) {
39 39
40 LinkEvent linkEvent = (LinkEvent) event; 40 LinkEvent linkEvent = (LinkEvent) event;
41 41
......
...@@ -22,7 +22,7 @@ import org.onosproject.kafkaintegration.api.dto.OnosEvent.Type; ...@@ -22,7 +22,7 @@ import org.onosproject.kafkaintegration.api.dto.OnosEvent.Type;
22 import org.slf4j.Logger; 22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory; 23 import org.slf4j.LoggerFactory;
24 24
25 -import com.google.protobuf.GeneratedMessage; 25 +import com.google.protobuf.GeneratedMessageV3;
26 26
27 /** 27 /**
28 * Dispatch ONOS Events to all interested Listeners. 28 * Dispatch ONOS Events to all interested Listeners.
...@@ -53,7 +53,7 @@ public final class KafkaPublisherManager ...@@ -53,7 +53,7 @@ public final class KafkaPublisherManager
53 } 53 }
54 54
55 @Override 55 @Override
56 - public void publish(Type eventType, GeneratedMessage message) { 56 + public void publish(Type eventType, GeneratedMessageV3 message) {
57 log.debug("Dispatching ONOS Event {}", eventType); 57 log.debug("Dispatching ONOS Event {}", eventType);
58 post(new OnosEvent(eventType, message)); 58 post(new OnosEvent(eventType, message));
59 } 59 }
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
87 <dependency> 87 <dependency>
88 <groupId>com.google.protobuf</groupId> 88 <groupId>com.google.protobuf</groupId>
89 <artifactId>protobuf-java</artifactId> 89 <artifactId>protobuf-java</artifactId>
90 - <version>3.0.0-beta-2</version> 90 + <version>3.0.0</version>
91 </dependency> 91 </dependency>
92 92
93 <dependency> 93 <dependency>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 <feature name="${project.artifactId}" version="${project.version}" 18 <feature name="${project.artifactId}" version="${project.version}"
19 description="${project.description}"> 19 description="${project.description}">
20 <feature>onos-api</feature> 20 <feature>onos-api</feature>
21 - <bundle>mvn:com.google.protobuf/protobuf-java/3.0.0-beta-2</bundle> 21 + <bundle>mvn:com.google.protobuf/protobuf-java/3.0.0</bundle>
22 <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle> 22 <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
23 </feature> 23 </feature>
24 </features> 24 </features>
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
30 30
31 <properties> 31 <properties>
32 <onos.app.name>org.onosproject.incubator.protobuf</onos.app.name> 32 <onos.app.name>org.onosproject.incubator.protobuf</onos.app.name>
33 - <onos.app.requires>org.onosproject.incubator.rpc</onos.app.requires> 33 + <onos.app.title>ONOS Protocol Buffers models</onos.app.title>
34 <!-- Note: update feature.xml when updating --> 34 <!-- Note: update feature.xml when updating -->
35 - <protobuf.version>3.0.0-beta-2</protobuf.version> 35 + <protobuf.version>3.0.0</protobuf.version>
36 </properties> 36 </properties>
37 37
38 <dependencies> 38 <dependencies>
...@@ -129,7 +129,6 @@ ...@@ -129,7 +129,6 @@
129 depend on protobuf-java directly, you will be transitively depending on the 129 depend on protobuf-java directly, you will be transitively depending on the
130 protobuf-java version that grpc depends on. --> 130 protobuf-java version that grpc depends on. -->
131 <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact> 131 <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
132 - <checkStaleness>true</checkStaleness>
133 </configuration> 132 </configuration>
134 <executions> 133 <executions>
135 <execution> 134 <execution>
...@@ -143,7 +142,7 @@ ...@@ -143,7 +142,7 @@
143 <plugin> 142 <plugin>
144 <groupId>org.codehaus.mojo</groupId> 143 <groupId>org.codehaus.mojo</groupId>
145 <artifactId>build-helper-maven-plugin</artifactId> 144 <artifactId>build-helper-maven-plugin</artifactId>
146 - <version>1.10</version> 145 + <version>1.11</version>
147 <executions> 146 <executions>
148 <execution> 147 <execution>
149 <id>add-source</id> 148 <id>add-source</id>
......
...@@ -18,24 +18,25 @@ ...@@ -18,24 +18,25 @@
18 <feature name="${project.artifactId}" version="${project.version}" 18 <feature name="${project.artifactId}" version="${project.version}"
19 description="${project.description}"> 19 description="${project.description}">
20 <feature>onos-api</feature> 20 <feature>onos-api</feature>
21 - <bundle>mvn:com.google.protobuf/protobuf-java/3.0.0-beta-2</bundle> 21 + <bundle>mvn:com.google.protobuf/protobuf-java/3.0.0</bundle>
22 - <bundle>mvn:io.netty/netty-common/4.1.0.CR7</bundle> 22 + <bundle>mvn:io.netty/netty-common/4.1.3.Final</bundle>
23 - <bundle>mvn:io.netty/netty-buffer/4.1.0.CR7</bundle> 23 + <bundle>mvn:io.netty/netty-buffer/4.1.3.Final</bundle>
24 - <bundle>mvn:io.netty/netty-transport/4.1.0.CR7</bundle> 24 + <bundle>mvn:io.netty/netty-transport/4.1.3.Final</bundle>
25 - <bundle>mvn:io.netty/netty-handler/4.1.0.CR7</bundle> 25 + <bundle>mvn:io.netty/netty-handler/4.1.3.Final</bundle>
26 - <bundle>mvn:io.netty/netty-codec/4.1.0.CR7</bundle> 26 + <bundle>mvn:io.netty/netty-codec/4.1.3.Final</bundle>
27 - <bundle>mvn:io.netty/netty-codec-http/4.1.0.CR7</bundle> 27 + <bundle>mvn:io.netty/netty-codec-http/4.1.3.Final</bundle>
28 - <bundle>mvn:io.netty/netty-codec-http2/4.1.0.CR7</bundle> 28 + <bundle>mvn:io.netty/netty-codec-http2/4.1.3.Final</bundle>
29 - <bundle>mvn:io.netty/netty-resolver/4.1.0.CR7</bundle> 29 + <bundle>mvn:io.netty/netty-resolver/4.1.3.Final</bundle>
30 <!-- TODO: Create shaded jar for these. --> 30 <!-- TODO: Create shaded jar for these. -->
31 - <bundle>wrap:mvn:com.google.auth/google-auth-library-credentials/0.3.0$Bundle-SymbolicName=com.google.auth.google-auth-library-credentials&amp;Bundle-Version=0.3.0</bundle> 31 + <bundle>wrap:mvn:com.google.auth/google-auth-library-credentials/0.4.0$Bundle-SymbolicName=com.google.auth.google-auth-library-credentials&amp;Bundle-Version=0.4.0</bundle>
32 - <bundle>wrap:mvn:com.google.auth/google-auth-library-oauth2-http/0.3.0$Bundle-SymbolicName=com.google.auth.google-auth-library-oauth2-http&amp;Bundle-Version=0.3.0</bundle> 32 + <bundle>wrap:mvn:com.google.auth/google-auth-library-oauth2-http/0.4.0$Bundle-SymbolicName=com.google.auth.google-auth-library-oauth2-http&amp;Bundle-Version=0.4.0</bundle>
33 - <bundle>wrap:mvn:io.grpc/grpc-core/0.14.0$Bundle-SymbolicName=io.grpc.grpc-core&amp;Bundle-Version=0.14.0&amp;</bundle> 33 + <!-- io.grpc.internal required for DnsNameResolverProvider -->
34 - <bundle>wrap:mvn:io.grpc/grpc-protobuf-lite/0.14.0$Bundle-SymbolicName=io.grpc.grpc-protobuf-lite&amp;Bundle-Version=0.14.0&amp;</bundle> 34 + <bundle>wrap:mvn:io.grpc/grpc-core/1.0.0-pre2$Bundle-SymbolicName=io.grpc.grpc-core&amp;Bundle-Version=1.0.0&amp;Export-Package=*;version=1.0.0,io.grpc.internal;version=1.0.0&amp;</bundle>
35 - <bundle>wrap:mvn:io.grpc/grpc-protobuf/0.14.0$Bundle-SymbolicName=io.grpc.grpc-protobuf&amp;Bundle-Version=0.14.0&amp;</bundle> 35 + <bundle>wrap:mvn:io.grpc/grpc-protobuf-lite/1.0.0-pre2$Bundle-SymbolicName=io.grpc.grpc-protobuf-lite&amp;Bundle-Version=1.0.0&amp;</bundle>
36 - <bundle>wrap:mvn:io.grpc/grpc-stub/0.14.0$Bundle-SymbolicName=io.grpc.grpc-stub&amp;Bundle-Version=0.14.0&amp;</bundle> 36 + <bundle>wrap:mvn:io.grpc/grpc-protobuf/1.0.0-pre2$Bundle-SymbolicName=io.grpc.grpc-protobuf&amp;Bundle-Version=1.0.0&amp;</bundle>
37 - <bundle>wrap:mvn:io.grpc/grpc-netty/0.14.0$Bundle-SymbolicName=io.grpc.grpc-netty&amp;Bundle-Version=0.14.0&amp;Import-Package=io.netty.*;version=4.1.0.CR7,*</bundle> 37 + <bundle>wrap:mvn:io.grpc/grpc-stub/1.0.0-pre2$Bundle-SymbolicName=io.grpc.grpc-stub&amp;Bundle-Version=1.0.0&amp;</bundle>
38 - <bundle>wrap:mvn:io.grpc/grpc-auth/0.14.0$Bundle-SymbolicName=io.grpc.grpc-auth&amp;Bundle-Version=0.14.0&amp;Import-Package=javax.net.ssl,*</bundle> 38 + <bundle>wrap:mvn:io.grpc/grpc-netty/1.0.0-pre2$Bundle-SymbolicName=io.grpc.grpc-netty&amp;Bundle-Version=1.0.0&amp;Import-Package=io.netty.*;version=4.1.3,*</bundle>
39 + <bundle>wrap:mvn:io.grpc/grpc-auth/1.0.0-pre2$Bundle-SymbolicName=io.grpc.grpc-auth&amp;Bundle-Version=1.0.0&amp;Import-Package=javax.net.ssl,*</bundle>
39 <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle> 40 <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
40 </feature> 41 </feature>
41 </features> 42 </features>
......
...@@ -30,11 +30,15 @@ ...@@ -30,11 +30,15 @@
30 30
31 <properties> 31 <properties>
32 <onos.app.name>org.onosproject.incubator.rpc.grpc</onos.app.name> 32 <onos.app.name>org.onosproject.incubator.rpc.grpc</onos.app.name>
33 - <onos.app.requires>org.onosproject.incubator.rpc,org.onosproject.incubator.protobuf</onos.app.requires> 33 + <onos.app.title>ONOS gRPC API</onos.app.title>
34 - <protobuf.version>3.0.0-beta-2</protobuf.version> 34 + <onos.app.requires>
35 + org.onosproject.incubator.rpc,
36 + org.onosproject.incubator.protobuf
37 + </onos.app.requires>
38 + <protobuf.version>3.0.0</protobuf.version>
35 <!-- Note: update feature.xml when updating --> 39 <!-- Note: update feature.xml when updating -->
36 - <grpc.version>0.14.0</grpc.version> 40 + <grpc.version>1.0.0-pre2</grpc.version>
37 - <grpc.netty.version>4.1.0.CR7</grpc.netty.version> 41 + <grpc.netty.version>4.1.3.Final</grpc.netty.version>
38 </properties> 42 </properties>
39 43
40 <dependencies> 44 <dependencies>
...@@ -211,7 +215,6 @@ ...@@ -211,7 +215,6 @@
211 <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact> 215 <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
212 <pluginId>grpc-java</pluginId> 216 <pluginId>grpc-java</pluginId>
213 <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact> 217 <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
214 - <checkStaleness>true</checkStaleness>
215 </configuration> 218 </configuration>
216 <executions> 219 <executions>
217 <execution> 220 <execution>
...@@ -226,7 +229,7 @@ ...@@ -226,7 +229,7 @@
226 <plugin> 229 <plugin>
227 <groupId>org.codehaus.mojo</groupId> 230 <groupId>org.codehaus.mojo</groupId>
228 <artifactId>build-helper-maven-plugin</artifactId> 231 <artifactId>build-helper-maven-plugin</artifactId>
229 - <version>1.10</version> 232 + <version>1.11</version>
230 <executions> 233 <executions>
231 <execution> 234 <execution>
232 <id>add-source</id> 235 <id>add-source</id>
...@@ -274,12 +277,6 @@ ...@@ -274,12 +277,6 @@
274 <artifactId>netty-common</artifactId> 277 <artifactId>netty-common</artifactId>
275 <version>${grpc.netty.version}</version> 278 <version>${grpc.netty.version}</version>
276 </dependency> 279 </dependency>
277 - <dependency>
278 - <groupId>com.twitter</groupId>
279 - <artifactId>hpack</artifactId>
280 - <!-- 0.11.0 and later are published as a bundle -->
281 - <version>0.11.0</version>
282 - </dependency>
283 </dependencies> 280 </dependencies>
284 </dependencyManagement> 281 </dependencyManagement>
285 282
......
...@@ -36,6 +36,7 @@ import org.slf4j.Logger; ...@@ -36,6 +36,7 @@ import org.slf4j.Logger;
36 import org.slf4j.LoggerFactory; 36 import org.slf4j.LoggerFactory;
37 37
38 import io.grpc.ManagedChannel; 38 import io.grpc.ManagedChannel;
39 +import io.grpc.internal.DnsNameResolverProvider;
39 import io.grpc.netty.NegotiationType; 40 import io.grpc.netty.NegotiationType;
40 import io.grpc.netty.NettyChannelBuilder; 41 import io.grpc.netty.NettyChannelBuilder;
41 42
...@@ -62,7 +63,6 @@ public class GrpcRemoteServiceProvider implements RemoteServiceContextProvider { ...@@ -62,7 +63,6 @@ public class GrpcRemoteServiceProvider implements RemoteServiceContextProvider {
62 63
63 private RemoteServiceContextProviderService providerService; 64 private RemoteServiceContextProviderService providerService;
64 65
65 -
66 @Activate 66 @Activate
67 protected void activate() { 67 protected void activate() {
68 providerService = rpcRegistry.register(this); 68 providerService = rpcRegistry.register(this);
...@@ -116,6 +116,10 @@ public class GrpcRemoteServiceProvider implements RemoteServiceContextProvider { ...@@ -116,6 +116,10 @@ public class GrpcRemoteServiceProvider implements RemoteServiceContextProvider {
116 } 116 }
117 return NettyChannelBuilder.forAddress(uri.getHost(), port) 117 return NettyChannelBuilder.forAddress(uri.getHost(), port)
118 .negotiationType(NegotiationType.PLAINTEXT) 118 .negotiationType(NegotiationType.PLAINTEXT)
119 + // TODO Not ideal fix, gRPC discovers name resolvers
120 + // in the class path, but OSGi was preventing it.
121 + // Manually specifying the default dns resolver for now.
122 + .nameResolverFactory(new DnsNameResolverProvider())
119 .build(); 123 .build();
120 } 124 }
121 125
......
...@@ -39,8 +39,7 @@ import org.apache.felix.scr.annotations.Property; ...@@ -39,8 +39,7 @@ import org.apache.felix.scr.annotations.Property;
39 import org.apache.felix.scr.annotations.Reference; 39 import org.apache.felix.scr.annotations.Reference;
40 import org.apache.felix.scr.annotations.ReferenceCardinality; 40 import org.apache.felix.scr.annotations.ReferenceCardinality;
41 import org.onlab.util.Tools; 41 import org.onlab.util.Tools;
42 -import org.onosproject.grpc.net.device.DeviceProviderRegistryRpcGrpc; 42 +import org.onosproject.grpc.net.device.DeviceProviderRegistryRpcGrpc.DeviceProviderRegistryRpcImplBase;
43 -import org.onosproject.grpc.net.device.DeviceProviderRegistryRpcGrpc.DeviceProviderRegistryRpc;
44 import org.onosproject.grpc.net.device.DeviceService.DeviceConnected; 43 import org.onosproject.grpc.net.device.DeviceService.DeviceConnected;
45 import org.onosproject.grpc.net.device.DeviceService.DeviceDisconnected; 44 import org.onosproject.grpc.net.device.DeviceService.DeviceDisconnected;
46 import org.onosproject.grpc.net.device.DeviceService.DeviceProviderMsg; 45 import org.onosproject.grpc.net.device.DeviceService.DeviceProviderMsg;
...@@ -51,7 +50,6 @@ import org.onosproject.grpc.net.device.DeviceService.ReceivedRoleReply; ...@@ -51,7 +50,6 @@ import org.onosproject.grpc.net.device.DeviceService.ReceivedRoleReply;
51 import org.onosproject.grpc.net.device.DeviceService.RegisterProvider; 50 import org.onosproject.grpc.net.device.DeviceService.RegisterProvider;
52 import org.onosproject.grpc.net.device.DeviceService.UpdatePortStatistics; 51 import org.onosproject.grpc.net.device.DeviceService.UpdatePortStatistics;
53 import org.onosproject.grpc.net.device.DeviceService.UpdatePorts; 52 import org.onosproject.grpc.net.device.DeviceService.UpdatePorts;
54 -import org.onosproject.grpc.net.link.LinkProviderServiceRpcGrpc;
55 import org.onosproject.incubator.protobuf.net.ProtobufUtils; 53 import org.onosproject.incubator.protobuf.net.ProtobufUtils;
56 import org.onosproject.net.DeviceId; 54 import org.onosproject.net.DeviceId;
57 import org.onosproject.net.MastershipRole; 55 import org.onosproject.net.MastershipRole;
...@@ -123,8 +121,8 @@ public class GrpcRemoteServiceServer { ...@@ -123,8 +121,8 @@ public class GrpcRemoteServiceServer {
123 log.debug("Server starting on {}", listenPort); 121 log.debug("Server starting on {}", listenPort);
124 try { 122 try {
125 server = NettyServerBuilder.forPort(listenPort) 123 server = NettyServerBuilder.forPort(listenPort)
126 - .addService(DeviceProviderRegistryRpcGrpc.bindService(new DeviceProviderRegistryServerProxy())) 124 + .addService(new DeviceProviderRegistryServerProxy())
127 - .addService(LinkProviderServiceRpcGrpc.bindService(new LinkProviderServiceServerProxy(this))) 125 + .addService(new LinkProviderServiceServerProxy(this))
128 .build().start(); 126 .build().start();
129 } catch (IOException e) { 127 } catch (IOException e) {
130 log.error("Failed to start gRPC server", e); 128 log.error("Failed to start gRPC server", e);
...@@ -202,7 +200,7 @@ public class GrpcRemoteServiceServer { ...@@ -202,7 +200,7 @@ public class GrpcRemoteServiceServer {
202 /** 200 /**
203 * Relays DeviceProviderRegistry calls from RPC client. 201 * Relays DeviceProviderRegistry calls from RPC client.
204 */ 202 */
205 - class DeviceProviderRegistryServerProxy implements DeviceProviderRegistryRpc { 203 + class DeviceProviderRegistryServerProxy extends DeviceProviderRegistryRpcImplBase {
206 204
207 @Override 205 @Override
208 public StreamObserver<DeviceProviderServiceMsg> register(StreamObserver<DeviceProviderMsg> toDeviceProvider) { 206 public StreamObserver<DeviceProviderServiceMsg> register(StreamObserver<DeviceProviderMsg> toDeviceProvider) {
......
...@@ -22,7 +22,7 @@ import org.onosproject.net.link.LinkProviderRegistry; ...@@ -22,7 +22,7 @@ import org.onosproject.net.link.LinkProviderRegistry;
22 import org.onosproject.net.link.LinkProviderService; 22 import org.onosproject.net.link.LinkProviderService;
23 import org.onosproject.net.provider.AbstractProviderRegistry; 23 import org.onosproject.net.provider.AbstractProviderRegistry;
24 24
25 -import com.google.api.client.repackaged.com.google.common.annotations.Beta; 25 +import com.google.common.annotations.Beta;
26 26
27 import io.grpc.Channel; 27 import io.grpc.Channel;
28 28
......
...@@ -38,7 +38,7 @@ import org.onosproject.net.provider.ProviderId; ...@@ -38,7 +38,7 @@ import org.onosproject.net.provider.ProviderId;
38 import org.slf4j.Logger; 38 import org.slf4j.Logger;
39 import org.slf4j.LoggerFactory; 39 import org.slf4j.LoggerFactory;
40 40
41 -import com.google.api.client.repackaged.com.google.common.annotations.Beta; 41 +import com.google.common.annotations.Beta;
42 import com.google.common.util.concurrent.ListenableFuture; 42 import com.google.common.util.concurrent.ListenableFuture;
43 43
44 import io.grpc.Channel; 44 import io.grpc.Channel;
......
...@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; ...@@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit;
27 import org.apache.commons.lang3.tuple.Pair; 27 import org.apache.commons.lang3.tuple.Pair;
28 import org.onosproject.grpc.net.Link.ConnectPoint.ElementIdCase; 28 import org.onosproject.grpc.net.Link.ConnectPoint.ElementIdCase;
29 import org.onosproject.grpc.net.Link.LinkType; 29 import org.onosproject.grpc.net.Link.LinkType;
30 -import org.onosproject.grpc.net.link.LinkProviderServiceRpcGrpc.LinkProviderServiceRpc; 30 +import org.onosproject.grpc.net.link.LinkProviderServiceRpcGrpc.LinkProviderServiceRpcImplBase;
31 import org.onosproject.grpc.net.link.LinkService.LinkDetectedMsg; 31 import org.onosproject.grpc.net.link.LinkService.LinkDetectedMsg;
32 import org.onosproject.grpc.net.link.LinkService.LinkVanishedMsg; 32 import org.onosproject.grpc.net.link.LinkService.LinkVanishedMsg;
33 import org.onosproject.grpc.net.link.LinkService.Void; 33 import org.onosproject.grpc.net.link.LinkService.Void;
...@@ -44,10 +44,10 @@ import org.onosproject.net.link.LinkProviderService; ...@@ -44,10 +44,10 @@ import org.onosproject.net.link.LinkProviderService;
44 import org.slf4j.Logger; 44 import org.slf4j.Logger;
45 import org.slf4j.LoggerFactory; 45 import org.slf4j.LoggerFactory;
46 46
47 -import com.google.api.client.repackaged.com.google.common.annotations.Beta;
48 import com.google.common.cache.Cache; 47 import com.google.common.cache.Cache;
49 import com.google.common.cache.CacheBuilder; 48 import com.google.common.cache.CacheBuilder;
50 import com.google.common.cache.RemovalNotification; 49 import com.google.common.cache.RemovalNotification;
50 +import com.google.common.annotations.Beta;
51 51
52 import io.grpc.stub.StreamObserver; 52 import io.grpc.stub.StreamObserver;
53 53
...@@ -57,7 +57,7 @@ import io.grpc.stub.StreamObserver; ...@@ -57,7 +57,7 @@ import io.grpc.stub.StreamObserver;
57 */ 57 */
58 @Beta 58 @Beta
59 final class LinkProviderServiceServerProxy 59 final class LinkProviderServiceServerProxy
60 - implements LinkProviderServiceRpc { 60 + extends LinkProviderServiceRpcImplBase {
61 61
62 /** 62 /**
63 * Silence time in seconds, until link gets treated as vanished. 63 * Silence time in seconds, until link gets treated as vanished.
......
...@@ -19,7 +19,7 @@ import org.onosproject.net.link.LinkProvider; ...@@ -19,7 +19,7 @@ import org.onosproject.net.link.LinkProvider;
19 import org.onosproject.net.provider.AbstractProvider; 19 import org.onosproject.net.provider.AbstractProvider;
20 import org.onosproject.net.provider.ProviderId; 20 import org.onosproject.net.provider.ProviderId;
21 21
22 -import com.google.api.client.repackaged.com.google.common.annotations.Beta; 22 +import com.google.common.annotations.Beta;
23 import com.google.common.base.MoreObjects; 23 import com.google.common.base.MoreObjects;
24 24
25 /** 25 /**
......