def check_data_exists_or_not_alert(self):
        """Check_data_exists_or_not is to check if the data is exists or not using the timestamp file."""
        __method_name = inspect.currentframe().f_code.co_name
        try:
            parameter_alert = {
                "orderBy": "time",
                "fields": ",".join(consts.ALERT_FIELDS),
            }
            last_time_alerts = self.state_manager_obj.get()
            checkpoint_table = ExportsTableStore(
                connection_string=consts.CONNECTION_STRING, table_name=consts.CHECKPOINT_TABLE_NAME
            )

            if last_time_alerts is not None:
                logging.info(
                    consts.LOG_FORMAT.format(
                        __method_name, "The checkpoint file is available for alerts. time: {}.".format(last_time_alerts)
                    )
                )
                checkpoint_table.create()
                checkpoint_table.merge(
                    "armisalertactivity", "alertactivitycheckpoint", {"time": last_time_alerts, "offset": 0}
                )
                self.state_manager_obj.delete()
                logging.info(consts.LOG_FORMAT.format(__method_name, "checkpoint file deleted from fileshare."))
                self.fetch_alert_data(
                    parameter_alert,
                    False,
                    checkpoint_table,
                    last_time_alerts,
                )
                return
            record = checkpoint_table.get("armisalertactivity", "alertactivitycheckpoint")
            fetch_data_from_scratch = False
            if not record:
                checkpoint_table.create()
                checkpoint_table.post("armisalertactivity", "alertactivitycheckpoint", {"offset": 0})
                fetch_data_from_scratch = True
            else:
                logging.info(consts.LOG_FORMAT.format(__method_name, "Fetching Entity from checkpoint table"))
                last_time_alerts = record.get("time")
                self.data_alert_from = record.get("offset") if record.get("offset") else 0
                logging.info(
                    consts.LOG_FORMAT.format(
                        __method_name,
                        "Checkpoint table: Last timestamp: {}, Offset: {}".format(
                            last_time_alerts, self.data_alert_from
                        ),
                    )
                )
                if last_time_alerts is None:
                    logging.info(
                        consts.LOG_FORMAT.format(
                            __method_name, "time value not available in checkpoint table. Setting time as None."
                        )
                    )
                    fetch_data_from_scratch = True
            self.fetch_alert_data(
                parameter_alert,
                fetch_data_from_scratch,
                checkpoint_table,
                last_time_alerts,
            )
            logging.info(
                consts.LOG_FORMAT.format(
                    __method_name,
                    "Total Posted alerts {}, Total Posted activities : {}.".format(
                        self.total_alerts_posted,
                        self.total_activities_posted,
                    ),
                )
            )
        except ArmisException:
            raise ArmisException()

        except ArmisTimeOutException:
            logging.error(
                consts.LOG_FORMAT.format(
                    __method_name, "9:30 mins executed hence stopping the execution"
                )
            )
            return

        except ArmisDataNotFoundException:
            raise ArmisDataNotFoundException()

        except Exception as err:
            logging.error(
                consts.LOG_FORMAT.format(
                    __method_name, "Error occurred during checking whether checkpoint exist or not : {}.".format(err)
                )
            )
            raise ArmisException()
Check_data_exists_or_not is to check if the data is exists or not using the timestamp file.
Solutions/Armis/Data Connectors/ArmisAlertsActivities/ArmisAlertActivitySentinelConnector/__init__.py