--- /dev/null
+/**\r
+ * Copyright 2017-2022 ZTE Corporation.\r
+ * <p>\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * <p>\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ * <p>\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.onap.holmes.engine.db.jdbi;\r
+\r
+import org.jdbi.v3.sqlobject.config.RegisterRowMapper;\r
+import org.jdbi.v3.sqlobject.customizer.Bind;\r
+import org.jdbi.v3.sqlobject.customizer.BindBean;\r
+import org.jdbi.v3.sqlobject.statement.GetGeneratedKeys;\r
+import org.jdbi.v3.sqlobject.statement.SqlQuery;\r
+import org.jdbi.v3.sqlobject.statement.SqlUpdate;\r
+import org.onap.holmes.common.api.entity.AlarmInfo;\r
+import org.onap.holmes.common.utils.AlarmInfoMapper;\r
+\r
+import java.util.List;\r
+\r
+@RegisterRowMapper(AlarmInfoMapper.class)\r
+public interface AlarmInfoDao {\r
+\r
+ @GetGeneratedKeys\r
+ @SqlUpdate("INSERT INTO ALARM_INFO (EVENTID,EVENTNAME,STARTEPOCHMICROSEC,SOURCEID,SOURCENAME,SEQUENCE,ALARMISCLEARED,ROOTFLAG,LASTEPOCHMICROSEC) VALUES (:eventId,:eventName,:startEpochMicroSec,:sourceId,:sourceName,:sequence,:alarmIsCleared,:rootFlag,:lastEpochMicroSec)")\r
+ String addAlarm(@BindBean AlarmInfo alarmInfo);\r
+\r
+ @SqlQuery("SELECT * FROM ALARM_INFO")\r
+ List<AlarmInfo> queryAlarm();\r
+\r
+ @SqlUpdate("DELETE FROM ALARM_INFO WHERE EVENTNAME=:eventName AND SOURCEID=:sourceId AND SOURCENAME=:sourceName")\r
+ int deleteAlarmByAlarmIsCleared(@Bind("eventName") String eventName,\r
+ @Bind("sourceId") String sourceId,\r
+ @Bind("sourceName") String sourceName);\r
+}\r