Skip to content

Commit

Permalink
Merge pull request #21 from pankajjangid05/prod-development
Browse files Browse the repository at this point in the history
Prod development
  • Loading branch information
pankajjangid05 authored May 8, 2023
2 parents 4b59411 + adbb675 commit bcb1437
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 43 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Delete package specific version
uses: smartsquaregmbh/[email protected]
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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.uci</groupId>
<artifactId>message-rosa</artifactId>
<version>2.1.0</version>
<version>2.2.1</version>
<!-- On changing, Set version in deploy.xml to delete the previous packages if exists and deploy new package for the specified version -->
<name>message-rosa</name>
<description>message-rosa for messages</description>
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/messagerosa/core/model/Address.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/messagerosa/core/model/ButtonChoice.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ButtonChoice {
private String key;
private String text;
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/messagerosa/core/model/ContactCard.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class ConversationStage {
public enum State {
STARTING,
Expand Down
1 change: 1 addition & 0 deletions src/main/java/messagerosa/core/model/Data.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Data {
private String key;
private String value;
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/messagerosa/core/model/LocationParams.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/messagerosa/core/model/MessageId.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
public class MessageId {
private String Id;
private String channelMessageId;
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/messagerosa/core/model/MessageMedia.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/messagerosa/core/model/SenderReceiverInfo.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -15,6 +11,7 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class SenderReceiverInfo {

// persist
Expand Down
1 change: 1 addition & 0 deletions src/main/java/messagerosa/core/model/Transformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Transformer {
private String id;
private HashMap<String, String> metaData;
Expand Down
22 changes: 12 additions & 10 deletions src/main/java/messagerosa/core/model/XMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@

import com.sun.istack.NotNull;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.*;

@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@XmlRootElement
@ToString
public class XMessage implements Serializable {
public enum MessageState {
NOT_SENT,
Expand Down Expand Up @@ -92,23 +89,22 @@ public enum MessageType {
private String lastMessageID;

private ConversationStage conversationStage;

private ArrayList<Integer> conversationLevel;

@NotNull
private ArrayList<Transformer> transformers; // -1 no transfer like ms3 transforms msg to next msg

private XMessageThread thread;
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();
}
Expand All @@ -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();
}
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/messagerosa/core/model/XMessagePayload.java
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -13,6 +9,7 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class XMessagePayload {
private String text;
private MessageMedia media;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/messagerosa/core/model/XMessageThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class XMessageThread {
private int offset; // normal form or simple chat..
@NotNull
Expand Down

0 comments on commit bcb1437

Please sign in to comment.