[VOL-2833] Adding adapter type in order to allow ID uniqueness

Change-Id: Iefc506d5959f5a1d92bd10e3cb77d75e5940a8f8
diff --git a/VERSION b/VERSION
index 6d7d659..15a2799 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.3.0-dev
+3.3.0
diff --git a/go/voltha/adapter.pb.go b/go/voltha/adapter.pb.go
index 3249b59..9359dc1 100644
--- a/go/voltha/adapter.pb.go
+++ b/go/voltha/adapter.pb.go
@@ -65,8 +65,8 @@
 
 // Adapter (software plugin)
 type Adapter struct {
-	// Unique name of adapter, matching the python package name under
-	// voltha/adapters.
+	// the adapter ID has to be unique,
+	// it will be generated as Type + CurrentReplica
 	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
 	Vendor  string `protobuf:"bytes,2,opt,name=vendor,proto3" json:"vendor,omitempty"`
 	Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
@@ -76,13 +76,16 @@
 	AdditionalDescription *any.Any `protobuf:"bytes,64,opt,name=additional_description,json=additionalDescription,proto3" json:"additional_description,omitempty"`
 	LogicalDeviceIds      []string `protobuf:"bytes,4,rep,name=logical_device_ids,json=logicalDeviceIds,proto3" json:"logical_device_ids,omitempty"`
 	// timestamp when the adapter last sent a message to the core
-	LastCommunication    *timestamp.Timestamp `protobuf:"bytes,5,opt,name=last_communication,json=lastCommunication,proto3" json:"last_communication,omitempty"`
-	CurrentReplica       int32                `protobuf:"varint,6,opt,name=currentReplica,proto3" json:"currentReplica,omitempty"`
-	TotalReplicas        int32                `protobuf:"varint,7,opt,name=totalReplicas,proto3" json:"totalReplicas,omitempty"`
-	Endpoint             string               `protobuf:"bytes,8,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
-	XXX_unrecognized     []byte               `json:"-"`
-	XXX_sizecache        int32                `json:"-"`
+	LastCommunication *timestamp.Timestamp `protobuf:"bytes,5,opt,name=last_communication,json=lastCommunication,proto3" json:"last_communication,omitempty"`
+	CurrentReplica    int32                `protobuf:"varint,6,opt,name=currentReplica,proto3" json:"currentReplica,omitempty"`
+	TotalReplicas     int32                `protobuf:"varint,7,opt,name=totalReplicas,proto3" json:"totalReplicas,omitempty"`
+	Endpoint          string               `protobuf:"bytes,8,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
+	// all replicas of the same adapter will have the same type
+	// it is used to associate a device to an adapter
+	Type                 string   `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
 }
 
 func (m *Adapter) Reset()         { *m = Adapter{} }
@@ -180,6 +183,13 @@
 	return ""
 }
 
+func (m *Adapter) GetType() string {
+	if m != nil {
+		return m.Type
+	}
+	return ""
+}
+
 type Adapters struct {
 	Items                []*Adapter `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
 	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
@@ -228,34 +238,34 @@
 func init() { proto.RegisterFile("voltha_protos/adapter.proto", fileDescriptor_7e998ce153307274) }
 
 var fileDescriptor_7e998ce153307274 = []byte{
-	// 450 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xcd, 0x6e, 0xd3, 0x30,
-	0x1c, 0x57, 0x56, 0x9a, 0x76, 0x9e, 0x0a, 0x9d, 0xa1, 0xc8, 0x04, 0x4d, 0x8b, 0x2a, 0x40, 0x39,
-	0xb0, 0x44, 0x6c, 0x2f, 0x40, 0xbb, 0x5d, 0x76, 0xb5, 0x26, 0x0e, 0x5c, 0x2a, 0xd7, 0xf6, 0x32,
-	0x4b, 0x89, 0xff, 0x51, 0xec, 0x46, 0xda, 0x0b, 0x72, 0xe3, 0x3d, 0x78, 0x02, 0xce, 0xa8, 0xb6,
-	0x43, 0x3f,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 0xa6, 0x28, 0x21, 0x60,
-	0xeb, 0xd8, 0x81, 0x37, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xe4, 0x94, 0x8c, 0x45, 0x03,
-	0x00, 0x00,
+	// 463 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xdd, 0x6e, 0xd3, 0x30,
+	0x14, 0x56, 0xda, 0x35, 0x6d, 0x3d, 0x15, 0x3a, 0x43, 0x91, 0x09, 0x9a, 0x16, 0x55, 0x80, 0x72,
+	0xc1, 0x12, 0xb1, 0xbd, 0x00, 0xed, 0x76, 0xb3, 0x5b, 0x6b, 0xe2, 0x82, 0x9b, 0xca, 0xb5, 0xbd,
+	0xcc, 0x52, 0xe2, 0x13, 0xc5, 0x6e, 0xa4, 0x3e, 0x24, 0x2f, 0xc0, 0x13, 0xf0, 0x04, 0x5c, 0xa3,
+	0x3a, 0x0e, 0xfd, 0x41, 0xda, 0x55, 0x72, 0xbe, 0xef, 0x3b, 0xdf, 0xf9, 0x33, 0xfa, 0xd0, 0x40,
+	0x61, 0x9f, 0xd9, 0xaa, 0xaa, 0xc1, 0x82, 0xc9, 0x98, 0x60, 0x95, 0x95, 0x75, 0xea, 0x42, 0x1c,
+	0xb6, 0x64, 0xf4, 0x3e, 0x07, 0xc8, 0x0b, 0x99, 0x39, 0x74, 0xbd, 0x79, 0xca, 0x98, 0xde, 0xb6,
+	0x92, 0x28, 0x3a, 0xce, 0xe7, 0x50, 0x96, 0xa0, 0x3d, 0x47, 0x8e, 0xb9, 0x52, 0x5a, 0xe6, 0x99,
+	0xab, 0x53, 0x43, 0xab, 0x4a, 0x69, 0x2c, 0x2b, 0xab, 0x56, 0x30, 0xa7, 0x68, 0xb2, 0x68, 0x5b,
+	0xb9, 0x03, 0xfd, 0xa4, 0x72, 0xbc, 0x40, 0x17, 0x4c, 0x08, 0x65, 0x15, 0x68,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, 0x1c, 0x24, 0x03, 0x7a, 0x82, 0xe2, 0x8f, 0x68, 0x62, 0xc1, 0xb2, 0xc2, 0xc7, 0x86, 0x0c,
+	0x9d, 0xec, 0x18, 0xc4, 0x11, 0x1a, 0x49, 0x2d, 0x2a, 0x50, 0xda, 0x92, 0xd1, 0x6e, 0xd7, 0xf4,
+	0x5f, 0x8c, 0x31, 0x3a, 0xb3, 0xdb, 0x4a, 0x92, 0xb1, 0xc3, 0xdd, 0xff, 0xfc, 0x2b, 0x1a, 0xf9,
+	0x1d, 0x1b, 0xfc, 0x09, 0x0d, 0x94, 0x95, 0xa5, 0x21, 0x41, 0xdc, 0x4f, 0xce, 0x6f, 0x5e, 0x9f,
+	0x1c, 0x81, 0xb6, 0xec, 0xf2, 0x11, 0xbd, 0x81, 0x3a, 0x4f, 0xa1, 0x92, 0x9a, 0x43, 0x2d, 0xbc,
+	0x6a, 0x39, 0xf9, 0xee, 0xbe, 0x5e, 0xfc, 0x23, 0xcd, 0x95, 0x7d, 0xde, 0xac, 0x53, 0x0e, 0x65,
+	0xd6, 0x49, 0xb3, 0x56, 0x7a, 0xed, 0x1f, 0x76, 0x73, 0x9b, 0xe5, 0xe0, 0xb1, 0x75, 0xe8, 0xc0,
+	0xdb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xef, 0x64, 0x5e, 0x10, 0x59, 0x03, 0x00, 0x00,
 }
diff --git a/protos/voltha_protos/adapter.proto b/protos/voltha_protos/adapter.proto
index c0e83b2..5580784 100644
--- a/protos/voltha_protos/adapter.proto
+++ b/protos/voltha_protos/adapter.proto
@@ -22,8 +22,8 @@
 // Adapter (software plugin)
 message Adapter {
 
-    // Unique name of adapter, matching the python package name under
-    // voltha/adapters.
+    // the adapter ID has to be unique,
+    // it will be generated as Type + CurrentReplica
     string id = 1 [(access) = READ_ONLY];
     string vendor = 2 [(access) = READ_ONLY];
     string version = 3 [(access) = READ_ONLY];
@@ -42,6 +42,10 @@
     int32 currentReplica = 6;
     int32 totalReplicas = 7;
     string endpoint = 8;
+    // all replicas of the same adapter will have the same type
+    // it is used to associate a device to an adapter
+    string type = 9;
+
 }
 
 message Adapters {
diff --git a/voltha.pb b/voltha.pb
index a38229b..11bfd40 100644
--- a/voltha.pb
+++ b/voltha.pb
Binary files differ