Skip to content

Commit 0a6f41e

Browse files
authored
Merge branch 'OpenIntegrationEngine:main' into issue-156-remove-ads
2 parents 7b6fa49 + ec57fb0 commit 0a6f41e

File tree

27 files changed

+282
-1993
lines changed

27 files changed

+282
-1993
lines changed

.gitignore

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -683,26 +683,6 @@ donkey/donkey-test
683683

684684
# /server/src/org/mozilla/javascript/xmlimpl/
685685

686-
# /simplesender/
687-
/simplesender/.settings
688-
/simplesender/bin
689-
690-
# /simplesender/lib/
691-
692-
# /simplesender/samples/
693-
694-
# /simplesender/src/
695-
696-
# /simplesender/src/com/
697-
698-
# /simplesender/src/com/mirth/
699-
700-
# /simplesender/src/com/mirth/connect/
701-
702-
# /simplesender/src/com/mirth/connect/simplereceiver/
703-
704-
# /simplesender/src/com/mirth/connect/simplesender/
705-
706686
# /webadmin/
707687
/webadmin/build
708688
/webadmin/dist

client/.classpath

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
<classpathentry kind="lib" path="lib/javaparser-1.0.8.jar"/>
153153
<classpathentry kind="lib" path="lib/quartz-2.3.2.jar"/>
154154
<classpathentry kind="lib" path="lib/jai_imageio.jar"/>
155+
<classpathentry kind="lib" path="lib/istack-commons-runtime-3.0.6.jar"/>
155156
<classpathentry kind="lib" path="lib/javax.ws.rs-api-2.0.1.jar"/>
156157
<classpathentry kind="lib" path="lib/jersey-client-2.22.1.jar"/>
157158
<classpathentry kind="lib" path="lib/jersey-proxy-client-2.22.1.jar"/>
@@ -162,7 +163,7 @@
162163
<classpathentry kind="lib" path="lib/hk2-locator-2.4.0-b31.jar"/>
163164
<classpathentry kind="lib" path="lib/hk2-utils-2.4.0-b31.jar"/>
164165
<classpathentry kind="lib" path="lib/jersey-guava-2.22.1.jar"/>
165-
<classpathentry kind="lib" path="lib/guava-28.2-jre.jar"/>
166+
<classpathentry kind="lib" path="lib/guava-32.0.1-jre.jar"/>
166167
<classpathentry kind="lib" path="lib/javassist-3.26.0-GA.jar"/>
167168
<classpathentry kind="lib" path="lib/javax.inject-2.4.0-b31.jar"/>
168169
<classpathentry kind="lib" path="lib/jersey-media-multipart-2.22.1.jar"/>
@@ -172,9 +173,9 @@
172173
<classpathentry kind="lib" path="lib/bcpkix-jdk18on-1.78.1.jar"/>
173174
<classpathentry kind="lib" path="lib/bcprov-jdk18on-1.78.1.jar"/>
174175
<classpathentry kind="lib" path="lib/bcutil-jdk18on-1.78.1.jar"/>
175-
<classpathentry kind="lib" path="lib/commons-vfs2-2.9.0.jar"/>
176+
<classpathentry kind="lib" path="lib/commons-vfs2-2.10.0.jar"/>
176177
<classpathentry kind="lib" path="lib/staxon-1.3.jar"/>
177-
<classpathentry kind="lib" path="lib/jetty-util-9.4.53.v20231009.jar"/>
178+
<classpathentry kind="lib" path="lib/jetty-util-9.4.57.v20241219.jar"/>
178179
<classpathentry kind="lib" path="lib/commons-compress-1.24.0.jar"/>
179180
<classpathentry kind="lib" path="lib/javax.activation-1.2.0.jar"/>
180181
<classpathentry kind="lib" path="lib/javax.activation-api-1.2.0.jar"/>
@@ -194,8 +195,8 @@
194195
<classpathentry kind="lib" path="lib/jackson-databind-2.14.3.jar"/>
195196
<classpathentry kind="lib" path="lib/httpclient-4.5.13.jar"/>
196197
<classpathentry kind="lib" path="lib/httpmime-4.5.13.jar"/>
197-
<classpathentry kind="lib" path="/Donkey/lib/slf4j-api-1.7.30.jar"/>
198-
<classpathentry kind="lib" path="/Donkey/lib/slf4j-log4j12-1.7.30.jar"/>
198+
<classpathentry kind="lib" path="lib/slf4j-api-1.7.30.jar"/>
199+
<classpathentry kind="lib" path="lib/slf4j-log4j12-1.7.30.jar"/>
199200
<classpathentry kind="lib" path="lib/hapi-base-2.3.jar"/>
200201
<classpathentry kind="lib" path="lib/hapi-structures-v21-2.3.jar"/>
201202
<classpathentry kind="lib" path="lib/hapi-structures-v22-2.3.jar"/>
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: Mirth Corporation
3+
4+
package com.mirth.connect.client.ui;
5+
6+
import org.apache.commons.lang3.StringUtils;
7+
8+
/**
9+
* Immutable holder for command line options used by the Mirth client.
10+
*/
11+
public class CommandLineOptions {
12+
private final String server;
13+
private final String version;
14+
private final String username;
15+
private final String password;
16+
private final String protocols;
17+
private final String cipherSuites;
18+
19+
/**
20+
* Parse command line arguments for Mirth client.
21+
*/
22+
public CommandLineOptions(String[] args) {
23+
String server = "https://localhost:8443";
24+
String version = "";
25+
String username = "";
26+
String password = "";
27+
String protocols = "";
28+
String cipherSuites = "";
29+
30+
if (args == null) {
31+
args = new String[0];
32+
}
33+
34+
if (args.length > 0) {
35+
server = args[0];
36+
}
37+
if (args.length > 1) {
38+
version = args[1];
39+
}
40+
if (args.length > 2) {
41+
if (StringUtils.equalsIgnoreCase(args[2], "-ssl")) {
42+
// <server> <version> -ssl [<protocols> [<ciphersuites> [<username> [<password>]]]]
43+
if (args.length > 3) {
44+
protocols = args[3];
45+
}
46+
if (args.length > 4) {
47+
cipherSuites = args[4];
48+
}
49+
if (args.length > 5) {
50+
username = args[5];
51+
}
52+
if (args.length > 6) {
53+
password = args[6];
54+
}
55+
} else {
56+
// <server> <version> <username> [<password> [-ssl [<protocols> [<ciphersuites>]]]]
57+
username = args[2];
58+
if (args.length > 3) {
59+
password = args[3];
60+
}
61+
if (args.length > 4 && StringUtils.equalsIgnoreCase(args[4], "-ssl")) {
62+
if (args.length > 5) {
63+
protocols = args[5];
64+
}
65+
if (args.length > 6) {
66+
cipherSuites = args[6];
67+
}
68+
}
69+
}
70+
}
71+
72+
this.server = server;
73+
this.version = version;
74+
this.username = username;
75+
this.password = password;
76+
this.protocols = protocols;
77+
this.cipherSuites = cipherSuites;
78+
}
79+
80+
public String getServer() {
81+
return server;
82+
}
83+
84+
public String getVersion() {
85+
return version;
86+
}
87+
88+
public String getUsername() {
89+
return username;
90+
}
91+
92+
public String getPassword() {
93+
return password;
94+
}
95+
96+
public String getProtocols() {
97+
return protocols;
98+
}
99+
100+
public String getCipherSuites() {
101+
return cipherSuites;
102+
}
103+
}

