Fix delete cannot class And modify exception
authorFengLiang <feng.liang1@zte.com.cn>
Fri, 24 Feb 2017 07:55:40 +0000 (15:55 +0800)
committerFengLiang <feng.liang1@zte.com.cn>
Fri, 24 Feb 2017 07:55:40 +0000 (15:55 +0800)
Change-Id: I5d73bf2eefd395a71f2f612bd0f2d29fcdd395b3
Issue-ID:HOLMES-37
Signed-off-by: FengLiang <feng.liang1@zte.com.cn>
15 files changed:
holmes-actions/src/main/java/org/openo/holmes/common/api/AlarmsCorrelationDbService.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/api/AlarmsCorrelationMqService.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/api/entity/AlarmsCorrelationFilter.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/config/MQConfig.java
holmes-actions/src/main/java/org/openo/holmes/common/constant/MicroServiceConst.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/db/AlarmCorrelationQueryDao.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/db/AlarmsCorrelationDao.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/db/mapper/AlarmsCorrelationMapper.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/exception/CorrelationException.java
holmes-actions/src/main/java/org/openo/holmes/common/exception/DbException.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/exception/EngineException.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/exception/RuleIllegalityException.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-operationcode-i18n-en-US.json [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-operationcode-i18n-zh-CN.json [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/utils/DateForJsonSerializer.java [deleted file]

diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/api/AlarmsCorrelationDbService.java b/holmes-actions/src/main/java/org/openo/holmes/common/api/AlarmsCorrelationDbService.java
deleted file mode 100644 (file)
index 4057c03..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.api;\r
-\r
-import java.util.List;\r
-import org.jvnet.hk2.annotations.Contract;\r
-import org.openo.holmes.common.api.entity.AlarmsCorrelation;\r
-import org.openo.holmes.common.api.entity.AlarmsCorrelationFilter;\r
-import org.openo.holmes.common.exception.DbException;\r
-\r
-@Contract\r
-public interface AlarmsCorrelationDbService {\r
-\r
-    public void saveAlarmsCorrelation(AlarmsCorrelation alarmsCorrelation) throws DbException;\r
-\r
-    public List<AlarmsCorrelation> queryAlarmsCorrelationByFilter(\r
-        AlarmsCorrelationFilter alarmsCorrelationFilter) throws DbException;\r
-\r
-    public List<AlarmsCorrelation> queryAllAlarmsCorrelation();\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/api/AlarmsCorrelationMqService.java b/holmes-actions/src/main/java/org/openo/holmes/common/api/AlarmsCorrelationMqService.java
deleted file mode 100644 (file)
index 8d34e3e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.api;\r
-\r
-import org.jvnet.hk2.annotations.Contract;\r
-import org.openo.holmes.common.api.stat.Alarm;\r
-\r
-@Contract\r
-public interface AlarmsCorrelationMqService {\r
-\r
-    public static final String MQ_TOPIC_NAME_ALARMS_CORRELATION =\r
-        "topic://voss/fm/alarms_correlation";\r
-\r
-    public static final String MQ_QUEUE_NAME_ALARMS_CORRELATION =\r
-        "queue://voss/fm/alarms_correlation";\r
-\r
-    public static final String MQ_TOPIC_NAME_ALARM = "topic://voss/fm/alarm";\r
-\r
-    public boolean sendMQTopicMsg(String ruleId, long createTimeL, Alarm parentAlarm,\r
-        Alarm childAlarm);\r
-\r
-    public boolean sendMQTopicMsg(Alarm alarm);\r
-\r
-    public boolean sendMQQueueMsg(String ruleId, long createTimeL, Alarm parentAlarm,\r
-        Alarm childAlarm);\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/api/entity/AlarmsCorrelationFilter.java b/holmes-actions/src/main/java/org/openo/holmes/common/api/entity/AlarmsCorrelationFilter.java
deleted file mode 100644 (file)
index bdbc02c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.api.entity;\r
-\r
-import com.fasterxml.jackson.annotation.JsonProperty;\r
-\r
-import lombok.Data;\r
-import lombok.NoArgsConstructor;\r
-\r
-@Data\r
-@NoArgsConstructor\r
-public class AlarmsCorrelationFilter {\r
-\r
-  @JsonProperty(value = "ruleid")\r
-  private String ruleId;\r
-\r
-  @JsonProperty(value = "parentalarmid")\r
-  private long parentAlarmId;\r
-\r
-  @JsonProperty(value = "childalarmid")\r
-  private long childAlarmId;\r
-\r
-  @JsonProperty(value = "where")\r
-  private String where;\r
-}\r
index d225dae..6553998 100644 (file)
@@ -25,54 +25,15 @@ public class MQConfig {
 
     @JsonProperty
     @NotNull
-    public String brokerIp = "localhost";
+    public String brokerIp;
 
     @JsonProperty
     @NotNull
-    public int brokerPort = 5672;
-
+    public int brokerPort;
 
     @JsonProperty
     public String brokerUsername;
 
     @JsonProperty
     public String brokerPassword;
-
-    @JsonProperty
-    public boolean autoDiscover = false;
-
-    @JsonProperty
-    public String mqServiceName = "mqService";
-
-    @JsonProperty
-    public String mqServiceVersion = "v1";
-
-
-    @JsonProperty
-    public long healthCheckMillisecondsToWait = 2000; // 2 seconds
-
-    @JsonProperty
-    public int shutdownWaitInSeconds = 20;
-
-    @JsonProperty
-    public int timeToLiveInSeconds = -1; // Default no TTL. Jackson does not support java.util.Optional yet.
-
-    @JsonProperty
-    public Map<String, String> extConsumerConfMap = new HashMap<>();
-
-    @JsonProperty
-    public Map<String, String> extProducerConfMap = new HashMap<>();
-
-
-    @Override
-    public String toString() {
-        return "MQConfig [brokerIp=" + brokerIp + ", brokerPort=" + brokerPort + ", brokerUsername="
-            + brokerUsername + ", brokerPassword=" + brokerPassword + ", autoDiscover="
-            + autoDiscover + ", mqServiceName=" + mqServiceName + ", mqServiceVersion="
-            + mqServiceVersion + ", healthCheckMillisecondsToWait=" + healthCheckMillisecondsToWait
-            + ", shutdownWaitInSeconds=" + shutdownWaitInSeconds + ", timeToLiveInSeconds="
-            + timeToLiveInSeconds + "]";
-    }
-
-
 }
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/constant/MicroServiceConst.java b/holmes-actions/src/main/java/org/openo/holmes/common/constant/MicroServiceConst.java
deleted file mode 100644 (file)
index c0f5d5e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.constant;\r
-\r
-public interface MicroServiceConst {\r
-\r
-    public static final String CORRELATION_ENGINE = "correlation-engine";\r
-\r
-    public static final String VERSION = "v1";\r
-\r
-    public static final String ENGINE_PATH = "/api/correlation-engine/v1/rule";\r
-\r
-    public static final String CORRELATION_ENGINE_SERVICE_NAME = CORRELATION_ENGINE;\r
-\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/db/AlarmCorrelationQueryDao.java b/holmes-actions/src/main/java/org/openo/holmes/common/db/AlarmCorrelationQueryDao.java
deleted file mode 100644 (file)
index 3e8bfc8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.db;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import javax.inject.Inject;\r
-\r
-import org.jvnet.hk2.annotations.Service;\r
-import org.openo.holmes.common.api.entity.AlarmsCorrelation;\r
-import org.skife.jdbi.v2.Query;\r
-\r
-import org.openo.holmes.common.db.mapper.AlarmsCorrelationMapper;\r
-import org.openo.holmes.common.utils.DbDaoUtil;\r
-\r
-import lombok.extern.slf4j.Slf4j;\r
-\r
-@Service\r
-@Slf4j\r
-public class AlarmCorrelationQueryDao {\r
-\r
-  @Inject\r
-  private DbDaoUtil dbDaoUtil;\r
-\r
-  @Inject\r
-  private AlarmsCorrelationMapper mapper;\r
-\r
-  private final static String SELECT_TABLE_SQL = "SELECT * FROM APLUS_CORRELATION ";\r
-\r
-  public List<AlarmsCorrelation> queryByFilter(String where) {\r
-    List<AlarmsCorrelation> alarmsCorrelations = new ArrayList<AlarmsCorrelation>();\r
-    StringBuilder querySql = new StringBuilder(SELECT_TABLE_SQL).append(where);\r
-    log.info("Query alarm correlation table! Sql:[" + querySql + "].");\r
-    Query<Map<String, Object>> query = dbDaoUtil.getHandle().createQuery(querySql.toString());\r
-    List<Map<String, Object>> dbDataMaps = query.list();\r
-    for (Map<String, Object> map : dbDataMaps) {\r
-      alarmsCorrelations.add(mapper.getAlarmCorrelationByMap(map));\r
-    }\r
-    log.info("Success to query alarm correlation table! total count:[" + dbDataMaps.size() + "].");\r
-    return alarmsCorrelations;\r
-  }\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/db/AlarmsCorrelationDao.java b/holmes-actions/src/main/java/org/openo/holmes/common/db/AlarmsCorrelationDao.java
deleted file mode 100644 (file)
index 43c8bf2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.db;\r
-\r
-import java.util.List;\r
-\r
-import org.openo.holmes.common.api.entity.AlarmsCorrelation;\r
-import org.skife.jdbi.v2.sqlobject.BindBean;\r
-import org.skife.jdbi.v2.sqlobject.SqlQuery;\r
-import org.skife.jdbi.v2.sqlobject.SqlUpdate;\r
-import org.skife.jdbi.v2.sqlobject.customizers.RegisterMapper;\r
-\r
-import org.openo.holmes.common.db.mapper.AlarmsCorrelationMapper;\r
-\r
-@RegisterMapper(AlarmsCorrelationMapper.class)\r
-public interface AlarmsCorrelationDao {\r
-\r
-  @SqlUpdate("INSERT INTO APLUS_CORRELATION (ruleId,ruleInfo,resultType,createTime,parentAlarmId,childAlarmId,reserve1,reserve2,reserve3) values(:ruleId,:ruleInfo,:resultType,:createTime,:parentAlarmId,:childAlarmId,:reserve1,:reserve2,:reserve3)")\r
-  public abstract void save(@BindBean AlarmsCorrelation aplusCorrelation);\r
-\r
-  @SqlQuery("SELECT * FROM APLUS_CORRELATION")\r
-  public abstract List<AlarmsCorrelation> queryAll();\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/db/mapper/AlarmsCorrelationMapper.java b/holmes-actions/src/main/java/org/openo/holmes/common/db/mapper/AlarmsCorrelationMapper.java
deleted file mode 100644 (file)
index 2fc2968..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.db.mapper;\r
-\r
-import java.sql.ResultSet;\r
-import java.sql.SQLException;\r
-import java.util.Date;\r
-import java.util.Map;\r
-\r
-import org.jvnet.hk2.annotations.Service;\r
-import org.openo.holmes.common.api.entity.AlarmsCorrelation;\r
-import org.skife.jdbi.v2.StatementContext;\r
-import org.skife.jdbi.v2.tweak.ResultSetMapper;\r
-\r
-@Service\r
-public class AlarmsCorrelationMapper implements ResultSetMapper<AlarmsCorrelation> {\r
-\r
-  private final static String RULE_ID = "ruleId";\r
-  private final static String RULE_INFO = "ruleInfo";\r
-  private final static String RESULT_TYPE = "resultType";\r
-  private final static String CREATE_TIME = "createTime";\r
-  private final static String PARENT_ALARM_ID = "parentAlarmId";\r
-  private final static String CHILD_ALARM_ID = "childAlarmId";\r
-  private final static String RESERVE1 = "reserve1";\r
-  private final static String RESERVE2 = "reserve2";\r
-  private final static String RESERVE3 = "reserve3";\r
-\r
-  @Override\r
-  public AlarmsCorrelation map(int i, ResultSet resultSet, StatementContext statementContext)\r
-      throws SQLException {\r
-    AlarmsCorrelation aplusCorrelation = new AlarmsCorrelation();\r
-    aplusCorrelation.setRuleId(resultSet.getString(RULE_ID));\r
-    aplusCorrelation.setRuleInfo(resultSet.getString(RULE_INFO));\r
-    aplusCorrelation.setResultType(resultSet.getByte(RESULT_TYPE));\r
-    aplusCorrelation.setCreateTime(resultSet.getDate(CREATE_TIME));\r
-    aplusCorrelation.setParentAlarmId(resultSet.getLong(PARENT_ALARM_ID));\r
-    aplusCorrelation.setChildAlarmId(resultSet.getLong(CHILD_ALARM_ID));\r
-    aplusCorrelation.setReserve1(resultSet.getLong(RESERVE1));\r
-    aplusCorrelation.setReserve2(resultSet.getLong(RESERVE2));\r
-    aplusCorrelation.setReserve3(resultSet.getLong(RESERVE3));\r
-    return aplusCorrelation;\r
-  }\r
-\r
-  public AlarmsCorrelation getAlarmCorrelationByMap(Map<String, Object> map) {\r
-    AlarmsCorrelation aplusCorrelation = new AlarmsCorrelation();\r
-    aplusCorrelation.setRuleId(getStringValue4Map(map, RULE_ID));\r
-    aplusCorrelation.setRuleInfo(getStringValue4Map(map, RULE_INFO));\r
-    aplusCorrelation.setResultType(getByteValue4Map(map, RESULT_TYPE, -1));\r
-    aplusCorrelation.setCreateTime((Date) map.get(CREATE_TIME));\r
-    aplusCorrelation.setParentAlarmId(getLongValue4Map(map, PARENT_ALARM_ID, -1));\r
-    aplusCorrelation.setChildAlarmId(getLongValue4Map(map, CHILD_ALARM_ID, -1));\r
-    aplusCorrelation.setReserve1(getLongValue4Map(map, RESERVE1, -1));\r
-    aplusCorrelation.setReserve2(getLongValue4Map(map, RESERVE2, -1));\r
-    aplusCorrelation.setReserve3(getLongValue4Map(map, RESERVE3, -1));\r
-    return aplusCorrelation;\r
-  }\r
-\r
-  private String getStringValue4Map(Map<String, Object> map, String key) {\r
-    Object value = map.get(key);\r
-    return value == null ? "" : String.valueOf(value);\r
-  }\r
-\r
-  private long getLongValue4Map(Map<String, Object> map, String key, long defaultValue) {\r
-    Object value = map.get(key);\r
-    return value == null ? defaultValue : Long.valueOf(String.valueOf(value));\r
-  }\r
-\r
-  private byte getByteValue4Map(Map<String, Object> map, String key, int defaultValue) {\r
-    Object value = map.get(key);\r
-    return value == null ? Byte.valueOf(String.valueOf(defaultValue))\r
-        : Byte.valueOf(String.valueOf(value));\r
-  }\r
-}\r
index 4454cbb..dfe5373 100644 (file)
@@ -5,7 +5,7 @@
  * you may not use this file except in compliance with the License.\r
  * You may obtain a copy of the License at\r
  *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
  *\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
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/exception/DbException.java b/holmes-actions/src/main/java/org/openo/holmes/common/exception/DbException.java
deleted file mode 100644 (file)
index d616481..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.exception;\r
-\r
-public class DbException extends Exception {\r
-    private static final long serialVersionUID = 6218393740013925907L;\r
-\r
-    public DbException( String msg, Exception e ) {\r
-        super( msg, e );\r
-    }\r
-\r
-    public DbException( String msg ) {\r
-        super( msg );\r
-    }\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/exception/EngineException.java b/holmes-actions/src/main/java/org/openo/holmes/common/exception/EngineException.java
deleted file mode 100644 (file)
index d61901d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.exception;\r
-\r
-public class EngineException extends Exception{\r
-    public EngineException () {}\r
-\r
-    public EngineException(String msg) {\r
-        super(msg);\r
-    }\r
-\r
-    public EngineException(String msg, Throwable cause){\r
-        super(msg, cause);\r
-    }\r
-\r
-    public EngineException(Throwable cause){\r
-        super(cause);\r
-    }\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/exception/RuleIllegalityException.java b/holmes-actions/src/main/java/org/openo/holmes/common/exception/RuleIllegalityException.java
deleted file mode 100644 (file)
index 5b1d3bd..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.exception;\r
-\r
-public class RuleIllegalityException extends Exception{\r
-    public RuleIllegalityException() {}\r
-\r
-    public RuleIllegalityException(String msg) {\r
-        super(msg);\r
-    }\r
-\r
-    public RuleIllegalityException(String msg, Throwable cause){\r
-        super(msg, cause);\r
-    }\r
-\r
-    public RuleIllegalityException(Throwable cause){\r
-        super(cause);\r
-    }\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-operationcode-i18n-en-US.json b/holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-operationcode-i18n-en-US.json
deleted file mode 100644 (file)
index b7d4853..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-{ \r
-        "ADD_QUERY_COND":"Add active alarm query condition",\r
-        "MODIFY_QUERY_COND":"Modify active alarm query condition",\r
-        "QUERY_ALL_QUERY_COND":"Query all active alarm query conditions",\r
-        "DELETE_QUERY_COND":"Delete active alarm query condition",\r
-        "ADD_ALARM_ACK_RULE":"Add active alarm acknowledge rule",\r
-        "MODIFY_ALARM_ACK_RULE":"Modify active alarm acknowledge rule",\r
-        "QUERY_ALARM_ACK_RULE":"Query active alarm acknowledge rule",\r
-        "ADD_FILTER_RULE":"Add alarm filter rule",\r
-        "MODIFY_FILTER_RULE":"Modify alarm filter rule",\r
-        "QUERY_FILTER_RULE":"Query alarm filter rule",\r
-        "ADD_MASK_RULE":"Add mask rule",\r
-        "MODIFY_MASK_RULE":"Modify mask rule",\r
-        "ADD_CLEAR_RULE":"Add clear rule",\r
-        "MODIFY_CLEAR_RULE":"Modify clear rule",\r
-        "QUERY_CLEAR_RULE":"Query clear rule",\r
-        "ADD_COUNT_RULE":"Add count rule",\r
-        "MODIFY_COUNT_RULE":"Modify count rule",\r
-        "QUERY_COUNT_RULE":"Query count rule",\r
-        "ADD_DELAY_TIME_RULE":"Add delay time rule",\r
-        "MODIFY_DELAY_TIME_RULE":"Modify delay time rule",\r
-        "QUERY_DELAY_TIME_RULE":"Query delay time rule",\r
-        "ADD_FORWARD_RULE":"Add forward rule",\r
-        "MODIFY_FORWARD_RULE":"Modify forward rule",\r
-        "QUERY_FORWARD_RULE":"Query forward rule",\r
-        "ADD_INTERMITTENT_ALARM_RULE":"Add intermittent alarm rule",\r
-        "MODIFY_INTERMITTENT_ALARM_RULE":"Modify intermittent alarm rule",\r
-        "ADD_MERGE_RULE":"Add merge rule",\r
-        "MODIFY_MERGE_RULE":"Modify merge rule",\r
-        "QUERY_MERGE_RULE":"Query merge rule",\r
-        "ADD_NOTIFICATION_FILTER_RULE":"Add notification filter rule",\r
-        "MODIFY_NOTIFICATION_FILTER_RULE":"Modify notification filter rule",\r
-        "QUERY_NOTIFICATION_FILTER_RULE":"Query notification filter rule",\r
-        "ADD_PERSISTING_RULE":"Add persisting rule",\r
-        "MODIFY_PERSISTING_RULE":"Modify persisting rule",\r
-        "QUERY_PERSISTING_RULE":"Query persisting rule",\r
-        "ADD_PROMPTING_RULE":"Add prompting rule",\r
-        "MODIFY_PROMPTING_RULE":"Modify persisting rule",\r
-        "QUERY_PROMPTING_RULE":"Query persisting rule",\r
-        "SUSPEND_RULE":"Suspend rule",\r
-        "SUSPEND_RULE_FAIL":"Suspend rule failed",\r
-        "ACTIVATE_RULE":"Activate rule",\r
-        "ACTIVATE_RULE_FAIL":"activate rule failed",\r
-        "DELETED_RULE":"Deleted rule",\r
-        "DELETE_RULE_FAIL":"delete rule failed",\r
-        "QUERY_RULE_TYPE":"Query rule type",\r
-        "QUERY_RULE_TYPE_FAIL":"Query rule type failed",\r
-        "QUERY_RULE_BY_TYPE":"Query all rule by rule types",\r
-        "QUERY_TIMING_REPORT_RULE":"Query timing report rule",\r
-        "ADD_TIMING_REPORT_RULE":"Add timing report rule",\r
-        "MODIFY_TIMING_REPORT_RULE":"Modify timing report rule",\r
-        "QUERY_TIMING_REPORT_TASK_LOG":"Query timing report task execute log",\r
-        "DELETED_TIMING_REPORT_RULE":"Deleted timing report rule",\r
-        "DELETED_TIMING_REPORT_RULE_FAIL":"Deleted timing report rule failed",\r
-        "ACTIVATE_TIMING_REPORT_RULE":"Activate timing report rule",\r
-        "ACTIVATE_TIMING_REPORT_RULE_FAIL":"Activate timing report rule failed",\r
-        "SUSPEND_TIMING_REPORT_RULE":"Suspend timing report rule",\r
-     "SUSPEND_TIMING_REPORT_RULE_FAIL":"Suspend timing report rule failed",\r
-     "QUERY_HISTORY_TIMING_REPORT_RULE":"Query history timing report rule",\r
-     "ADD_HISTORY_TIMING_REPORT_RULE":"Add history timing report rule",\r
-     "MODIFY_HISTORY_TIMING_REPORT_RULE":"Modify history timing report rule",\r
-     "DELETED_HISTORY_TIMING_REPORT_RULE":"Deleted history timing report rule",\r
-     "DELETED_HISTORY_TIMING_REPORT_RULE_FAIL":"Deleted history timing report rule failed",\r
-     "ACTIVATE_HISTORY_TIMING_REPORT_RULE":"Activate history timing report rule",\r
-     "ACTIVATE_HISTORY_TIMING_REPORT_RULE_FAIL":"Activate history timing report rule failed",\r
-     "SUSPEND_HISTORY_TIMING_REPORT_RULE":"Suspend history timing report rule",\r
-     "SUSPEND_HISTORY_TIMING_REPORT_RULE_FAIL":"Suspend history timing report rule failed",\r
-     "QUERY_HISTORY_TIMING_REPORT_TASK_LOG":"Query history timing report task execution log",\r
-     "ADD_HISTORY_ALARM_QUERY_COND":"Add history alarm query condition",\r
-     "MODIFY_HISTORY_ALARM_QUERY_COND":"Modify history alarm query condition",\r
-     "QUERY_HISTORY_ALARM_QUERY_COND":"Query history alarm query condition",\r
-     "DELETED_HISTORY_ALARM_QUERY_COND":"Deleted history alarm query condition",\r
-     "ADD_NOTIFICATION_QUERY_COND":"Add notification query condition",\r
-     "MODIFY_NOTIFICATION_QUERY_COND":"Modify notification query condition",\r
-     "QUERY_NOTIFICATION_QUERY_COND":"Query notification query condition",\r
-     "DELETED_NOTIFICATION_QUERY_COND":"Deleted notification query condition",\r
-     "QUERY_BASIC_STATISTIC_TEMPLATE":"Query basic statistic template",\r
-     "ADD_BASIC_STATISTIC_TEMPLATE":"Add basic statistic template",\r
-     "MODIFY_BASIC_STATISTIC_TEMPLATE":"Modify basic statistic template",\r
-     "DELETED_BASIC_STATISTIC_TEMPLATE":"Deleted basic statistic template",\r
-     "MODIFY_BASIC_STATISTIC_TEMPLATE_AS_DEFAULT":"Modify basic statistic template as default template",\r
-     "QUERY_BUSY_TIME_STATISTIC_TEMPLATE":"Query busy time statistic template",\r
-     "ADD_BUSY_TIME_STATISTIC_TEMPLATE":"Add busy time statistic template",\r
-     "MODIFY_BUSY_TIME_STATISTIC_TEMPLATE":"Modify busy time statistic template",\r
-     "DELETED_BUSY_TIME_STATISTIC_TEMPLATE":"Deleted busy time statistic template",\r
-     "MODIFY_BUSY_TIME_STATISTIC_TEMPLATE_AS_DEFAULT":"Modify busy time statistic template as default template"\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-operationcode-i18n-zh-CN.json b/holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-operationcode-i18n-zh-CN.json
deleted file mode 100644 (file)
index 0509c3b..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-{\r
-     "ADD_QUERY_COND":"添加当前告警查询条件",\r
-     "MODIFY_QUERY_COND":"修改当前告警查询条件",\r
-     "QUERY_ALL_QUERY_COND":"查询所有当前告警查询条件",\r
-     "DELETE_QUERY_COND":"删除当前告警查询条件",\r
-     "ADD_ALARM_ACK_RULE":"添加当前告警确认规则",\r
-     "MODIFY_ALARM_ACK_RULE":"修改当前告警确认规则",\r
-     "QUERY_ALARM_ACK_RULE":"查询当前告警确认规则",\r
-     "ADD_FILTER_RULE":"添加告警过滤规则",\r
-     "MODIFY_FILTER_RULE":"修改告警过滤规则",\r
-     "QUERY_FILTER_RULE":"查询告警过滤规则",\r
-     "ADD_MASK_RULE":"添加屏蔽规则",\r
-     "MODIFY_MASK_RULE":"修改屏蔽规则",\r
-     "ADD_CLEAR_RULE":"添加清除规则",\r
-     "MODIFY_CLEAR_RULE":"修改清除规则",\r
-     "QUERY_CLEAR_RULE":"查询清除规则",\r
-     "ADD_COUNT_RULE":"添加计数规则",\r
-     "MODIFY_COUNT_RULE":"修改计数规则",\r
-     "QUERY_COUNT_RULE":"查询计数规则",\r
-     "ADD_DELAY_TIME_RULE":"添加延时规则",\r
-     "MODIFY_DELAY_TIME_RULE":"修改延时规则",\r
-     "QUERY_DELAY_TIME_RULE":"查询延时规则",\r
-     "ADD_FORWARD_RULE":"添加前转规则",\r
-     "MODIFY_FORWARD_RULE":"修改前转规则",\r
-     "QUERY_FORWARD_RULE":"查询前转规则",\r
-     "ADD_INTERMITTENT_ALARM_RULE":"添加闪断规则",\r
-     "MODIFY_INTERMITTENT_ALARM_RULE":"修改闪断规则",\r
-     "ADD_MERGE_RULE":"添加归并规则",\r
-     "MODIFY_MERGE_RULE":"修改归并规则",\r
-     "QUERY_MERGE_RULE":"查询归并规则",\r
-     "ADD_NOTIFICATION_FILTER_RULE":"添加通知过滤规则",\r
-     "MODIFY_NOTIFICATION_FILTER_RULE":"修改通知过滤规则",\r
-     "QUERY_NOTIFICATION_FILTER_RULE":"查询通知过滤规则",\r
-     "ADD_PERSISTING_RULE":"添加计时规则",\r
-     "MODIFY_PERSISTING_RULE":"修改计时规则",\r
-     "QUERY_PERSISTING_RULE":"查询计时规则",\r
-     "ADD_PROMPTING_RULE":"添加提示规则",\r
-     "MODIFY_PROMPTING_RULE":"修改提示规则",\r
-     "QUERY_PROMPTING_RULE":"查询提示规则",\r
-     "SUSPEND_RULE":"暂停规则",\r
-     "SUSPEND_RULE_FAIL":"暂停规则失败",\r
-     "ACTIVATE_RULE":"激活规则",\r
-     "ACTIVATE_RULE_FAIL":"激活规则失败",\r
-     "DELETED_RULE":"删除规则",\r
-     "DELETE_RULE_FAIL":"删除规则失败",\r
-     "QUERY_RULE_TYPE":"查询规则类型",\r
-     "QUERY_RULE_TYPE_FAIL":"查询规则类型失败",\r
-     "QUERY_RULE_BY_TYPE":"通过规则类型查询所有规则",\r
-     "QUERY_TIMING_REPORT_RULE":"查询定时输出规则",\r
-     "ADD_TIMING_REPORT_RULE":"添加定时输出规则",\r
-     "MODIFY_TIMING_REPORT_RULE":"修改定时输出规则",\r
-     "QUERY_TIMING_REPORT_TASK_LOG":"查询定时输出任务的执行日志",\r
-     "DELETED_TIMING_REPORT_RULE":"删除定时输出规则",\r
-     "DELETED_TIMING_REPORT_RULE_FAIL":"删除定时输出规则失败",\r
-     "ACTIVATE_TIMING_REPORT_RULE":"激活定时输出规则",\r
-     "ACTIVATE_TIMING_REPORT_RULE_FAIL":"激活定时输出规则失败",\r
-     "SUSPEND_TIMING_REPORT_RULE":"暂停定时输出规则",\r
-     "SUSPEND_TIMING_REPORT_RULE_FAIL":"暂停定时输出规则失败",\r
-     "QUERY_HISTORY_TIMING_REPORT_RULE":"查询历史定时输出规则",\r
-     "ADD_HISTORY_TIMING_REPORT_RULE":"添加历史定时输出规则",\r
-     "MODIFY_HISTORY_TIMING_REPORT_RULE":"修改历史定时输出规则",\r
-     "DELETED_HISTORY_TIMING_REPORT_RULE":"删除历史定时输出规则",\r
-     "DELETED_HISTORY_TIMING_REPORT_RULE_FAIL":"删除历史定时输出规则失败",\r
-     "ACTIVATE_HISTORY_TIMING_REPORT_RULE":"激活历史定时输出规则",\r
-     "ACTIVATE_HISTORY_TIMING_REPORT_RULE_FAIL":"激活历史定时输出规则失败",\r
-     "SUSPEND_HISTORY_TIMING_REPORT_RULE":"暂停历史定时输出规则",\r
-     "SUSPEND_HISTORY_TIMING_REPORT_RULE_FAIL":"暂停历史定时输出规则失败",\r
-     "QUERY_HISTORY_TIMING_REPORT_TASK_LOG":"查询历史定时输出任务的执行日志",\r
-     "ADD_HISTORY_ALARM_QUERY_COND":"添加历史告警查询条件",\r
-     "MODIFY_HISTORY_ALARM_QUERY_COND":"修改历史告警查询条件",\r
-     "QUERY_HISTORY_ALARM_QUERY_COND":"查询历史告警查询条件",\r
-     "DELETED_HISTORY_ALARM_QUERY_COND":"删除历史告警查询条件",\r
-     "ADD_NOTIFICATION_QUERY_COND":"添加通知查询条件",\r
-     "MODIFY_NOTIFICATION_QUERY_COND":"修改通知查询条件",\r
-     "QUERY_NOTIFICATION_QUERY_COND":"查询通知查询条件",\r
-     "DELETED_NOTIFICATION_QUERY_COND":"删除通知查询条件",\r
-     "QUERY_BASIC_STATISTIC_TEMPLATE":"查询基础统计模板",\r
-     "ADD_BASIC_STATISTIC_TEMPLATE":"添加基础统计模板",\r
-     "MODIFY_BASIC_STATISTIC_TEMPLATE":"修改基础统计模板",\r
-     "DELETED_BASIC_STATISTIC_TEMPLATE":"删除基础统计模板",\r
-     "MODIFY_BASIC_STATISTIC_TEMPLATE_AS_DEFAULT":"修改基础统计模板为默认模板",\r
-     "QUERY_BUSY_TIME_STATISTIC_TEMPLATE":"查询忙时统计模板",\r
-     "ADD_BUSY_TIME_STATISTIC_TEMPLATE":"添加忙时统计模板",\r
-     "MODIFY_BUSY_TIME_STATISTIC_TEMPLATE":"修改忙时统计模板",\r
-     "DELETED_BUSY_TIME_STATISTIC_TEMPLATE":"删除忙时统计模板",\r
-     "MODIFY_BUSY_TIME_STATISTIC_TEMPLATE_AS_DEFAULT":"修改忙时统计模板为默认模板"\r
-}\r
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/utils/DateForJsonSerializer.java b/holmes-actions/src/main/java/org/openo/holmes/common/utils/DateForJsonSerializer.java
deleted file mode 100644 (file)
index fe36d74..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\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
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\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.openo.holmes.common.utils;\r
-\r
-import com.fasterxml.jackson.core.JsonGenerator;\r
-import com.fasterxml.jackson.core.JsonProcessingException;\r
-import com.fasterxml.jackson.databind.JsonSerializer;\r
-import com.fasterxml.jackson.databind.SerializerProvider;\r
-\r
-import java.io.IOException;\r
-import java.text.SimpleDateFormat;\r
-import java.util.Date;\r
-\r
-public class DateForJsonSerializer extends JsonSerializer < Date > {\r
-    @Override\r
-    public void serialize( Date date, JsonGenerator jsonGenerator,\r
-                           SerializerProvider serializerProvider ) throws IOException, JsonProcessingException {\r
-        if ( date != null ) {\r
-            SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" );\r
-            String formattedDate = formatter.format( date );\r
-            jsonGenerator.writeString( formattedDate );\r
-        }\r
-    }\r
-}\r