Skip to content

Commit

Permalink
Merge pull request payara#584 from kalinchan/FISH-6263-P4
Browse files Browse the repository at this point in the history
FISH-6263 Upgrade Smack to version 4.3.4 P4
  • Loading branch information
kalinchan authored May 16, 2022
2 parents 27b1f4f + 8aa5243 commit 228fabf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
10 changes: 10 additions & 0 deletions appserver/packager/notification-xmpp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@
<artifactId>org.apache.servicemix.bundles.xpp3</artifactId>
<version>${xpp3.version}</version>
</dependency>
<dependency>
<groupId>org.jxmpp</groupId>
<artifactId>jxmpp-jid</artifactId>
<version>${jxmpp.version}</version>
</dependency>
<dependency>
<groupId>org.minidns</groupId>
<artifactId>minidns-core</artifactId>
<version>${minidns.version}</version>
</dependency>
</dependencies>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void execute(AdminCommandContext context) {
.setSecurityMode(options.getSecurityDisabled()
? ConnectionConfiguration.SecurityMode.disabled
: ConnectionConfiguration.SecurityMode.required)
.setServiceName(options.getServiceName())
.setXmppDomain(options.getServiceName())
.setHost(options.getHost())
.setPort(options.getPort())
.build();
Expand All @@ -181,7 +181,7 @@ public void execute(AdminCommandContext context) {
} else {
connection.login();
}
} catch (SmackException | IOException | XMPPException ex) {
} catch (SmackException | IOException | XMPPException | InterruptedException ex) {
actionReport.setMessage(ex.getMessage());
actionReport.setActionExitCode(ActionReport.ExitCode.FAILURE);
queue.resetQueue();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) [2016-2017] Payara Foundation and/or its affiliates. All rights reserved.
* Copyright (c) [2016-2022] Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -46,6 +46,9 @@
import org.jivesoftware.smack.tcp.XMPPTCPConnection;
import org.jivesoftware.smackx.muc.MultiUserChat;
import org.jivesoftware.smackx.muc.MultiUserChatManager;
import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.jid.parts.Resourcepart;
import org.jxmpp.stringprep.XmppStringprepException;

import java.util.logging.Level;
import java.util.logging.Logger;
Expand All @@ -70,10 +73,10 @@ public void run() {
try {
XmppMessage xmppMessage = queue.getMessage();
MultiUserChatManager manager = MultiUserChatManager.getInstanceFor(connection);
MultiUserChat multiUserChat = manager.getMultiUserChat(executionOptions.getRoomId() + "@" + executionOptions.getServiceName());
MultiUserChat multiUserChat = manager.getMultiUserChat(JidCreate.entityBareFrom(executionOptions.getRoomId() + "@" + executionOptions.getServiceName()));
if (multiUserChat != null) {
if (!multiUserChat.isJoined()) {
multiUserChat.join(executionOptions.getUsername(), executionOptions.getPassword());
multiUserChat.join(Resourcepart.from(executionOptions.getUsername()), executionOptions.getPassword());
}

Message message = new Message();
Expand All @@ -84,7 +87,7 @@ public void run() {
}
logger.log(Level.FINE, "Message sent successfully");
}
catch (XMPPException | SmackException e) {
catch (XMPPException | SmackException | XmppStringprepException | InterruptedException e) {
logger.log(Level.SEVERE, "Error occurred while sending message to room", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void bootstrap() {
.setSecurityMode(executionOptions.getSecurityDisabled() ?
ConnectionConfiguration.SecurityMode.disabled :
ConnectionConfiguration.SecurityMode.required)
.setServiceName(executionOptions.getServiceName())
.setXmppDomain(executionOptions.getServiceName())
.setHost(executionOptions.getHost())
.setPort(executionOptions.getPort())
.build();
Expand All @@ -111,6 +111,8 @@ public void bootstrap() {
}
catch (IOException e) {
logger.log(Level.SEVERE, "IO Error occurred while connecting host", e);
} catch (InterruptedException e) {
logger.log(Level.SEVERE, "InterruptedException occurred while connecting host", e);
}
}

Expand Down
5 changes: 3 additions & 2 deletions nucleus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,9 @@
<mail.version>1.6.2.payara-p1</mail.version>
<javax.annotation-api.version>1.2</javax.annotation-api.version>
<hazelcast.version>3.11.1</hazelcast.version>
<smack.version>4.1.9</smack.version>
<jxmpp.version>0.4.2</jxmpp.version>
<smack.version>4.3.4</smack.version>
<jxmpp.version>0.6.4</jxmpp.version>
<minidns.version>0.3.4</minidns.version>
<xpp3.version>1.1.4c_7</xpp3.version>
<snmp4j.version>2.5.3-payara.p1</snmp4j.version>
<mockito.version>2.2.6</mockito.version>
Expand Down

0 comments on commit 228fabf

Please sign in to comment.