diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml
index 5372706..5265f9d 100644
--- a/.github/workflows/build-deploy.yml
+++ b/.github/workflows/build-deploy.yml
@@ -3,12 +3,12 @@ name: Github Package
on:
push:
tags:
- - 'v*.*.*'
+ ["v*.*.*", "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.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/.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..487aa50 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
com.uci
message-rosa
- 2.1.0
+ 2.2.1
message-rosa
message-rosa for messages
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..4b92bbf 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,
@@ -92,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
@@ -102,13 +99,12 @@ public enum MessageType {
private XMessagePayload payload;
private static JAXBContext context;
- private static Marshaller marshaller;
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();
}
@@ -117,6 +113,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 marshaller = context.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.marshal(this, stringWriter);
return stringWriter.toString();
}
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