VOL-717: Alarm Synchronization State Machine

Intial the codes for the Alarm synchronization state machine
which perform the getAllAlarms/getAllalarmsResponse/
getAllAlarmsNext and getAllAlarmNextResponse and provides
database to save related alarms AlarmDbExternal.

Change-Id: I2d4c6b1027a8bf466ed821adfc01e2721c5a4702
diff --git a/voltha/core/global_handler.py b/voltha/core/global_handler.py
index b0bcef9..aed018e 100644
--- a/voltha/core/global_handler.py
+++ b/voltha/core/global_handler.py
@@ -46,6 +46,7 @@
     MulticastGemportsConfigData
 from voltha.protos.bbf_fiber_multicast_distribution_set_body_pb2 import \
     MulticastDistributionSetData
+from voltha.protos.omci_alarm_db_pb2 import AlarmDeviceData
 
 log = structlog.get_logger()
 
@@ -1759,3 +1760,21 @@
         else:
             log.debug('grpc-success-response', response=response)
             returnValue(response)
+
+    @twisted_async
+    @inlineCallbacks
+    def GetAlarmDeviceData(self, request, context):
+        log.info('grpc-request', request=request)
+        response = yield self.dispatcher.dispatch('GetAlarmDeviceData',
+                                                  request,
+                                                  context,
+                                                  id=request.id)
+        log.debug('grpc-response', response=response)
+        if isinstance(response, DispatchError):
+            log.warn('grpc-error-response', error=response.error_code)
+            context.set_details('Device \'{}\' error'.format(request.id))
+            context.set_code(response.error_code)
+            returnValue(AlarmDeviceData())
+        else:
+            log.debug('grpc-success-response', response=response)
+            returnValue(response)
\ No newline at end of file