package oracle.otnsamples.ibfbs.utils;
import java.util.Properties;
import oracle.otnsamples.ibfbs.utils.FileUtils;
public class ConnectionParams {
public static String proxyHost = null;
public static String proxyPort = null;
public static String smtpHost = null;
public static String googleSearchKey = null;
public static String endpointURL = null;
public static String notificationMailId = null;
public final static String alertQueue = "jms/AlertQueue";
public final static String alertQueueConnFactory = "jms/AlertQueueConnectionFactory";
public final static String exchangeQueue = "jms/ExchangeQueue";
public final static String exchangeQueueConnFactory = "jms/ExchangeQueueConnectionFactory";
static {
if (endpointURL == null) {
Properties conValues = null;
try {
conValues = FileUtils.loadParams("Connection");
proxyHost = (String) conValues.getProperty("PROXY_HOST");
proxyPort = (String) conValues.getProperty("PROXY_PORT");
googleSearchKey = (String) conValues.getProperty("GOOGLE_KEY");
smtpHost = (String) conValues.getProperty("SMTP_HOST");
endpointURL =
(String) conValues.getProperty("ENDPOINTURL");
notificationMailId =
(String) conValues.getProperty("UPLOADSTATUSNOTIFICATIONMAILID");
} catch (Exception ex) {
System.out.println(" Fatal Error : Couldn't Read Properties file : "
+ ex.toString());
endpointURL = "http://localhost:8888/fbsws/StockQuoteServicePort";
} finally {
if (proxyHost != null && !"".equals(proxyHost)) {
Properties sysProps = System.getProperties();
sysProps.put("proxySet", "true");
sysProps.put("proxyHost", proxyHost);
sysProps.put("proxyPort", proxyPort);
sysProps.put("http.proxyHost", proxyHost);
sysProps.put("http.proxyPort", proxyPort);
sysProps.put("mail.smtp.host", smtpHost);
System.setProperties(sysProps);
}
conValues.clear();
conValues = null;
}
}
}
}