client/src/com/mirth/connect/client/ui/LoginPanel.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
/*
2-
* Copyright (c) Mirth Corporation. All rights reserved.
3-
*
4-
* http://www.mirthcorp.com
5-
*
6-
* The software in this package is published under the terms of the MPL license a copy of which has
7-
* been included with this distribution in the LICENSE.txt file.
8-
*/
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: Mirth Corporation
3+
// SPDX-FileCopyrightText: 2025 Mitch Gaffigan and Tony Germano
94

105
package com.mirth.connect.client.ui;
116

@@ -451,7 +446,7 @@ public Void doInBackground() {
451446
}
452447

453448
// If SUCCESS or SUCCESS_GRACE_PERIOD
454-
if ((loginStatus != null) && ((loginStatus.getStatus() == LoginStatus.Status.SUCCESS) || (loginStatus.getStatus() == LoginStatus.Status.SUCCESS_GRACE_PERIOD))) {
449+
if (loginStatus != null && loginStatus.isSuccess()) {
455450
if (!handleSuccess(loginStatus)) {
456451
LoginPanel.getInstance().setVisible(false);
457452
LoginPanel.getInstance().initialize(PlatformUI.SERVER_URL, PlatformUI.CLIENT_VERSION, "", "");
@@ -469,7 +464,7 @@ public Void doInBackground() {
469464

470465
loginStatus = plugin.authenticate(LoginPanel.this, client, updatedUsername, loginStatus);
471466

472-
if ((loginStatus != null) && ((loginStatus.getStatus() == LoginStatus.Status.SUCCESS) || (loginStatus.getStatus() == LoginStatus.Status.SUCCESS_GRACE_PERIOD))) {
467+
if (loginStatus != null && loginStatus.isSuccess()) {
473468
errorOccurred = false;
474469
if (!handleSuccess(loginStatus)) {
475470
LoginPanel.getInstance().setVisible(false);

client/src/com/mirth/connect/client/ui/Mirth.java

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
/*
2-
* Copyright (c) Mirth Corporation. All rights reserved.
3-
*
4-
* http://www.mirthcorp.com
5-
*
6-
* The software in this package is published under the terms of the MPL license a copy of which has
7-
* been included with this distribution in the LICENSE.txt file.
8-
*/
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: Mirth Corporation
93

104
package com.mirth.connect.client.ui;
115

@@ -259,59 +253,18 @@ public static void initUIManager() {
259253
* String[]
260254
*/
261255
public static void main(String[] args) {
262-
String server = "https://localhost:8443";
263-
String version = "";
264-
String username = "";
265-
String password = "";
266-
String protocols = "";
267-
String cipherSuites = "";
268-
269-
if (args.length > 0) {
270-
server = args[0];
271-
}
272-
if (args.length > 1) {
273-
version = args[1];
274-
}
275-
if (args.length > 2) {
276-
if (StringUtils.equalsIgnoreCase(args[2], "-ssl")) {
277-
// <server> <version> -ssl [<protocols> [<ciphersuites> [<username> [<password>]]]]
278-
if (args.length > 3) {
279-
protocols = args[3];
280-
}
281-
if (args.length > 4) {
282-
cipherSuites = args[4];
283-
}
284-
if (args.length > 5) {
285-
username = args[5];
286-
}
287-
if (args.length > 6) {
288-
password = args[6];
289-
}
290-
} else {
291-
// <server> <version> <username> [<password> [-ssl [<protocols> [<ciphersuites>]]]]
292-
username = args[2];
293-
if (args.length > 3) {
294-
password = args[3];
295-
}
296-
if (args.length > 4 && StringUtils.equalsIgnoreCase(args[4], "-ssl")) {
297-
if (args.length > 5) {
298-
protocols = args[5];
299-
}
300-
if (args.length > 6) {
301-
cipherSuites = args[6];
302-
}
303-
}
304-
}
305-
}
256+
CommandLineOptions opts = new CommandLineOptions(args);
306257

307-
if (StringUtils.isNotBlank(protocols)) {
308-
PlatformUI.HTTPS_PROTOCOLS = StringUtils.split(protocols, ',');
258+
if (StringUtils.isNotBlank(opts.getProtocols())) {
259+
PlatformUI.HTTPS_PROTOCOLS = StringUtils.split(opts.getProtocols(), ',');
309260
}
310-
if (StringUtils.isNotBlank(cipherSuites)) {
311-
PlatformUI.HTTPS_CIPHER_SUITES = StringUtils.split(cipherSuites, ',');
261+
if (StringUtils.isNotBlank(opts.getCipherSuites())) {
262+
PlatformUI.HTTPS_CIPHER_SUITES = StringUtils.split(opts.getCipherSuites(), ',');
312263
}
264+
PlatformUI.SERVER_URL = opts.getServer();
265+
PlatformUI.CLIENT_VERSION = opts.getVersion();
313266

314-
start(server, version, username, password);
267+
start(opts.getServer(), opts.getVersion(), opts.getUsername(), opts.getPassword());
315268
}
316269

317270
private static void start(final String server, final String version, final String username, final String password) {
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: 2025 Mitch Gaffigan
3+
4+
package com.mirth.connect.client.ui;
5+
6+
import static org.junit.Assert.assertEquals;
7+
8+
import org.junit.Test;
9+
10+
public class CommandLineOptionsTest {
11+
12+
@Test
13+
public void testParseSslForm() {
14+
String[] args = new String[] { "https://example:8443", "1.0", "-ssl", "TLSv1.2,TLSv1.3", "TLS_RSA_WITH_AES_128_GCM_SHA256", "alice", "secret" };
15+
CommandLineOptions opts = new CommandLineOptions(args);
16+
17+
assertEquals("https://example:8443", opts.getServer());
18+
assertEquals("1.0", opts.getVersion());
19+
assertEquals("alice", opts.getUsername());
20+
assertEquals("secret", opts.getPassword());
21+
assertEquals("TLSv1.2,TLSv1.3", opts.getProtocols());
22+
assertEquals("TLS_RSA_WITH_AES_128_GCM_SHA256", opts.getCipherSuites());
23+
}
24+
25+
@Test
26+
public void testParseUsernameFormWithSsl() {
27+
String[] args = new String[] { "https://example:8443", "1.0", "bob", "pw", "-ssl", "TLSv1.2", "CIPHER" };
28+
CommandLineOptions opts = new CommandLineOptions(args);
29+
30+
assertEquals("https://example:8443", opts.getServer());
31+
assertEquals("1.0", opts.getVersion());
32+
assertEquals("bob", opts.getUsername());
33+
assertEquals("pw", opts.getPassword());
34+
assertEquals("TLSv1.2", opts.getProtocols());
35+
assertEquals("CIPHER", opts.getCipherSuites());
36+
}
37+
38+
@Test
39+
public void testNullArgsUsesDefaults() {
40+
CommandLineOptions opts = new CommandLineOptions((String[]) null);
41+
42+
assertEquals("https://localhost:8443", opts.getServer());
43+
assertEquals("", opts.getVersion());
44+
assertEquals("", opts.getUsername());
45+
assertEquals("", opts.getPassword());
46+
assertEquals("", opts.getProtocols());
47+
assertEquals("", opts.getCipherSuites());
48+
}
49+
50+
@Test
51+
public void testNormal() {
52+
String[] args = new String[] { "https://example:8443", "1.0" };
53+
CommandLineOptions opts = new CommandLineOptions(args);
54+
55+
assertEquals("https://example:8443", opts.getServer());
56+
assertEquals("1.0", opts.getVersion());
57+
assertEquals("", opts.getUsername());
58+
assertEquals("", opts.getPassword());
59+
assertEquals("", opts.getProtocols());
60+
assertEquals("", opts.getCipherSuites());
61+
}
62+
}

command/.classpath

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
<classpathentry kind="lib" path="lib/bcpkix-jdk18on-1.78.1.jar"/>
7979
<classpathentry kind="lib" path="lib/bcprov-jdk18on-1.78.1.jar"/>
8080
<classpathentry kind="lib" path="lib/bcutil-jdk18on-1.78.1.jar"/>
81-
<classpathentry kind="lib" path="lib/commons-vfs2-2.9.0.jar"/>
82-
<classpathentry kind="lib" path="lib/jetty-util-9.4.53.v20231009.jar"/>
81+
<classpathentry kind="lib" path="lib/commons-vfs2-2.10.0.jar"/>
82+
<classpathentry kind="lib" path="lib/jetty-util-9.4.57.v20241219.jar"/>
8383
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
8484
<classpathentry kind="lib" path="lib/commons-codec-1.16.0.jar"/>
8585
<classpathentry kind="lib" path="lib/httpcore-4.4.13.jar"/>

donkey/.classpath

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@
5454
<classpathentry kind="lib" path="lib/database/ojdbc8-12.2.0.1.jar"/>
5555
<classpathentry kind="lib" path="lib/commons/commons-beanutils-1.9.4.jar"/>
5656
<classpathentry kind="lib" path="lib/database/jtds-1.3.1.jar"/>
57-
<classpathentry kind="lib" path="lib/database/mysql-connector-j-8.2.0.jar"/>
57+
<classpathentry kind="lib" path="lib/database/mysql-connector-j-8.4.0.jar"/>
5858
<classpathentry kind="lib" path="lib/HikariCP-2.5.1.jar"/>
5959
<classpathentry kind="lib" path="lib/javassist-3.26.0-GA.jar"/>
6060
<classpathentry kind="lib" path="lib/quartz-2.3.2.jar"/>
6161
<classpathentry kind="lib" path="testlib/junit-4.8.1.jar"/>
62-
<classpathentry kind="lib" path="testlib/mockito-core-2.7.9.jar"/>
63-
<classpathentry kind="lib" path="testlib/byte-buddy-1.8.8.jar"/>
64-
<classpathentry kind="lib" path="testlib/byte-buddy-agent-1.8.8.jar"/>
62+
<classpathentry kind="lib" path="testlib/mockito-core-5.1.1.jar"/>
63+
<classpathentry kind="lib" path="testlib/byte-buddy-1.14.13.jar"/>
64+
<classpathentry kind="lib" path="testlib/byte-buddy-agent-1.14.13.jar"/>
6565
<classpathentry kind="lib" path="testlib/objenesis-2.5.1.jar"/>
6666
<classpathentry kind="lib" path="testlib/javax.inject-2.4.0-b31.jar"/>
6767
<classpathentry kind="lib" path="testlib/aopalliance-repackaged-2.4.0-b31.jar"/>
@@ -70,7 +70,7 @@
7070
<classpathentry kind="lib" path="lib/guava/checker-qual-2.10.0.jar"/>
7171
<classpathentry kind="lib" path="lib/guava/error_prone_annotations-2.3.4.jar"/>
7272
<classpathentry kind="lib" path="lib/guava/failureaccess-1.0.1.jar"/>
73-
<classpathentry kind="lib" path="lib/guava/guava-28.2-jre.jar"/>
73+
<classpathentry kind="lib" path="lib/guava/guava-32.0.1-jre.jar"/>
7474
<classpathentry kind="lib" path="lib/guava/j2objc-annotations-1.3.jar"/>
7575
<classpathentry kind="lib" path="lib/guava/jsr305-3.0.2.jar"/>
7676
<classpathentry kind="lib" path="lib/guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar"/>

0 commit comments

Comments
 (0)