Skip to content
Snippets Groups Projects
Commit 2ddf897f authored by Robert Butora's avatar Robert Butora
Browse files

cutout: removes from settings 'defaults'

parent ced498fe
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ class Settings
}
// DEPRECATED used only in Resolver / resolveByDb
public static class DBConn
{
private String uri;
......@@ -57,15 +58,7 @@ class Settings
}
public static class DefaultParamValues
{
String responseFormat;
String skySystem;
String specSystem;
boolean showDuration;
}
// DEPRECATED
public static class AmqpConn
{
private String hostName;
......@@ -90,7 +83,6 @@ class Settings
public FITSPaths fitsPaths;
public DBConn dbConn;
public AmqpConn amqpConn;
public DefaultParamValues defaults;
// will not start without config-file
......@@ -111,9 +103,8 @@ class Settings
FITSPaths fitsPaths = loadFITSPaths(properties);
DBConn dbConn = loadDBConn(properties);
AmqpConn amqpConn = loadAmqpConn(properties);
DefaultParamValues defaults = loadDefaults(properties);
return new Settings(dbConn, amqpConn, fitsPaths, defaults);
return new Settings(dbConn, amqpConn, fitsPaths);
}
else
{
......@@ -130,12 +121,11 @@ class Settings
private Settings(DBConn dbConn, AmqpConn amqpConn,
FITSPaths fitsPaths, DefaultParamValues defaults)
FITSPaths fitsPaths)
{
this.fitsPaths = fitsPaths;
this.dbConn = dbConn;
this.amqpConn = amqpConn;
this.defaults = defaults;
}
......@@ -147,7 +137,6 @@ class Settings
fitspaths.FITScutpath = properties.getProperty("fits_path_cutouts", "/srv/cutouts").strip();
fitspaths.FITSRemoteUrlCutouts = properties.getProperty("fits_url_cutouts", "").strip();
fitspaths.surveysMetadataAbsPathname = properties.getProperty("surveys_metadata_abs_pathname", "").strip();
//fitspaths.surveysMetadataAbsPathname = properties.getProperty("surveys_metadata_abs_pathname", "/srv/surveys/survey_populate.csv").strip();
return fitspaths;
}
......@@ -161,16 +150,6 @@ class Settings
return dbconn;
}
private static DefaultParamValues loadDefaults(Properties properties)
{
DefaultParamValues defaults = new DefaultParamValues();
defaults.responseFormat = properties.getProperty("default_response_format", "application/fits").strip();
defaults.skySystem = properties.getProperty("default_sky_system", "ICRS").strip();
defaults.specSystem = properties.getProperty("default_spec_system", "WAVE_Barycentric").strip();
defaults.showDuration = "yes".equals(properties.getProperty("show_duration", "no").strip());
return defaults;
}
private static AmqpConn loadAmqpConn(Properties properties)
{
AmqpConn amqpconn = new AmqpConn();
......
......@@ -56,17 +56,13 @@ public class ServletCutout extends HttpServlet
protected boolean useEngineOverCli = settings.amqpConn.isHostnameEmpty();
final String RESPONSE_ENCODING = "utf-8";
final String DEFAULT_RESPONSEFORMAT = settings.defaults.responseFormat;
// final String DEFAULT_SKY_SYSTEM = settings.defaults.skySystem;
// final String DEFAULT_SPEC_SYSTEM = settings.defaults.specSystem;
// final String DEFAULT_TIME_SYSTEM = "MJD_UTC"; // FIXME take from confif file
final String DEFAULT_RESPONSEFORMAT = "application/fits";
public void init() throws ServletException
{
LOGGER.config("FITS : " + settings.fitsPaths.toString());
if(subsurveys != null)
LOGGER.config("Subsurveys loaded : " + String.valueOf(subsurveys.length));
// LOGGER.config("DEFAULT SKY/SPEC/TIME SYSTEM : " + DEFAULT_SKY_SYSTEM + " / " + DEFAULT_SPEC_SYSTEM + " / " + DEFAULT_TIME_SYSTEM);
LOGGER.config("DEFAULT_RESPONSEFORMAT : " + DEFAULT_RESPONSEFORMAT);
LOGGER.config("Resolver : " + (resolveFromId ? "IVOID" : "DB"));
LOGGER.config("Engine : " + (useEngineOverCli ? "CLI" : "AMQP"));
......@@ -229,7 +225,6 @@ public class ServletCutout extends HttpServlet
throws ServletException, IOException, UnsupportedEncodingException
{
boolean showDuration = settings.defaults.showDuration;
long startTime_msec = System.currentTimeMillis();
long startTime_nsec = System.nanoTime();
......@@ -257,6 +252,7 @@ public class ServletCutout extends HttpServlet
}
else if(respFormat.startsWith("application/x-vlkb+xml"))
{
boolean showDuration = true;
boolean countNullValues = vlkbReq_getNullValues(request);
response.setContentType(respFormat);
......
......@@ -30,8 +30,6 @@ public class UWSMergeWork extends JobThread
private Settings settings = UWSMerge.settings;
final String RESPONSE_ENCODING = "utf-8";
final String DEFAULT_RESPONSEFORMAT = settings.defaults.responseFormat;
final String DEFAULT_TIME_SYSTEM = "MJD_UTC";
protected Vlkb vlkb = ( settings.amqpConn.isHostnameEmpty() ? new VlkbCli(settings): new VlkbAmqp(settings) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment