Loading pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ <groupId>es.redmic.lib</groupId> <artifactId>broker-lib</artifactId> <packaging>jar</packaging> <version>0.9.0</version> <version>0.9.0-feature-slackIntegration</version> <name>broker-lib</name> <properties> Loading src/main/java/es/redmic/brokerlib/alert/AlertType.java +2 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ public enum AlertType { // @formatter:off ERROR, WARN, INFO INFO, NIFI_ACTIVITY_MONITOR // @formatter:on } src/main/java/es/redmic/brokerlib/alert/AlertUtil.java 0 → 100644 +28 −0 Original line number Diff line number Diff line package es.redmic.brokerlib.alert; /*- * #%L * broker-lib * %% * Copyright (C) 2019 REDMIC Project / Server * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ public class AlertUtil { public static boolean isRealTimeType(String type) { return type.equals(AlertType.NIFI_ACTIVITY_MONITOR.name()); } } src/main/java/es/redmic/brokerlib/alert/Message.java +9 −5 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public class Message extends SpecificRecordBase implements SpecificRecord { public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser() .parse("{\"type\":\"record\",\"name\":\"Message\",\"namespace\":\"es.redmic.brokerlib.alert\"," + "\"fields\":[" + "{\"name\":\"to\",\"type\": \"string\"}," + "{\"name\":\"to\",\"type\": [\"string\", \"null\"]}," + "{\"name\":\"subject\",\"type\": \"string\"}," + "{\"name\":\"message\",\"type\":\"string\"}," + "{\"name\":\"type\",\"type\":\"string\"}]}"); Loading @@ -49,11 +49,15 @@ public class Message extends SpecificRecordBase implements SpecificRecord { } public Message(String to, String subject, String message, String type) { assert to != null; this(subject, message, type); this.to = to; } public Message(String subject, String message, String type) { assert subject != null; assert message != null; assert type != null; this.to = to; this.subject = subject; this.message = message; this.type = type; Loading Loading @@ -100,7 +104,7 @@ public class Message extends SpecificRecordBase implements SpecificRecord { public java.lang.Object get(int field$) { switch (field$) { case 0: return to.toString(); return to != null ? to.toString() : null; case 1: return subject.toString(); case 2: Loading @@ -117,7 +121,7 @@ public class Message extends SpecificRecordBase implements SpecificRecord { public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: to = value$.toString(); to = value$ != null ? value$.toString() : null; break; case 1: subject = value$.toString(); Loading Loading
pom.xml +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ <groupId>es.redmic.lib</groupId> <artifactId>broker-lib</artifactId> <packaging>jar</packaging> <version>0.9.0</version> <version>0.9.0-feature-slackIntegration</version> <name>broker-lib</name> <properties> Loading
src/main/java/es/redmic/brokerlib/alert/AlertType.java +2 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ public enum AlertType { // @formatter:off ERROR, WARN, INFO INFO, NIFI_ACTIVITY_MONITOR // @formatter:on }
src/main/java/es/redmic/brokerlib/alert/AlertUtil.java 0 → 100644 +28 −0 Original line number Diff line number Diff line package es.redmic.brokerlib.alert; /*- * #%L * broker-lib * %% * Copyright (C) 2019 REDMIC Project / Server * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ public class AlertUtil { public static boolean isRealTimeType(String type) { return type.equals(AlertType.NIFI_ACTIVITY_MONITOR.name()); } }
src/main/java/es/redmic/brokerlib/alert/Message.java +9 −5 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public class Message extends SpecificRecordBase implements SpecificRecord { public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser() .parse("{\"type\":\"record\",\"name\":\"Message\",\"namespace\":\"es.redmic.brokerlib.alert\"," + "\"fields\":[" + "{\"name\":\"to\",\"type\": \"string\"}," + "{\"name\":\"to\",\"type\": [\"string\", \"null\"]}," + "{\"name\":\"subject\",\"type\": \"string\"}," + "{\"name\":\"message\",\"type\":\"string\"}," + "{\"name\":\"type\",\"type\":\"string\"}]}"); Loading @@ -49,11 +49,15 @@ public class Message extends SpecificRecordBase implements SpecificRecord { } public Message(String to, String subject, String message, String type) { assert to != null; this(subject, message, type); this.to = to; } public Message(String subject, String message, String type) { assert subject != null; assert message != null; assert type != null; this.to = to; this.subject = subject; this.message = message; this.type = type; Loading Loading @@ -100,7 +104,7 @@ public class Message extends SpecificRecordBase implements SpecificRecord { public java.lang.Object get(int field$) { switch (field$) { case 0: return to.toString(); return to != null ? to.toString() : null; case 1: return subject.toString(); case 2: Loading @@ -117,7 +121,7 @@ public class Message extends SpecificRecordBase implements SpecificRecord { public void put(int field$, java.lang.Object value$) { switch (field$) { case 0: to = value$.toString(); to = value$ != null ? value$.toString() : null; break; case 1: subject = value$.toString(); Loading