def Process(self, fs_msg, context):
    """Processes a single fleetspeak message."""
    try:
      if fs_msg.message_type == "GrrMessage":
        grr_message = rdf_flows.GrrMessage.FromSerializedString(
            fs_msg.data.value)
        self._ProcessGRRMessages(fs_msg.source.client_id, [grr_message])
      elif fs_msg.message_type == "MessageList":
        packed_messages = rdf_flows.PackedMessageList.FromSerializedString(
            fs_msg.data.value)
        message_list = communicator.Communicator.DecompressMessageList(
            packed_messages)
        self._ProcessGRRMessages(fs_msg.source.client_id, message_list.job)
      else:
        logging.error("Received message with unrecognized message_type: %s",
                      fs_msg.message_type)
        context.set_code(grpc.StatusCode.INVALID_ARGUMENT)
    except Exception as e:
      logging.error("Exception processing message: %s", str(e))
      raise
def Process ( self , fs_msg , context ) : try : if fs_msg . message_type == "GrrMessage" : grr_message = rdf_flows . GrrMessage . FromSerializedString ( fs_msg . data . value ) self . _ProcessGRRMessages ( fs_msg . source . client_id , [ grr_message ] ) elif fs_msg . message_type == "MessageList" : packed_messages = rdf_flows . PackedMessageList . FromSerializedString ( fs_msg . data . value ) message_list = communicator . Communicator . DecompressMessageList ( packed_messages ) self . _ProcessGRRMessages ( fs_msg . source . client_id , message_list . job ) else : logging . error ( "Received message with unrecognized message_type: %s" , fs_msg . message_type ) context . set_code ( grpc . StatusCode . INVALID_ARGUMENT ) except Exception as e : logging . error ( "Exception processing message: %s" , str ( e ) ) raise
Processes a single fleetspeak message.