Skip to content

Commit c28a5a6

Browse files
author
Greg Meyer
authored
Merge pull request #7 from DirectProjectJavaRI/develop
Releasing 8.0.0
2 parents 4d36ab0 + b6535ea commit c28a5a6

File tree

22 files changed

+558
-220
lines changed

22 files changed

+558
-220
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/.classpath
22
/.project
3+
/target/

pom.xml

Lines changed: 62 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<artifactId>xd</artifactId>
66
<name>NHIN Direct XD* Web Endpoint</name>
7-
<version>6.0.1</version>
7+
<version>8.0.0</version>
88
<description>NHIN Direct XD Component</description>
99
<inceptionYear>2010</inceptionYear>
1010
<packaging>war</packaging>
@@ -14,14 +14,14 @@
1414
<connection>scm:git:https://github.com/DirectProjectJavaRI/xd.git</connection>
1515
</scm>
1616
<prerequisites>
17-
<maven>3.0.0</maven>
18-
</prerequisites>
19-
<parent>
20-
<groupId>org.springframework.boot</groupId>
21-
<artifactId>spring-boot-starter-parent</artifactId>
22-
<version>2.1.3.RELEASE</version>
23-
<relativePath />
24-
</parent>
17+
<maven>3.5.0</maven>
18+
</prerequisites>
19+
<parent>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-parent</artifactId>
22+
<version>2.5.2</version>
23+
<relativePath />
24+
</parent>
2525
<developers>
2626
<developer>
2727
<name>Vincent Lewis</name>
@@ -48,27 +48,28 @@
4848
</licenses>
4949
<properties>
5050
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
51+
<apache.cxf.version>3.2.7</apache.cxf.version>
5152
</properties>
5253
<dependencyManagement>
5354
<dependencies>
5455
<dependency>
5556
<groupId>org.springframework.boot</groupId>
5657
<artifactId>spring-boot-dependencies</artifactId>
57-
<version>2.1.3.RELEASE</version>
58+
<version>2.5.2</version>
5859
<type>pom</type>
5960
<scope>import</scope>
6061
</dependency>
6162
<dependency>
6263
<groupId>io.pivotal.spring.cloud</groupId>
6364
<artifactId>spring-cloud-services-dependencies</artifactId>
64-
<version>2.1.1.RELEASE</version>
65+
<version>3.3.0</version>
6566
<type>pom</type>
6667
<scope>import</scope>
6768
</dependency>
6869
<dependency>
6970
<groupId>org.springframework.cloud</groupId>
7071
<artifactId>spring-cloud-starter-parent</artifactId>
71-
<version>Greenwich.SR1</version>
72+
<version>2020.0.3</version>
7273
<type>pom</type>
7374
<scope>import</scope>
7475
</dependency>
@@ -78,22 +79,22 @@
7879
<dependency>
7980
<groupId>org.apache.cxf</groupId>
8081
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
81-
<version>3.2.7</version>
82+
<version>${apache.cxf.version}</version>
8283
</dependency>
8384
<dependency>
8485
<groupId>org.apache.cxf</groupId>
8586
<artifactId>cxf-rt-bindings-xml</artifactId>
86-
<version>3.2.7</version>
87+
<version>${apache.cxf.version}</version>
8788
</dependency>
8889
<dependency>
8990
<groupId>org.apache.cxf</groupId>
9091
<artifactId>cxf-rt-bindings-soap</artifactId>
91-
<version>3.2.7</version>
92+
<version>${apache.cxf.version}</version>
9293
</dependency>
9394
<dependency>
9495
<groupId>org.apache.cxf</groupId>
9596
<artifactId>cxf-rt-frontend-jaxws</artifactId>
96-
<version>3.2.7</version>
97+
<version>${apache.cxf.version}</version>
9798
<exclusions>
9899
<exclusion>
99100
<groupId>org.apache.geronimo.specs</groupId>
@@ -108,22 +109,18 @@
108109
<dependency>
109110
<groupId>org.apache.cxf</groupId>
110111
<artifactId>cxf-rt-transports-http</artifactId>
111-
<version>3.2.7</version>
112+
<version>${apache.cxf.version}</version>
112113
</dependency>
113114
<!-- Jetty is needed if you're are not using the CXFServlet -->
114115
<dependency>
115116
<groupId>org.apache.cxf</groupId>
116117
<artifactId>cxf-rt-transports-http-jetty</artifactId>
117-
<version>3.2.7</version>
118+
<version>${apache.cxf.version}</version>
118119
</dependency>
119120
<dependency>
120121
<groupId>org.springframework.boot</groupId>
121122
<artifactId>spring-boot-starter-security</artifactId>
122-
</dependency>
123-
<dependency>
124-
<groupId>org.springframework.cloud</groupId>
125-
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
126-
</dependency>
123+
</dependency>
127124
<dependency>
128125
<groupId>org.springframework.boot</groupId>
129126
<artifactId>spring-boot-configuration-processor</artifactId>
@@ -138,6 +135,18 @@
138135
</exclusion>
139136
</exclusions>
140137
</dependency>
138+
<dependency>
139+
<groupId>org.springframework.cloud</groupId>
140+
<artifactId>spring-cloud-starter-bootstrap</artifactId>
141+
</dependency>
142+
<dependency>
143+
<groupId>org.springframework.cloud</groupId>
144+
<artifactId>spring-cloud-stream</artifactId>
145+
</dependency>
146+
<dependency>
147+
<groupId>org.springframework.cloud</groupId>
148+
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
149+
</dependency>
141150
<dependency>
142151
<groupId>io.pivotal.spring.cloud</groupId>
143152
<artifactId>spring-cloud-services-starter-config-client</artifactId>
@@ -148,11 +157,6 @@
148157
</exclusion>
149158
</exclusions>
150159
</dependency>
151-
<dependency>
152-
<groupId>junit</groupId>
153-
<artifactId>junit</artifactId>
154-
<scope>test</scope>
155-
</dependency>
156160
<dependency>
157161
<groupId>javax.xml.bind</groupId>
158162
<artifactId>jaxb-api</artifactId>
@@ -170,26 +174,47 @@
170174
<dependency>
171175
<groupId>${project.groupId}</groupId>
172176
<artifactId>xd-common</artifactId>
173-
<version>6.0</version>
177+
<version>8.0.0</version>
174178
</dependency>
179+
<dependency>
180+
<groupId>${project.groupId}</groupId>
181+
<artifactId>xdmail</artifactId>
182+
<version>8.0.0</version>
183+
<scope>test</scope>
184+
</dependency>
185+
<dependency>
186+
<groupId>${project.groupId}</groupId>
187+
<artifactId>direct-msg-monitor-model</artifactId>
188+
<version>8.0.0</version>
189+
<scope>test</scope>
190+
</dependency>
191+
<dependency>
192+
<groupId>org.springframework.cloud</groupId>
193+
<artifactId>spring-cloud-stream</artifactId>
194+
<type>test-jar</type>
195+
<scope>test</scope>
196+
<classifier>test-binder</classifier>
197+
</dependency>
198+
<dependency>
199+
<groupId>org.springframework.boot</groupId>
200+
<artifactId>spring-boot-starter-test</artifactId>
201+
<scope>test</scope>
202+
</dependency>
175203
</dependencies>
176204

177205
<build>
178206
<extensions>
179207
<extension>
180208
<groupId>org.apache.maven.wagon</groupId>
181209
<artifactId>wagon-webdav-jackrabbit</artifactId>
182-
<version>3.1.0</version>
183210
</extension>
184211
<extension>
185212
<groupId>org.apache.maven.wagon</groupId>
186213
<artifactId>wagon-ssh-external</artifactId>
187-
<version>3.1.0</version>
188214
</extension>
189215
<extension>
190216
<groupId>org.apache.maven.wagon</groupId>
191217
<artifactId>wagon-ssh</artifactId>
192-
<version>3.1.0</version>
193218
</extension>
194219
</extensions>
195220

@@ -277,9 +302,8 @@
277302
<plugin>
278303
<groupId>org.apache.maven.plugins</groupId>
279304
<artifactId>maven-javadoc-plugin</artifactId>
280-
<version>2.9.1</version>
281305
<configuration>
282-
<additionalparam>-Xdoclint:none</additionalparam>
306+
<additionalJOption>-Xdoclint:none</additionalJOption>
283307
<charset>UTF-8</charset>
284308
<docencoding>UTF-8</docencoding>
285309
<docfilessubdirs>true</docfilessubdirs>
@@ -300,7 +324,8 @@
300324
</goals>
301325
</execution>
302326
</executions>
303-
</plugin>
327+
</plugin>
328+
<!-- for releases only
304329
<plugin>
305330
<groupId>org.apache.maven.plugins</groupId>
306331
<artifactId>maven-gpg-plugin</artifactId>
@@ -314,6 +339,7 @@
314339
</execution>
315340
</executions>
316341
</plugin>
342+
-->
317343
</plugins>
318344
</build>
319345
</profile>
@@ -324,14 +350,12 @@
324350
<plugin>
325351
<groupId>org.apache.maven.plugins</groupId>
326352
<artifactId>maven-project-info-reports-plugin</artifactId>
327-
<version>2.9</version>
328353
</plugin>
329354
<plugin>
330355
<groupId>org.apache.maven.plugins</groupId>
331356
<artifactId>maven-javadoc-plugin</artifactId>
332-
<version>2.9.1</version>
333357
<configuration>
334-
<additionalparam>-Xdoclint:none</additionalparam>
358+
<additionalJOption>-Xdoclint:none</additionalJOption>
335359
<charset>UTF-8</charset>
336360
<docencoding>UTF-8</docencoding>
337361
<docfilessubdirs>true</docfilessubdirs>

