Skip to content

Commit

Permalink
Revert "Implement custom properties for Tibco classes (#7237)"
Browse files Browse the repository at this point in the history
This reverts commit 6dc7f42.
  • Loading branch information
nielsm5 authored Aug 2, 2024
1 parent 6dc7f42 commit 44c33a8
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ protected synchronized void load(final ClassLoader classLoader, final String fil
List<URL> resources = Collections.list(classLoader.getResources(filename));
if(resources.isEmpty()) {
if(rootPropertyFile.equals(filename)) { //The file cannot be found, abort!
String msg = rootPropertyFile+ " file not found, unable to initialize PropertyLoader";
String msg = rootPropertyFile+ " file not found, unable to initalize AppConstants";
LOG.error(msg);
throw new MissingResourceException(msg, this.getClass().getSimpleName(), rootPropertyFile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@
*/
package org.frankframework.extensions.tibco;

import java.io.IOException;
import java.net.InetAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.time.Instant;
import java.util.Collection;

import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedList;
Expand Down Expand Up @@ -95,25 +92,13 @@ public class GetTibcoQueues extends TimeoutGuardPipe {
private boolean skipTemporaryQueues = false;
private boolean hideMessage = false;
private String queueRegex;
private String emsPropertiesFile;
private Map<String, Object> emsProperties;

@Override
public void configure() throws ConfigurationException {
if (getParameterList() != null && getParameterList().hasParameter("userName")) {
ConfigurationWarnings.add(this, log, "parameter [userName] has been replaced with [username]");
}

if(StringUtils.isNotEmpty(emsPropertiesFile)) {
try {
emsProperties = new TibcoEmsProperties(this, emsPropertiesFile);
} catch (IOException e) {
throw new ConfigurationException("unable to find/load the EMS properties file", e);
}
} else {
emsProperties = Collections.emptyMap();
}

super.configure();
}

Expand Down Expand Up @@ -158,7 +143,7 @@ public PipeRunResult doPipeWithTimeoutGuarded(Message input, PipeLineSession ses
Session jSession;
TibjmsAdmin admin = null;
try {
admin = TibcoUtils.getActiveServerAdmin(url_work, cf, emsProperties);
admin = TibcoUtils.getActiveServerAdmin(url_work, cf);
if (admin == null) {
throw new PipeRunException(this, "could not find an active server");
}
Expand All @@ -178,7 +163,7 @@ public PipeRunResult doPipeWithTimeoutGuarded(Message input, PipeLineSession ses
}
}

ConnectionFactory factory = new com.tibco.tibjms.TibjmsConnectionFactory(url_work, null, emsProperties);
ConnectionFactory factory = new com.tibco.tibjms.TibjmsConnectionFactory(url_work);
connection = factory.createConnection(cf.getUsername(), cf.getPassword());
jSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Expand Down Expand Up @@ -676,9 +661,4 @@ public String getQueueRegex() {
public void setQueueRegex(String string) {
queueRegex = string;
}

/** Location to a <code>jndi.properties</code> file for additional EMS (SSL) properties */
public void setEmsPropertiesFile(String propertyFile) {
emsPropertiesFile = propertyFile;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.Map;

import com.tibco.tibjms.admin.QueueInfo;
import com.tibco.tibjms.admin.TibjmsAdmin;
Expand Down Expand Up @@ -78,8 +76,6 @@ public class SendTibcoMessage extends TimeoutGuardPipe {
private MessageProtocol messageProtocol;
private int replyTimeout = 5000;
private String soapAction;
private String emsPropertiesFile;
private Map<String, Object> emsProperties;

public enum MessageProtocol implements DocumentedEnum {
/** Request-Reply */
Expand All @@ -94,16 +90,6 @@ public void configure() throws ConfigurationException {
ConfigurationWarnings.add(this, log, "parameter [userName] has been replaced with [username]");
}

if(StringUtils.isNotEmpty(emsPropertiesFile)) {
try {
emsProperties = new TibcoEmsProperties(this, emsPropertiesFile);
} catch (IOException e) {
throw new ConfigurationException("unable to find/load the EMS properties file", e);
}
} else {
emsProperties = Collections.emptyMap();
}

super.configure();
}

Expand Down Expand Up @@ -204,7 +190,7 @@ public PipeRunResult doPipeWithTimeoutGuarded(Message input, PipeLineSession ses
try {
TibjmsAdmin admin;
try {
admin = TibcoUtils.getActiveServerAdmin(url_work, cf, emsProperties);
admin = TibcoUtils.getActiveServerAdmin(url_work, cf);
} catch (TibjmsAdminException e) {
log.debug("caught exception", e);
admin = null;
Expand All @@ -227,7 +213,7 @@ public PipeRunResult doPipeWithTimeoutGuarded(Message input, PipeLineSession ses
}
}

ConnectionFactory factory = new com.tibco.tibjms.TibjmsConnectionFactory(url_work, null, emsProperties); //url, clientid, properties
ConnectionFactory factory = new com.tibco.tibjms.TibjmsConnectionFactory(url_work);
connection = factory.createConnection(cf.getUsername(), cf.getPassword());
jSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
destination = jSession.createQueue(queueName_work);
Expand Down Expand Up @@ -367,9 +353,4 @@ public void setSoapAction(String string) {
public String getSoapAction() {
return soapAction;
}

/** Location to a <code>jndi.properties</code> file for additional EMS (SSL) properties */
public void setEmsPropertiesFile(String propertyFile) {
emsPropertiesFile = propertyFile;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.frankframework.extensions.tibco;

import java.util.Enumeration;
import java.util.Map;

import jakarta.jms.Connection;
import jakarta.jms.ConnectionFactory;
Expand Down Expand Up @@ -213,7 +212,8 @@ protected static long getQueueMessageCount(Session jSession,
}
}

protected static TibjmsAdmin getActiveServerAdmin(String url, CredentialFactory cf, Map<String, Object> connectionProperties) throws TibjmsAdminException {
protected static TibjmsAdmin getActiveServerAdmin(String url,
CredentialFactory cf) throws TibjmsAdminException {
TibjmsAdminException lastException = null;
TibjmsAdmin admin = null;
String[] uws = url.split(",");
Expand All @@ -227,7 +227,7 @@ protected static TibjmsAdmin getActiveServerAdmin(String url, CredentialFactory
// following exception:
// com.tibco.tibjms.admin.TibjmsAdminException: Unable to connect to server. Root cause:
// jakarta.jms.ResourceAllocationException: too many open connections
admin = new TibjmsAdmin(uw, cf.getUsername(), cf.getPassword(), connectionProperties);
admin = new TibjmsAdmin(uw, cf.getUsername(), cf.getPassword());
// The next line of code has been reported to throw the
// following exception:
// com.tibco.tibjms.admin.TibjmsAdminSecurityException: Command unavailable on a server not in active state and using a JSON configuration file
Expand Down

This file was deleted.

14 changes: 0 additions & 14 deletions tibco/src/test/resources/jndi.properties

This file was deleted.

16 changes: 0 additions & 16 deletions tibco/src/test/resources/log4j4ibis.xml

This file was deleted.

0 comments on commit 44c33a8

Please sign in to comment.