Commit 6fde5596 authored by Michael Ritter's avatar Michael Ritter
Browse files

Add a default for ssl connection when communicating with the IMS

parent c301e50d
......@@ -30,20 +30,19 @@
// $Id$
package edu.umiacs.ace.monitor.audit;
import edu.umiacs.ace.monitor.settings.SettingsUtil;
import edu.umiacs.ace.driver.StorageDriver;
import edu.umiacs.ace.driver.StorageDriverFactory;
import edu.umiacs.ace.util.PersistUtil;
import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.monitor.core.ConfigConstants;
import edu.umiacs.ace.monitor.core.MonitoredItem;
import edu.umiacs.ace.monitor.settings.SettingsConstants;
import edu.umiacs.ace.monitor.settings.SettingsParameter;
import edu.umiacs.ace.monitor.settings.SettingsUtil;
import edu.umiacs.ace.util.PersistUtil;
import edu.umiacs.util.Strings;
import org.apache.log4j.Logger;
import org.apache.log4j.NDC;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.NoResultException;
......@@ -51,8 +50,9 @@ import javax.persistence.Query;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import org.apache.log4j.Logger;
import org.apache.log4j.NDC;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
/**
* Set the IMS for the AuditThread to use. Also, startup a background task
......
......@@ -94,7 +94,7 @@ public class AuditThreadFactory {
}
public static void setImsPort( int imsPort ) {
if ( imsPort > 1 && imsPort < 32768 ) {
if ( imsPort < 1 && imsPort > 32768 ) {
LOG.error("ims port must be between 1 and 32768");
return;
}
......
......@@ -32,17 +32,18 @@ package edu.umiacs.ace.monitor.audit;
import edu.umiacs.ace.driver.StorageDriver;
import edu.umiacs.ace.driver.StorageDriverFactory;
import edu.umiacs.ace.util.EntityManagerServlet;
import edu.umiacs.ace.monitor.core.MonitoredItem;
import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.monitor.core.MonitoredItem;
import edu.umiacs.ace.util.EntityManagerServlet;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
*
......
......@@ -2,6 +2,11 @@ package edu.umiacs.ace.monitor.settings;
import edu.umiacs.ace.util.PersistUtil;
import edu.umiacs.sql.SQL;
import org.apache.log4j.NDC;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
......@@ -9,10 +14,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.sql.DataSource;
import org.apache.log4j.NDC;
/**
*
......@@ -24,7 +25,7 @@ public class SettingsMigrationContextListener implements ServletContextListener{
Connection conn = null;
boolean migrated;
NDC.push("[MIGRATION]");
NDC.push("[MIGRATION-SETTINGS]");
DataSource ds = PersistUtil.getDataSource();
try {
......@@ -36,12 +37,13 @@ public class SettingsMigrationContextListener implements ServletContextListener{
} catch (SQLException ex) {
Logger.getLogger(SettingsMigrationContextListener.class.getName())
.log(Level.SEVERE, null, ex);
} finally {
NDC.pop();
}
if (conn != null) {
SQL.release(conn);
}
NDC.pop();
}
public void contextDestroyed(ServletContextEvent sce) {
......
......@@ -5,14 +5,14 @@ import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.monitor.reporting.SchedulerContextListener;
import edu.umiacs.ace.util.PersistUtil;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
*
......@@ -121,6 +121,8 @@ public class SettingsUtil {
SettingsConstants.ims,false));
defaults.add(new SettingsParameter(SettingsConstants.PARAM_IMS_PORT,
SettingsConstants.imsPort,false));
defaults.add(new SettingsParameter(SettingsConstants.PARAM_IMS_SSL,
SettingsConstants.imsSSL,false));
defaults.add(new SettingsParameter(SettingsConstants.PARAM_IMS_TOKEN_CLASS,
SettingsConstants.imsTokenClass,false));
defaults.add(new SettingsParameter(SettingsConstants.PARAM_DISABLE_AUTO_AUDIT,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment