Skip to content

Commit e7c8049

Browse files
author
Greg Meyer
authored
Merge pull request #10 from DirectProjectJavaRI/develop
Releasing 8.0.0
2 parents c713412 + ead4b6a commit e7c8049

File tree

99 files changed

+989
-924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+989
-924
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
hs_err_pid*
2424
/.project
2525
/.classpath
26+
/target/

KeyStore

6.22 KB
Binary file not shown.

internalKeystore

6.22 KB
Binary file not shown.

pom.xml

Lines changed: 49 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<artifactId>gateway</artifactId>
66
<name>Direct Project Agent Gateways.</name>
7-
<version>6.0.3</version>
7+
<version>8.0.0</version>
88
<description>Direct Project security agent gateways and bridges.</description>
99
<inceptionYear>2010</inceptionYear>
1010
<url>https://github.com/DirectProjectJavaRI/gateway</url>
@@ -23,13 +23,14 @@
2323
<url>http://nhindirect.org</url>
2424
</organization>
2525
<prerequisites>
26-
<maven>3.0.0</maven>
26+
<maven>3.5.0</maven>
2727
</prerequisites>
2828
<parent>
2929
<groupId>org.springframework.boot</groupId>
3030
<artifactId>spring-boot-dependencies</artifactId>
31-
<version>2.1.9.RELEASE</version>
32-
</parent>
31+
<version>2.5.2</version>
32+
<relativePath />
33+
</parent>
3334
<scm>
3435
<url>https://nhin-d.googlecode.com/hg/java/gateway/</url>
3536
<connection>scm:hg:https://nhin-d.googlecode.com/hg/nhin-d/java/gateway</connection>
@@ -39,20 +40,25 @@
3940
<name>New BSD License</name>
4041
<url>http://nhindirect.org/BSDLicense</url>
4142
</license>
42-
</licenses>
43+
</licenses>
44+
<properties>
45+
<commons-io.version>2.8.0</commons-io.version>
46+
<mina-core.version>2.1.4</mina-core.version>
47+
<apache-james.version>3.2.0</apache-james.version>
48+
</properties>
4349
<dependencyManagement>
4450
<dependencies>
4551
<dependency>
4652
<groupId>org.springframework.boot</groupId>
4753
<artifactId>spring-boot-dependencies</artifactId>
48-
<version>2.1.9.RELEASE</version>
54+
<version>2.5.2</version>
4955
<type>pom</type>
5056
<scope>import</scope>
5157
</dependency>
5258
<dependency>
5359
<groupId>org.springframework.cloud</groupId>
5460
<artifactId>spring-cloud-starter-parent</artifactId>
55-
<version>Greenwich.SR3</version>
61+
<version>2020.0.3</version>
5662
<type>pom</type>
5763
<scope>import</scope>
5864
</dependency>
@@ -62,101 +68,73 @@
6268
<dependency>
6369
<groupId>org.nhind</groupId>
6470
<artifactId>agent</artifactId>
65-
<version>6.0.2</version>
71+
<version>8.0.0</version>
6672
</dependency>
6773
<dependency>
6874
<groupId>org.nhind</groupId>
6975
<artifactId>direct-common</artifactId>
70-
<version>6.0.1</version>
76+
<version>8.0.0</version>
7177
</dependency>
7278
<dependency>
7379
<groupId>org.nhind</groupId>
7480
<artifactId>direct-common-audit</artifactId>
75-
<version>6.0</version>
81+
<version>8.0.0</version>
7682
</dependency>
7783
<dependency>
7884
<groupId>org.nhind</groupId>
7985
<artifactId>config-service-client</artifactId>
80-
<version>6.0</version>
86+
<version>8.0.0</version>
8187
</dependency>
8288
<dependency>
8389
<groupId>org.nhind</groupId>
8490
<artifactId>direct-msg-monitor-client</artifactId>
85-
<version>6.0</version>
91+
<version>8.0.0</version>
8692
</dependency>
8793
<dependency>
8894
<groupId>org.nhind</groupId>
8995
<artifactId>xd-common</artifactId>
90-
<version>6.0</version>
96+
<version>8.0.0</version>
9197
<exclusions>
9298
<exclusion>
9399
<groupId>org.springframework.boot</groupId>
94100
<artifactId>spring-boot-starter-web</artifactId>
95101
</exclusion>
96102
</exclusions>
97103
</dependency>
98-
<dependency>
99-
<groupId>com.google.guava</groupId>
100-
<artifactId>guava</artifactId>
101-
<version>16.0</version>
102-
</dependency>
103-
<dependency>
104-
<groupId>org.nhind</groupId>
105-
<artifactId>agent</artifactId>
106-
<version>6.0.2</version>
107-
<type>test-jar</type>
108-
<scope>test</scope>
109-
</dependency>
110-
<dependency>
111-
<groupId>org.mockito</groupId>
112-
<artifactId>mockito-core</artifactId>
113-
<scope>test</scope>
114-
</dependency>
104+
115105
<dependency>
116106
<groupId>commons-codec</groupId>
117107
<artifactId>commons-codec</artifactId>
118-
<scope>compile</scope>
119108
</dependency>
120109
<dependency>
121110
<groupId>commons-io</groupId>
122111
<artifactId>commons-io</artifactId>
123-
<version>2.6</version>
124-
</dependency>
125-
<dependency>
126-
<groupId>commons-fileupload</groupId>
127-
<artifactId>commons-fileupload</artifactId>
128-
<version>1.3.3</version>
129-
<scope>compile</scope>
130-
</dependency>
131-
<dependency>
132-
<groupId>junit</groupId>
133-
<artifactId>junit</artifactId>
134-
<scope>test</scope>
135-
</dependency>
112+
<version>${commons-io.version}</version>
113+
</dependency>
136114
<dependency>
137115
<groupId>org.apache.james</groupId>
138116
<artifactId>apache-mailet-base</artifactId>
139-
<version>3.1.0</version>
117+
<version>${apache-james.version}</version>
140118
</dependency>
141119
<dependency>
142120
<groupId>org.apache.james</groupId>
143121
<artifactId>apache-mailet-api</artifactId>
144-
<version>3.1.0</version>
122+
<version>${apache-james.version}</version>
145123
</dependency>
146124
<dependency>
147125
<groupId>org.apache.james</groupId>
148126
<artifactId>james-server-mailets</artifactId>
149-
<version>3.1.0</version>
127+
<version>${apache-james.version}</version>
150128
</dependency>
151129
<dependency>
152130
<groupId>org.apache.james</groupId>
153131
<artifactId>javax-mail-extension</artifactId>
154-
<version>3.1.0</version>
132+
<version>${apache-james.version}</version>
155133
</dependency>
156134
<dependency>
157135
<groupId>org.nhind</groupId>
158136
<artifactId>config-service-jar</artifactId>
159-
<version>6.0.4</version>
137+
<version>8.0.0</version>
160138
<scope>test</scope>
161139
</dependency>
162140
<dependency>
@@ -166,37 +144,38 @@
166144
<dependency>
167145
<groupId>org.springframework.cloud</groupId>
168146
<artifactId>spring-cloud-stream</artifactId>
169-
</dependency>
170-
<dependency>
171-
<groupId>org.springframework</groupId>
172-
<artifactId>spring-test</artifactId>
173-
<scope>test</scope>
174-
</dependency>
147+
</dependency>
175148
<dependency>
176149
<groupId>org.springframework.boot</groupId>
177150
<artifactId>spring-boot-starter-test</artifactId>
178151
<scope>test</scope>
179-
</dependency>
152+
</dependency>
180153
<dependency>
181-
<groupId>org.springframework.cloud</groupId>
182-
<artifactId>spring-cloud-stream-test-support</artifactId>
183-
<scope>test</scope>
184-
</dependency>
154+
<groupId>org.springframework.cloud</groupId>
155+
<artifactId>spring-cloud-stream</artifactId>
156+
<type>test-jar</type>
157+
<scope>test</scope>
158+
<classifier>test-binder</classifier>
159+
</dependency>
185160
<dependency>
186-
<groupId>org.apache.camel</groupId>
187-
<artifactId>camel-spring-boot-starter</artifactId>
188-
<version>2.22.0</version>
189-
<scope>test</scope>
190-
</dependency>
161+
<groupId>org.springframework.cloud</groupId>
162+
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
163+
<scope>test</scope>
164+
</dependency>
191165
<dependency>
192166
<groupId>com.h2database</groupId>
193167
<artifactId>h2</artifactId>
194168
<scope>test</scope>
195-
</dependency>
169+
</dependency>
170+
<dependency>
171+
<groupId>io.r2dbc</groupId>
172+
<artifactId>r2dbc-h2</artifactId>
173+
<scope>test</scope>
174+
</dependency>
196175
<dependency>
197176
<groupId>org.apache.mina</groupId>
198177
<artifactId>mina-core</artifactId>
199-
<version>1.0.2</version>
178+
<version>${mina-core.version}</version>
200179
<scope>test</scope>
201180
</dependency>
202181
</dependencies>
@@ -247,6 +226,7 @@
247226
<plugin>
248227
<groupId>org.apache.maven.plugins</groupId>
249228
<artifactId>maven-jxr-plugin</artifactId>
229+
<version>3.1.1</version>
250230
</plugin>
251231
<plugin>
252232
<groupId>org.apache.maven.plugins</groupId>
@@ -292,9 +272,8 @@
292272
<plugin>
293273
<groupId>org.apache.maven.plugins</groupId>
294274
<artifactId>maven-javadoc-plugin</artifactId>
295-
<version>2.9.1</version>
296275
<configuration>
297-
<additionalparam>-Xdoclint:none</additionalparam>
276+
<additionalJOption>-Xdoclint:none</additionalJOption>
298277
<charset>UTF-8</charset>
299278
<docencoding>UTF-8</docencoding>
300279
<docfilessubdirs>true</docfilessubdirs>
@@ -338,14 +317,12 @@
338317
<plugin>
339318
<groupId>org.apache.maven.plugins</groupId>
340319
<artifactId>maven-project-info-reports-plugin</artifactId>
341-
<version>2.9</version>
342320
</plugin>
343321
<plugin>
344322
<groupId>org.apache.maven.plugins</groupId>
345323
<artifactId>maven-javadoc-plugin</artifactId>
346-
<version>2.9.1</version>
347324
<configuration>
348-
<additionalparam>-Xdoclint:none</additionalparam>
325+
<additionalJOption>-Xdoclint:none</additionalJOption>
349326
<charset>UTF-8</charset>
350327
<docencoding>UTF-8</docencoding>
351328
<docfilessubdirs>true</docfilessubdirs>

src/main/java/org/nhindirect/gateway/smtp/DefaultSmtpAgent.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,18 @@ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
6262
import org.nhindirect.stagent.mail.notifications.NotificationHelper;
6363
import org.nhindirect.stagent.mail.notifications.NotificationMessage;
6464
import org.nhindirect.stagent.parser.EntitySerializer;
65-
import org.slf4j.Logger;
66-
import org.slf4j.LoggerFactory;
6765

6866
import com.sun.mail.util.CRLFOutputStream;
6967

68+
import lombok.extern.slf4j.Slf4j;
69+
7070
/**
7171
* Default implementation of the SmtpAgent interface.
7272
* {@inheritDoc}
7373
*/
74+
@Slf4j
7475
public class DefaultSmtpAgent implements SmtpAgent
7576
{
76-
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultSmtpAgent.class);
77-
7877
private static final String PRINICPAL;
7978

8079
private NHINDAgent agent;
@@ -93,7 +92,7 @@ public class DefaultSmtpAgent implements SmtpAgent
9392
}
9493
catch (UnknownHostException e)
9594
{
96-
LOGGER.warn("Coulnd not get host name: " + e.getMessage());
95+
log.warn("Coulnd not get host name: " + e.getMessage());
9796
}
9897

9998
PRINICPAL = "STAgent" + host;
@@ -186,7 +185,7 @@ public MessageProcessResult processMessage(MimeMessage message, NHINDAddressColl
186185
try
187186
{
188187

189-
LOGGER.trace("Entering processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress");
188+
log.trace("Entering processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress");
190189

191190
MessageProcessResult retVal = null;
192191

@@ -212,7 +211,7 @@ public MessageProcessResult processMessage(MimeMessage message, NHINDAddressColl
212211
catch (SmtpAgentException e)
213212
{
214213
// rethrow
215-
LOGGER.trace("Exiting processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress", e);
214+
log.trace("Exiting processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress", e);
216215
throw e;
217216
}
218217
catch (Exception e)
@@ -251,11 +250,11 @@ public MessageProcessResult processMessage(MimeMessage message, NHINDAddressColl
251250
auditor.audit(PRINICPAL, new AuditEvent(AuditEvents.REJECTED_MESSAGE_NAME, AuditEvents.EVENT_TYPE), contexts);
252251
}
253252

254-
LOGGER.trace("Exiting processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress", e);
253+
log.trace("Exiting processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress", e);
255254
throw new SmtpAgentException(SmtpAgentError.Unknown, e);
256255
}
257256

258-
LOGGER.trace("Exiting processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress");
257+
log.trace("Exiting processMessage(MimeMessage, NHINDAddressCollection, NHINDAddress");
259258
return retVal;
260259
}
261260
finally
@@ -275,7 +274,7 @@ private void verifyInitialized()
275274

276275
private void preProcessMessage(MimeMessage message, NHINDAddress sender)
277276
{
278-
LOGGER.debug("Message Recieved from: " + sender.getAddress());
277+
log.debug("Message Recieved from: " + sender.getAddress());
279278
copyMessage(message, settings.getRawMessageSettings());
280279
}
281280

@@ -338,7 +337,7 @@ protected MessageEnvelope processEnvelope(MessageEnvelope envelope)
338337
}
339338
catch (Exception e)
340339
{
341-
LOGGER.trace("Failed to canonicalize message", e);
340+
log.trace("Failed to canonicalize message", e);
342341
throw new SmtpAgentException(SmtpAgentError.Unknown, e);
343342
}
344343
}
@@ -349,7 +348,7 @@ protected MessageEnvelope processEnvelope(MessageEnvelope envelope)
349348

350349
auditor.audit(PRINICPAL, new AuditEvent(AuditEvents.OUTGOING_MESSAGE_NAME, AuditEvents.EVENT_TYPE), contexts);
351350
}
352-
LOGGER.debug("Sending outgoing message from " + envelope.getSender().toString() + " to STAgent");
351+
log.debug("Sending outgoing message from " + envelope.getSender().toString() + " to STAgent");
353352
}
354353
else
355354
{
@@ -360,7 +359,7 @@ protected MessageEnvelope processEnvelope(MessageEnvelope envelope)
360359

361360
auditor.audit(PRINICPAL, new AuditEvent(AuditEvents.INCOMING_MESSAGE_NAME, AuditEvents.EVENT_TYPE), contexts);
362361
}
363-
LOGGER.debug("Sending incoming message from " + envelope.getSender().toString() + " to STAgent");
362+
log.debug("Sending incoming message from " + envelope.getSender().toString() + " to STAgent");
364363
}
365364

366365

@@ -435,7 +434,7 @@ private void postProcessIncomingMessage(MessageProcessResult result)
435434
catch (Exception e)
436435
{
437436
// don't bail on the whole process if we can't create notifications messages
438-
LOGGER.error("Failed to create notification messages.", e);
437+
log.error("Failed to create notification messages.", e);
439438
}
440439

441440
// check if this is an incoming MDN message... is so, audit it
@@ -529,7 +528,7 @@ else if (header.equals(MDNStandard.Headers.Disposition) ||
529528
}
530529
catch (MessagingException e)
531530
{
532-
LOGGER.warn("Error retrieving header " + header + " from the message.");
531+
log.warn("Error retrieving header " + header + " from the message.");
533532
}
534533
}
535534

0 commit comments

Comments
 (0)