src/main/java/org/nhind/xdm/MailClient.java renamed to src/main/java/org/nhind/xdm/MimeSendClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3030
*
3131
* @author vlewis
3232
*/
33-
public interface MailClient
33+
public interface MimeSendClient
3434
{
3535

3636
/**
37-
* Mail a DirectMessage object.
37+
* Sends a DirectMessage object.
3838
*
3939
* @param message
4040
* The DirectMessage wrapper.
4141
* @param messageId
4242
* The message ID.
4343
* @throws MessagingException
4444
*/
45-
public void mail(DirectMessage message, String messageId, String suffix) throws MessagingException;
45+
public void send(DirectMessage message, String messageId, String suffix) throws MessagingException;
4646
}

src/main/java/org/nhind/xdm/boot/XDApplication.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
import org.springframework.boot.SpringApplication;
44
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration;
56
import org.springframework.boot.builder.SpringApplicationBuilder;
67
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
7-
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
88
import org.springframework.context.annotation.ComponentScan;
99

10-
@SpringBootApplication
11-
@EnableEurekaClient
12-
@ComponentScan(basePackages = {"org.nhind.xdm.springconfig"})
10+
@SpringBootApplication(exclude = {R2dbcAutoConfiguration.class})
11+
@ComponentScan(basePackages = {"org.nhind.xdm.springconfig", "org.nhind.xdm.streams", "org.nhind.xdm.impl"})
1312
public class XDApplication extends SpringBootServletInitializer
1413
{
1514
public static void main(String[] args)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package org.nhind.xdm.impl;
2+
3+
import java.io.IOException;
4+
5+
import javax.activation.DataHandler;
6+
import javax.mail.Message;
7+
import javax.mail.MessagingException;
8+
import javax.mail.Multipart;
9+
import javax.mail.Session;
10+
import javax.mail.internet.InternetAddress;
11+
import javax.mail.internet.MimeBodyPart;
12+
import javax.mail.internet.MimeMessage;
13+
import javax.mail.internet.MimeMultipart;
14+
15+
import org.nhind.xdm.MimeSendClient;
16+
import org.nhindirect.xd.common.DirectMessage;
17+
18+
import lombok.extern.slf4j.Slf4j;
19+
20+
@Slf4j
21+
public abstract class AbstractSendClient implements MimeSendClient
22+
{
23+
public MimeMessage buildMimeMessage(DirectMessage message, String messageId, String suffix, Session session) throws MessagingException
24+
{
25+
log.info("Building Mime message for sender.");
26+
27+
MimeMessage mmessage;
28+
Multipart mailBody;
29+
MimeBodyPart mainBody;
30+
MimeBodyPart mimeAttach;
31+
32+
InternetAddress addressFrom = new InternetAddress(message.getSender());
33+
34+
InternetAddress[] addressTo = new InternetAddress[message.getReceivers().size()];
35+
int i = 0;
36+
for (String recipient : message.getReceivers())
37+
{
38+
addressTo[i++] = new InternetAddress(recipient);
39+
}
40+
41+
// Build message object
42+
mmessage = new MimeMessage(session);
43+
mmessage.setFrom(addressFrom);
44+
mmessage.setRecipients(Message.RecipientType.TO, addressTo);
45+
mmessage.setSubject(message.getSubject());
46+
47+
mailBody = new MimeMultipart();
48+
49+
mainBody = new MimeBodyPart();
50+
mainBody.setDataHandler(new DataHandler(message.getBody(), "text/plain"));
51+
mailBody.addBodyPart(mainBody);
52+
53+
try
54+
{
55+
mimeAttach = new MimeBodyPart();
56+
mimeAttach.attachFile(message.getDirectDocuments().toXdmPackage(messageId).toFile());
57+
}
58+
catch (IOException e)
59+
{
60+
throw new MessagingException("Unable to create/attach xdm zip file", e);
61+
}
62+
63+
mailBody.addBodyPart(mimeAttach);
64+
65+
mmessage.setContent(mailBody);
66+
67+
return mmessage;
68+
}
69+
}

0 commit comments

Comments
 (0)