From 0cdde035bc99383f5385bf3a3251d7b487b87290 Mon Sep 17 00:00:00 2001 From: pankajjangid05 Date: Mon, 3 Apr 2023 19:30:16 +0530 Subject: [PATCH 1/7] Add toString method to XMsg to debug --- src/main/java/messagerosa/core/model/Address.java | 6 ++---- src/main/java/messagerosa/core/model/ButtonChoice.java | 1 + src/main/java/messagerosa/core/model/ContactCard.java | 6 ++---- .../java/messagerosa/core/model/ConversationStage.java | 1 + src/main/java/messagerosa/core/model/Data.java | 1 + src/main/java/messagerosa/core/model/LocationParams.java | 6 ++---- src/main/java/messagerosa/core/model/MessageId.java | 1 + src/main/java/messagerosa/core/model/MessageMedia.java | 6 ++---- .../java/messagerosa/core/model/SenderReceiverInfo.java | 7 ++----- src/main/java/messagerosa/core/model/Transformer.java | 1 + src/main/java/messagerosa/core/model/XMessage.java | 7 ++----- src/main/java/messagerosa/core/model/XMessagePayload.java | 7 ++----- src/main/java/messagerosa/core/model/XMessageThread.java | 1 + 13 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/main/java/messagerosa/core/model/Address.java b/src/main/java/messagerosa/core/model/Address.java index f0b6a23..b3bba12 100644 --- a/src/main/java/messagerosa/core/model/Address.java +++ b/src/main/java/messagerosa/core/model/Address.java @@ -1,14 +1,12 @@ package messagerosa.core.model; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; @Getter @Setter @NoArgsConstructor @AllArgsConstructor +@ToString public class Address { private String city; diff --git a/src/main/java/messagerosa/core/model/ButtonChoice.java b/src/main/java/messagerosa/core/model/ButtonChoice.java index e8ed955..63e9620 100644 --- a/src/main/java/messagerosa/core/model/ButtonChoice.java +++ b/src/main/java/messagerosa/core/model/ButtonChoice.java @@ -7,6 +7,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ToString public class ButtonChoice { private String key; private String text; diff --git a/src/main/java/messagerosa/core/model/ContactCard.java b/src/main/java/messagerosa/core/model/ContactCard.java index 1b8e008..d114226 100644 --- a/src/main/java/messagerosa/core/model/ContactCard.java +++ b/src/main/java/messagerosa/core/model/ContactCard.java @@ -1,14 +1,12 @@ package messagerosa.core.model; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; @Getter @Setter @NoArgsConstructor @AllArgsConstructor +@ToString public class ContactCard{ private Address address; private String name; diff --git a/src/main/java/messagerosa/core/model/ConversationStage.java b/src/main/java/messagerosa/core/model/ConversationStage.java index eb31d41..a1e4656 100644 --- a/src/main/java/messagerosa/core/model/ConversationStage.java +++ b/src/main/java/messagerosa/core/model/ConversationStage.java @@ -7,6 +7,7 @@ @Setter @AllArgsConstructor @NoArgsConstructor +@ToString public class ConversationStage { public enum State { STARTING, diff --git a/src/main/java/messagerosa/core/model/Data.java b/src/main/java/messagerosa/core/model/Data.java index 3e9ab88..9e2a9ee 100644 --- a/src/main/java/messagerosa/core/model/Data.java +++ b/src/main/java/messagerosa/core/model/Data.java @@ -8,6 +8,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ToString public class Data { private String key; private String value; diff --git a/src/main/java/messagerosa/core/model/LocationParams.java b/src/main/java/messagerosa/core/model/LocationParams.java index a4b9a61..8210e19 100644 --- a/src/main/java/messagerosa/core/model/LocationParams.java +++ b/src/main/java/messagerosa/core/model/LocationParams.java @@ -1,14 +1,12 @@ package messagerosa.core.model; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; @Getter @Setter @NoArgsConstructor @AllArgsConstructor +@ToString public class LocationParams { private double longitude; private double latitude; diff --git a/src/main/java/messagerosa/core/model/MessageId.java b/src/main/java/messagerosa/core/model/MessageId.java index 9c9b0fa..94baa8a 100644 --- a/src/main/java/messagerosa/core/model/MessageId.java +++ b/src/main/java/messagerosa/core/model/MessageId.java @@ -7,6 +7,7 @@ @AllArgsConstructor @NoArgsConstructor @Builder +@ToString public class MessageId { private String Id; private String channelMessageId; diff --git a/src/main/java/messagerosa/core/model/MessageMedia.java b/src/main/java/messagerosa/core/model/MessageMedia.java index 15c02de..6475388 100644 --- a/src/main/java/messagerosa/core/model/MessageMedia.java +++ b/src/main/java/messagerosa/core/model/MessageMedia.java @@ -1,14 +1,12 @@ package messagerosa.core.model; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; @Getter @Setter @NoArgsConstructor @AllArgsConstructor +@ToString public class MessageMedia { private MediaCategory category; //category list {image, audio, document, video} private String text; //caption, if applicable diff --git a/src/main/java/messagerosa/core/model/SenderReceiverInfo.java b/src/main/java/messagerosa/core/model/SenderReceiverInfo.java index aa97151..49f5002 100644 --- a/src/main/java/messagerosa/core/model/SenderReceiverInfo.java +++ b/src/main/java/messagerosa/core/model/SenderReceiverInfo.java @@ -1,10 +1,6 @@ package messagerosa.core.model; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; import java.util.ArrayList; import java.util.HashMap; @@ -15,6 +11,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ToString public class SenderReceiverInfo { // persist diff --git a/src/main/java/messagerosa/core/model/Transformer.java b/src/main/java/messagerosa/core/model/Transformer.java index 514003b..6f49818 100644 --- a/src/main/java/messagerosa/core/model/Transformer.java +++ b/src/main/java/messagerosa/core/model/Transformer.java @@ -9,6 +9,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ToString public class Transformer { private String id; private HashMap metaData; diff --git a/src/main/java/messagerosa/core/model/XMessage.java b/src/main/java/messagerosa/core/model/XMessage.java index e3a187d..9b0316b 100644 --- a/src/main/java/messagerosa/core/model/XMessage.java +++ b/src/main/java/messagerosa/core/model/XMessage.java @@ -15,11 +15,7 @@ import com.sun.istack.NotNull; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; @Getter @Setter @@ -27,6 +23,7 @@ @NoArgsConstructor @AllArgsConstructor @XmlRootElement +@ToString public class XMessage implements Serializable { public enum MessageState { NOT_SENT, diff --git a/src/main/java/messagerosa/core/model/XMessagePayload.java b/src/main/java/messagerosa/core/model/XMessagePayload.java index b674fc5..e3ddec7 100644 --- a/src/main/java/messagerosa/core/model/XMessagePayload.java +++ b/src/main/java/messagerosa/core/model/XMessagePayload.java @@ -1,10 +1,6 @@ package messagerosa.core.model; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; import java.util.ArrayList; @@ -13,6 +9,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ToString public class XMessagePayload { private String text; private MessageMedia media; diff --git a/src/main/java/messagerosa/core/model/XMessageThread.java b/src/main/java/messagerosa/core/model/XMessageThread.java index 6434ac9..59d0e34 100644 --- a/src/main/java/messagerosa/core/model/XMessageThread.java +++ b/src/main/java/messagerosa/core/model/XMessageThread.java @@ -9,6 +9,7 @@ @Builder @NoArgsConstructor @AllArgsConstructor +@ToString public class XMessageThread { private int offset; // normal form or simple chat.. @NotNull From 52c34ade4da88d608d590bedd5237be96bad27e1 Mon Sep 17 00:00:00 2001 From: pankajjangid05 Date: Thu, 13 Apr 2023 14:42:39 +0530 Subject: [PATCH 2/7] [Bug] - Getting NullPointer Exception while sending notification --- src/main/java/messagerosa/core/model/XMessage.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/messagerosa/core/model/XMessage.java b/src/main/java/messagerosa/core/model/XMessage.java index 9b0316b..75864f6 100644 --- a/src/main/java/messagerosa/core/model/XMessage.java +++ b/src/main/java/messagerosa/core/model/XMessage.java @@ -89,9 +89,9 @@ public enum MessageType { private String lastMessageID; private ConversationStage conversationStage; - + private ArrayList conversationLevel; - + @NotNull private ArrayList transformers; // -1 no transfer like ms3 transforms msg to next msg @@ -104,8 +104,8 @@ public enum MessageType { static { try { context = JAXBContext.newInstance(XMessage.class); - marshaller = context.createMarshaller(); - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); +// marshaller = context.createMarshaller(); +// marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); } catch (JAXBException e) { e.printStackTrace(); } @@ -114,6 +114,12 @@ public enum MessageType { public String toXML() throws JAXBException { StringWriter stringWriter = new StringWriter(); + /** Marshaller object created here because of it is not thread safe. + * So that we are getting exceptions like NullPointer, ArrayOutOfBounds, + * EmptyStack Exception. + */ + marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(this, stringWriter); return stringWriter.toString(); } From 0c2fc9edfd654d935ce232d404193546e63b6081 Mon Sep 17 00:00:00 2001 From: pankajjangid05 Date: Tue, 25 Apr 2023 15:18:04 +0530 Subject: [PATCH 3/7] [Hot Fix] - Creating local object of Marshaller --- src/main/java/messagerosa/core/model/XMessage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/messagerosa/core/model/XMessage.java b/src/main/java/messagerosa/core/model/XMessage.java index 75864f6..4b92bbf 100644 --- a/src/main/java/messagerosa/core/model/XMessage.java +++ b/src/main/java/messagerosa/core/model/XMessage.java @@ -99,7 +99,6 @@ public enum MessageType { private XMessagePayload payload; private static JAXBContext context; - private static Marshaller marshaller; static { try { @@ -118,7 +117,7 @@ public String toXML() throws JAXBException { * So that we are getting exceptions like NullPointer, ArrayOutOfBounds, * EmptyStack Exception. */ - marshaller = context.createMarshaller(); + Marshaller marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(this, stringWriter); return stringWriter.toString(); From 9ecdbd5c35b1a97be8c54d71fac3f54440cd5a88 Mon Sep 17 00:00:00 2001 From: pankajjangid05 Date: Thu, 27 Apr 2023 15:17:51 +0530 Subject: [PATCH 4/7] Creating new package for development and master branch --- .github/workflows/build-deploy.yml | 6 +++--- .github/workflows/build.yml | 4 ++-- pom.xml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 5372706..000fe90 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -5,10 +5,10 @@ on: tags: - 'v*.*.*' branches: - ["release-4.*.*", "release-5.*.*", "release-v2.*.*"] + ["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master", "development"] pull_request: branches: - ["release-4.*.*", "release-5.*.*", "release-v2.*.*"] + ["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master", "development"] jobs: build-deploy-github: @@ -35,7 +35,7 @@ jobs: - name: Delete package specific version uses: smartsquaregmbh/delete-old-packages@v0.4.0 with: - version: 2.1.0 # This should be same as in the pom.xml file, + version: 2.1.1 # This should be same as in the pom.xml file, # to delete only the pom specified version, not the other older versions names: | com.uci.message-rosa diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 34fe9d6..736b4d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,10 +3,10 @@ name: Maven Build on: push: branches: - ["release-4.*.*", "release-5.*.*", "release-v2.*.*"] + ["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master", "development"] pull_request: branches: - ["release-4.*.*", "release-5.*.*", "release-v2.*.*"] + ["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master", "development"] jobs: build: diff --git a/pom.xml b/pom.xml index 71bf827..843aa74 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.uci message-rosa - 2.1.0 + 2.1.1 message-rosa message-rosa for messages From 121a4bfc42d847c099bab6be546c4a4e963bde6d Mon Sep 17 00:00:00 2001 From: pankajjangid05 Date: Thu, 27 Apr 2023 16:29:59 +0530 Subject: [PATCH 5/7] [Hot Fix] -Package version related changes --- .github/workflows/build-deploy.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 000fe90..56f03f5 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -35,7 +35,7 @@ jobs: - name: Delete package specific version uses: smartsquaregmbh/delete-old-packages@v0.4.0 with: - version: 2.1.1 # This should be same as in the pom.xml file, + version: 2.1.0 # This should be same as in the pom.xml file, # to delete only the pom specified version, not the other older versions names: | com.uci.message-rosa diff --git a/pom.xml b/pom.xml index 843aa74..71bf827 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.uci message-rosa - 2.1.1 + 2.1.0 message-rosa message-rosa for messages From 33bdf3751cbc948b3a36f72354d4161b5883a884 Mon Sep 17 00:00:00 2001 From: pankajjangid05 Date: Wed, 3 May 2023 14:50:41 +0530 Subject: [PATCH 6/7] Creating new package naming for stagging and prod --- .github/workflows/build-deploy.yml | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 56f03f5..3ef8485 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -3,7 +3,7 @@ name: Github Package on: push: tags: - - 'v*.*.*' + ["v*.*.*", "v*.*.*-*"] branches: ["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master", "development"] pull_request: @@ -35,7 +35,7 @@ jobs: - name: Delete package specific version uses: smartsquaregmbh/delete-old-packages@v0.4.0 with: - version: 2.1.0 # This should be same as in the pom.xml file, + version: 2.2.0-SNAPSHOT # This should be same as in the pom.xml file, # to delete only the pom specified version, not the other older versions names: | com.uci.message-rosa diff --git a/pom.xml b/pom.xml index 71bf827..3335390 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.uci message-rosa - 2.1.0 + 2.2.0-SNAPSHOT message-rosa message-rosa for messages From adbb675ef69885554d184809616bf5413bfe89d2 Mon Sep 17 00:00:00 2001 From: pankajjangid05 Date: Mon, 8 May 2023 15:47:49 +0530 Subject: [PATCH 7/7] [Prod Deployment] - Change Package version and merge development branch in master --- .github/workflows/build-deploy.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 3ef8485..5265f9d 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -35,7 +35,7 @@ jobs: - name: Delete package specific version uses: smartsquaregmbh/delete-old-packages@v0.4.0 with: - version: 2.2.0-SNAPSHOT # This should be same as in the pom.xml file, + version: 2.2.1 # This should be same as in the pom.xml file, # to delete only the pom specified version, not the other older versions names: | com.uci.message-rosa diff --git a/pom.xml b/pom.xml index 3335390..487aa50 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.uci message-rosa - 2.2.0-SNAPSHOT + 2.2.1 message-rosa message-rosa for messages