[ONOS-4520] Separate model messages from service messages in ProtoBuf IDL.
- move ProtoBuf generated code in a package similar to ONOS models.
Change-Id: I5deb591094c2b8af2b22041da935567fc8dacd87
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/DeviceProviderServiceClientProxy.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/DeviceProviderServiceClientProxy.java
index 83bd44f..185e094 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/DeviceProviderServiceClientProxy.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/DeviceProviderServiceClientProxy.java
@@ -24,13 +24,13 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.onosproject.grpc.Device.DeviceProviderMsg;
-import org.onosproject.grpc.Device.DeviceProviderServiceMsg;
-import org.onosproject.grpc.Device.IsReachableRequest;
-import org.onosproject.grpc.Device.RoleChanged;
-import org.onosproject.grpc.Device.TriggerProbe;
-import org.onosproject.grpc.DeviceProviderRegistryRpcGrpc;
-import org.onosproject.grpc.DeviceProviderRegistryRpcGrpc.DeviceProviderRegistryRpcStub;
+import org.onosproject.grpc.net.device.DeviceProviderRegistryRpcGrpc;
+import org.onosproject.grpc.net.device.DeviceProviderRegistryRpcGrpc.DeviceProviderRegistryRpcStub;
+import org.onosproject.grpc.net.device.DeviceService.DeviceProviderMsg;
+import org.onosproject.grpc.net.device.DeviceService.DeviceProviderServiceMsg;
+import org.onosproject.grpc.net.device.DeviceService.IsReachableRequest;
+import org.onosproject.grpc.net.device.DeviceService.RoleChanged;
+import org.onosproject.grpc.net.device.DeviceService.TriggerProbe;
import org.onosproject.net.DeviceId;
import org.onosproject.net.MastershipRole;
import org.onosproject.net.device.DeviceDescription;
@@ -112,7 +112,7 @@
checkValidity();
DeviceProviderServiceMsg.Builder builder = DeviceProviderServiceMsg.newBuilder();
- List<org.onosproject.grpc.Port.PortDescription> portDescs =
+ List<org.onosproject.grpc.net.Port.PortDescription> portDescs =
portDescriptions.stream()
.map(GrpcDeviceUtils::translate)
.collect(toList());
@@ -160,7 +160,7 @@
checkValidity();
DeviceProviderServiceMsg.Builder builder = DeviceProviderServiceMsg.newBuilder();
- List<org.onosproject.grpc.Port.PortStatistics> portStats =
+ List<org.onosproject.grpc.net.Port.PortStatistics> portStats =
portStatistics.stream()
.map(GrpcDeviceUtils::translate)
.collect(toList());
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcDeviceUtils.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcDeviceUtils.java
index 0633ce0..647acf7b24 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcDeviceUtils.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcDeviceUtils.java
@@ -20,8 +20,8 @@
import java.util.Map;
import org.onlab.packet.ChassisId;
-import org.onosproject.grpc.Device.DeviceType;
-import org.onosproject.grpc.Port.PortType;
+import org.onosproject.grpc.net.Device.DeviceType;
+import org.onosproject.grpc.net.Port.PortType;
import org.onosproject.net.Annotations;
import org.onosproject.net.DefaultAnnotations;
import org.onosproject.net.Device;
@@ -55,7 +55,7 @@
* @param role mastership role in gRPC enum
* @return equivalent in ONOS enum
*/
- public static MastershipRole translate(org.onosproject.grpc.Device.MastershipRole role) {
+ public static MastershipRole translate(org.onosproject.grpc.net.Device.MastershipRole role) {
switch (role) {
case NONE:
return MastershipRole.NONE;
@@ -77,15 +77,15 @@
* @param newRole ONOS' mastership role
* @return equivalent in gRPC message enum
*/
- public static org.onosproject.grpc.Device.MastershipRole translate(MastershipRole newRole) {
+ public static org.onosproject.grpc.net.Device.MastershipRole translate(MastershipRole newRole) {
switch (newRole) {
case MASTER:
- return org.onosproject.grpc.Device.MastershipRole.MASTER;
+ return org.onosproject.grpc.net.Device.MastershipRole.MASTER;
case STANDBY:
- return org.onosproject.grpc.Device.MastershipRole.STANDBY;
+ return org.onosproject.grpc.net.Device.MastershipRole.STANDBY;
case NONE:
default:
- return org.onosproject.grpc.Device.MastershipRole.NONE;
+ return org.onosproject.grpc.net.Device.MastershipRole.NONE;
}
}
@@ -96,7 +96,7 @@
* @param deviceDescription gRPC message
* @return {@link DeviceDescription}
*/
- public static DeviceDescription translate(org.onosproject.grpc.Device.DeviceDescription deviceDescription) {
+ public static DeviceDescription translate(org.onosproject.grpc.net.Device.DeviceDescription deviceDescription) {
URI uri = URI.create(deviceDescription.getDeviceUri());
Device.Type type = translate(deviceDescription.getType());
String manufacturer = deviceDescription.getManufacturer();
@@ -116,9 +116,9 @@
* @param deviceDescription {@link DeviceDescription}
* @return gRPC DeviceDescription message
*/
- public static org.onosproject.grpc.Device.DeviceDescription translate(DeviceDescription deviceDescription) {
+ public static org.onosproject.grpc.net.Device.DeviceDescription translate(DeviceDescription deviceDescription) {
- return org.onosproject.grpc.Device.DeviceDescription.newBuilder()
+ return org.onosproject.grpc.net.Device.DeviceDescription.newBuilder()
.setDeviceUri(deviceDescription.deviceUri().toString())
.setType(translate(deviceDescription.type()))
.setManufacturer(deviceDescription.manufacturer())
@@ -137,7 +137,7 @@
* @param type gRPC message
* @return {@link Device.Type}
*/
- public static Device.Type translate(org.onosproject.grpc.Device.DeviceType type) {
+ public static Device.Type translate(org.onosproject.grpc.net.Device.DeviceType type) {
switch (type) {
case BALANCER:
return Device.Type.BALANCER;
@@ -224,7 +224,7 @@
* @param portDescription gRPC message
* @return {@link PortDescription}
*/
- public static PortDescription translate(org.onosproject.grpc.Port.PortDescription portDescription) {
+ public static PortDescription translate(org.onosproject.grpc.net.Port.PortDescription portDescription) {
PortNumber number = PortNumber.fromString(portDescription.getPortNumber());
boolean isEnabled = portDescription.getIsEnabled();
Port.Type type = translate(portDescription.getType());
@@ -240,9 +240,9 @@
* @param portDescription {@link PortDescription}
* @return gRPC PortDescription message
*/
- public static org.onosproject.grpc.Port.PortDescription translate(PortDescription portDescription) {
+ public static org.onosproject.grpc.net.Port.PortDescription translate(PortDescription portDescription) {
// TODO How to deal with more specific Port...
- return org.onosproject.grpc.Port.PortDescription.newBuilder()
+ return org.onosproject.grpc.net.Port.PortDescription.newBuilder()
.setPortNumber(portDescription.portNumber().toString())
.setIsEnabled(portDescription.isEnabled())
.setType(translate(portDescription.type()))
@@ -316,7 +316,7 @@
* @param portStatistics gRPC PortStatistics message
* @return {@link PortStatistics}
*/
- public static PortStatistics translate(org.onosproject.grpc.Port.PortStatistics portStatistics) {
+ public static PortStatistics translate(org.onosproject.grpc.net.Port.PortStatistics portStatistics) {
// TODO implement adding missing fields
return DefaultPortStatistics.builder()
.setPort(portStatistics.getPort())
@@ -331,9 +331,9 @@
* @param portStatistics {@link PortStatistics}
* @return gRPC PortStatistics message
*/
- public static org.onosproject.grpc.Port.PortStatistics translate(PortStatistics portStatistics) {
+ public static org.onosproject.grpc.net.Port.PortStatistics translate(PortStatistics portStatistics) {
// TODO implement adding missing fields
- return org.onosproject.grpc.Port.PortStatistics.newBuilder()
+ return org.onosproject.grpc.net.Port.PortStatistics.newBuilder()
.setPort(portStatistics.port())
.setPacketsReceived(portStatistics.packetsReceived())
.setPacketsSent(portStatistics.packetsSent())
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
index f14b4ef..a36b21e 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/GrpcRemoteServiceServer.java
@@ -36,19 +36,19 @@
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.onosproject.grpc.Device.DeviceConnected;
-import org.onosproject.grpc.Device.DeviceDisconnected;
-import org.onosproject.grpc.Device.DeviceProviderMsg;
-import org.onosproject.grpc.Device.DeviceProviderServiceMsg;
-import org.onosproject.grpc.Device.IsReachableResponse;
-import org.onosproject.grpc.Device.PortStatusChanged;
-import org.onosproject.grpc.Device.ReceivedRoleReply;
-import org.onosproject.grpc.Device.RegisterProvider;
-import org.onosproject.grpc.Device.UpdatePortStatistics;
-import org.onosproject.grpc.Device.UpdatePorts;
-import org.onosproject.grpc.DeviceProviderRegistryRpcGrpc;
-import org.onosproject.grpc.DeviceProviderRegistryRpcGrpc.DeviceProviderRegistryRpc;
-import org.onosproject.grpc.LinkProviderServiceRpcGrpc;
+import org.onosproject.grpc.net.device.DeviceProviderRegistryRpcGrpc;
+import org.onosproject.grpc.net.device.DeviceProviderRegistryRpcGrpc.DeviceProviderRegistryRpc;
+import org.onosproject.grpc.net.device.DeviceService.DeviceConnected;
+import org.onosproject.grpc.net.device.DeviceService.DeviceDisconnected;
+import org.onosproject.grpc.net.device.DeviceService.DeviceProviderMsg;
+import org.onosproject.grpc.net.device.DeviceService.DeviceProviderServiceMsg;
+import org.onosproject.grpc.net.device.DeviceService.IsReachableResponse;
+import org.onosproject.grpc.net.device.DeviceService.PortStatusChanged;
+import org.onosproject.grpc.net.device.DeviceService.ReceivedRoleReply;
+import org.onosproject.grpc.net.device.DeviceService.RegisterProvider;
+import org.onosproject.grpc.net.device.DeviceService.UpdatePortStatistics;
+import org.onosproject.grpc.net.device.DeviceService.UpdatePorts;
+import org.onosproject.grpc.net.link.LinkProviderServiceRpcGrpc;
import org.onosproject.net.DeviceId;
import org.onosproject.net.MastershipRole;
import org.onosproject.net.PortNumber;
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceClientProxy.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceClientProxy.java
index 912a1be..4dd4a0a 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceClientProxy.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceClientProxy.java
@@ -21,12 +21,12 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import org.onosproject.grpc.Link.LinkDetectedMsg;
-import org.onosproject.grpc.Link.LinkType;
-import org.onosproject.grpc.Link.LinkVanishedMsg;
-import org.onosproject.grpc.Link.Void;
-import org.onosproject.grpc.LinkProviderServiceRpcGrpc;
-import org.onosproject.grpc.LinkProviderServiceRpcGrpc.LinkProviderServiceRpcFutureStub;
+import org.onosproject.grpc.net.Link.LinkType;
+import org.onosproject.grpc.net.link.LinkProviderServiceRpcGrpc;
+import org.onosproject.grpc.net.link.LinkProviderServiceRpcGrpc.LinkProviderServiceRpcFutureStub;
+import org.onosproject.grpc.net.link.LinkService.LinkDetectedMsg;
+import org.onosproject.grpc.net.link.LinkService.LinkVanishedMsg;
+import org.onosproject.grpc.net.link.LinkService.Void;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Link.Type;
@@ -237,7 +237,7 @@
/**
* Translates ONOS object to gRPC message.
*
- * @param type {@link Link.Type}
+ * @param type {@link org.onosproject.net.Link.Type Link.Type}
* @return gRPC LinkType
*/
private LinkType translate(Type type) {
@@ -267,8 +267,8 @@
* @param cp {@link ConnectPoint}
* @return gRPC ConnectPoint
*/
- private org.onosproject.grpc.Link.ConnectPoint translate(ConnectPoint cp) {
- return org.onosproject.grpc.Link.ConnectPoint.newBuilder()
+ private org.onosproject.grpc.net.Link.ConnectPoint translate(ConnectPoint cp) {
+ return org.onosproject.grpc.net.Link.ConnectPoint.newBuilder()
.setDeviceId(cp.deviceId().toString())
.setPortNumber(cp.port().toString())
.build();
diff --git a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceServerProxy.java b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceServerProxy.java
index bf35ed2..1878426 100644
--- a/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceServerProxy.java
+++ b/incubator/rpc-grpc/src/main/java/org/onosproject/incubator/rpc/grpc/LinkProviderServiceServerProxy.java
@@ -19,12 +19,12 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.net.DeviceId.deviceId;
-import org.onosproject.grpc.Link.LinkDetectedMsg;
-import org.onosproject.grpc.Link.LinkType;
-import org.onosproject.grpc.Link.LinkVanishedMsg;
-import org.onosproject.grpc.Link.Void;
-import org.onosproject.grpc.Link.ConnectPoint.ElementIdCase;
-import org.onosproject.grpc.LinkProviderServiceRpcGrpc.LinkProviderServiceRpc;
+import org.onosproject.grpc.net.Link.ConnectPoint.ElementIdCase;
+import org.onosproject.grpc.net.Link.LinkType;
+import org.onosproject.grpc.net.link.LinkProviderServiceRpcGrpc.LinkProviderServiceRpc;
+import org.onosproject.grpc.net.link.LinkService.LinkDetectedMsg;
+import org.onosproject.grpc.net.link.LinkService.LinkVanishedMsg;
+import org.onosproject.grpc.net.link.LinkService.Void;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Link;
@@ -136,7 +136,7 @@
* @param connectPoint gRPC message.
* @return {@link ConnectPoint}
*/
- private ConnectPoint translate(org.onosproject.grpc.Link.ConnectPoint connectPoint) {
+ private ConnectPoint translate(org.onosproject.grpc.net.Link.ConnectPoint connectPoint) {
checkArgument(connectPoint.getElementIdCase() == ElementIdCase.DEVICE_ID,
"Only DeviceId supported.");
return new ConnectPoint(deviceId(connectPoint.getDeviceId()),
@@ -149,7 +149,7 @@
* @param linkDescription gRPC message
* @return {@link LinkDescription}
*/
- private LinkDescription translate(org.onosproject.grpc.Link.LinkDescription linkDescription) {
+ private LinkDescription translate(org.onosproject.grpc.net.Link.LinkDescription linkDescription) {
ConnectPoint src = translate(linkDescription.getSrc());
ConnectPoint dst = translate(linkDescription.getDst());
Link.Type type = translate(linkDescription.getType());
@@ -161,7 +161,7 @@
* Translates gRPC message to corresponding ONOS object.
*
* @param type gRPC message enum
- * @return {@link Type}
+ * @return {@link org.onosproject.net.Link.Type Link.Type}
*/
private Link.Type translate(LinkType type) {
switch (type) {
diff --git a/incubator/rpc-grpc/src/main/proto/Device.proto b/incubator/rpc-grpc/src/main/proto/Device.proto
index aae46d9..ec138e0 100644
--- a/incubator/rpc-grpc/src/main/proto/Device.proto
+++ b/incubator/rpc-grpc/src/main/proto/Device.proto
@@ -1,7 +1,6 @@
syntax = "proto3";
-option java_package = "org.onosproject.grpc";
+option java_package = "org.onosproject.grpc.net";
-import "Port.proto";
package Device;
enum DeviceType {
@@ -37,95 +36,3 @@
MASTER = 1;
STANDBY = 2;
}
-
-message DeviceConnected {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
- DeviceDescription device_description = 2;
-}
-
-message DeviceDisconnected {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
-}
-
-message UpdatePorts {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
- repeated Port.PortDescription port_descriptions= 2;
-}
-
-message PortStatusChanged {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
- Port.PortDescription port_description= 2;
-}
-
-message ReceivedRoleReply {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
- MastershipRole requested = 2;
- MastershipRole response = 3;
-}
-
-message UpdatePortStatistics {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
- repeated Port.PortStatistics port_statistics = 2;
-}
-
-message RegisterProvider {
- // DeviceProvider's ProviderId scheme
- string provider_scheme = 1;
-}
-
-message DeviceProviderServiceMsg {
- oneof method {
- DeviceConnected device_connected= 1;
- DeviceDisconnected device_disconnected = 2;
- UpdatePorts update_ports= 3;
- PortStatusChanged port_status_changed = 4;
- ReceivedRoleReply received_role_reply = 5;
- UpdatePortStatistics update_port_statistics = 6;
-
- // This message is for return value of DeviceProvider#isReachable
- IsReachableResponse is_reachable_response = 7;
-
- // This MUST be the 1st message over the stream
- RegisterProvider register_provider = 8;
- }
-}
-
-message TriggerProbe {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
-}
-
-message RoleChanged {
- // DeviceID as String DeviceId#toString
- string device_id = 1;
- MastershipRole new_role = 2;
-}
-
-message IsReachableRequest {
- int32 xid = 1;
- // DeviceID as String DeviceId#toString
- string device_id = 2;
-}
-
-message IsReachableResponse {
- int32 xid = 1;
- bool is_reachable = 2;
-}
-
-message DeviceProviderMsg {
- oneof method {
- TriggerProbe trigger_probe = 1;
- RoleChanged role_changed = 2;
- IsReachableRequest is_reachable_request= 3;
- }
-}
-
-service DeviceProviderRegistryRpc {
- rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg);
-}
diff --git a/incubator/rpc-grpc/src/main/proto/DeviceService.proto b/incubator/rpc-grpc/src/main/proto/DeviceService.proto
new file mode 100644
index 0000000..7ac8489
--- /dev/null
+++ b/incubator/rpc-grpc/src/main/proto/DeviceService.proto
@@ -0,0 +1,99 @@
+syntax = "proto3";
+option java_package = "org.onosproject.grpc.net.device";
+
+import "Device.proto";
+import "Port.proto";
+
+package Device;
+
+message DeviceConnected {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+ DeviceDescription device_description = 2;
+}
+
+message DeviceDisconnected {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+}
+
+message UpdatePorts {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+ repeated Port.PortDescription port_descriptions= 2;
+}
+
+message PortStatusChanged {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+ Port.PortDescription port_description= 2;
+}
+
+message ReceivedRoleReply {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+ MastershipRole requested = 2;
+ MastershipRole response = 3;
+}
+
+message UpdatePortStatistics {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+ repeated Port.PortStatistics port_statistics = 2;
+}
+
+message RegisterProvider {
+ // DeviceProvider's ProviderId scheme
+ string provider_scheme = 1;
+}
+
+message DeviceProviderServiceMsg {
+ oneof method {
+ DeviceConnected device_connected= 1;
+ DeviceDisconnected device_disconnected = 2;
+ UpdatePorts update_ports= 3;
+ PortStatusChanged port_status_changed = 4;
+ ReceivedRoleReply received_role_reply = 5;
+ UpdatePortStatistics update_port_statistics = 6;
+
+ // This message is for return value of DeviceProvider#isReachable
+ IsReachableResponse is_reachable_response = 7;
+
+ // This MUST be the 1st message over the stream
+ RegisterProvider register_provider = 8;
+ }
+}
+
+message TriggerProbe {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+}
+
+message RoleChanged {
+ // DeviceID as String DeviceId#toString
+ string device_id = 1;
+ MastershipRole new_role = 2;
+}
+
+message IsReachableRequest {
+ int32 xid = 1;
+ // DeviceID as String DeviceId#toString
+ string device_id = 2;
+}
+
+message IsReachableResponse {
+ int32 xid = 1;
+ bool is_reachable = 2;
+}
+
+message DeviceProviderMsg {
+ oneof method {
+ TriggerProbe trigger_probe = 1;
+ RoleChanged role_changed = 2;
+ IsReachableRequest is_reachable_request= 3;
+ }
+}
+
+service DeviceProviderRegistryRpc {
+ rpc Register(stream DeviceProviderServiceMsg) returns (stream DeviceProviderMsg);
+}
diff --git a/incubator/rpc-grpc/src/main/proto/Link.proto b/incubator/rpc-grpc/src/main/proto/Link.proto
index 27998d3..45b9e90 100644
--- a/incubator/rpc-grpc/src/main/proto/Link.proto
+++ b/incubator/rpc-grpc/src/main/proto/Link.proto
@@ -1,5 +1,5 @@
syntax = "proto3";
-option java_package = "org.onosproject.grpc";
+option java_package = "org.onosproject.grpc.net";
package Link;
@@ -44,27 +44,3 @@
LinkType type = 3;
map<string, string> annotations = 4;
}
-
-// Message te represent no return value
-message Void {}
-
-message LinkDetectedMsg {
- // ProviderId scheme only
- string provider_id = 1;
- LinkDescription link_description = 2;
-}
-
-message LinkVanishedMsg {
- // ProviderId scheme only
- string provider_id = 1;
- oneof subject {
- LinkDescription link_description = 2;
- ConnectPoint connect_point = 3;
- string device_id = 4;
- }
-}
-
-service LinkProviderServiceRpc {
- rpc LinkDetected(LinkDetectedMsg) returns (Void);
- rpc LinkVanished(LinkVanishedMsg) returns (Void);
-}
diff --git a/incubator/rpc-grpc/src/main/proto/LinkService.proto b/incubator/rpc-grpc/src/main/proto/LinkService.proto
new file mode 100644
index 0000000..99e0f22
--- /dev/null
+++ b/incubator/rpc-grpc/src/main/proto/LinkService.proto
@@ -0,0 +1,30 @@
+syntax = "proto3";
+option java_package = "org.onosproject.grpc.net.link";
+
+import "Link.proto";
+
+package Link;
+
+// Message to represent no return value
+message Void {}
+
+message LinkDetectedMsg {
+ // ProviderId scheme only
+ string provider_id = 1;
+ LinkDescription link_description = 2;
+}
+
+message LinkVanishedMsg {
+ // ProviderId scheme only
+ string provider_id = 1;
+ oneof subject {
+ LinkDescription link_description = 2;
+ ConnectPoint connect_point = 3;
+ string device_id = 4;
+ }
+}
+
+service LinkProviderServiceRpc {
+ rpc LinkDetected(LinkDetectedMsg) returns (Void);
+ rpc LinkVanished(LinkVanishedMsg) returns (Void);
+}
diff --git a/incubator/rpc-grpc/src/main/proto/Port.proto b/incubator/rpc-grpc/src/main/proto/Port.proto
index f32193c..0d9ed2e 100644
--- a/incubator/rpc-grpc/src/main/proto/Port.proto
+++ b/incubator/rpc-grpc/src/main/proto/Port.proto
@@ -1,5 +1,5 @@
syntax = "proto3";
-option java_package = "org.onosproject.grpc";
+option java_package = "org.onosproject.grpc.net";
package Port;
@@ -22,7 +22,6 @@
VIRTUAL = 6;
}
-// TODO What are we going to do with more specific PortDescription ...
message PortDescription {
// PortNumber as String PortNumber#toString
string port_number = 1;