Loading data-access/servlet/src/main/java/webapi/ServletCutout.java +0 −8 Original line number Diff line number Diff line Loading @@ -128,7 +128,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet //protected DataLink doCutoutFile(String id, Pos pos, Band band, Time time, Pol pol, String pixels, protected CutResult doCutoutFile(String id, Pos pos, Band band, Time time, Pol pol, String pixels, boolean countNullValues, String respFormat) throws IOException, InterruptedException Loading Loading @@ -174,8 +173,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet CutResult cutResult = cutout.doFile(relPathname, hdunum, pos, band, time, pol, pixels, false, null); //DataLink dlk = new DataLink(settings, cutResult, id, pos, band, time, pol, countNullValues); return cutResult; } Loading Loading @@ -286,8 +283,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet boolean countNullValues = vlkbReq_getNullValues(request); response.setContentType(respFormat); // DataLink respDataLink = doCutoutFile(id, pos, band, time, pol, pixels, countNullValues, // respFormat); CutResult cutResult = doCutoutFile(id, pos, band, time, pol, pixels, countNullValues, respFormat); Loading @@ -296,9 +291,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet PrintWriter writer =new PrintWriter(new OutputStreamWriter(respOutputStream, RESPONSE_ENCODING)); // XmlSerializer.serializeToLegacyCutResults(writer, // respEncoding, respDataLink, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); Loading data-access/servlet/src/main/java/webapi/ServletMerge.java +35 −11 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ public class ServletMerge extends javax.servlet.http.HttpServlet Band band = null; Time time = null; Pol pol = null; String pixels = null; Loading @@ -135,8 +136,6 @@ public class ServletMerge extends javax.servlet.http.HttpServlet CutResult cutResult = datasets.doMerge(parseLegacyPubdidArr(id), coord, countNullValues); DataLink dlk = new DataLink(cutResult); String contentType = respContentType; String respEncoding = RESPONSE_ENCODING; Loading @@ -144,14 +143,24 @@ public class ServletMerge extends javax.servlet.http.HttpServlet { LOGGER.info("writing xml"); PrintWriter writer = new PrintWriter(new OutputStreamWriter(respOutputStream, respEncoding)); XmlSerializer.serializeToLegacyCutResults(writer, respEncoding, dlk, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); XmlSerializer.serializeToLegacyCutResult(writer, RESPONSE_ENCODING, cutResult, accessUrl, id, pos, band, time, pol, pixels, countNullValues, showDuration, startTime_msec); writer.close(); } else if(contentType.equals("application/fits")) { LOGGER.info("streaming the file"); File downloadFile = new File(dlk.absCutPathname); String absCutPathname = cutResult.fileName; File downloadFile = new File(absCutPathname); FileInputStream input = new FileInputStream(downloadFile); input.transferTo(respOutputStream); Loading Loading @@ -217,5 +226,20 @@ public class ServletMerge extends javax.servlet.http.HttpServlet } private String convertLocalPathnameToRemoteUrl(String localPathname, String FITScutpath, String FITSRemoteUrlCutouts) { LOGGER.info("trace " + localPathname); String fileName = localPathname.replaceAll(FITScutpath + "/", ""); LOGGER.info("local filename: " + fileName); String remotefname = FITSRemoteUrlCutouts + "/" + fileName; LOGGER.info("remote url : " + remotefname); return remotefname; } } data-access/servlet/src/main/java/webapi/UWSMergeWork.java +31 −4 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class UWSMergeWork extends JobThread Band band = null; Time time = null; Pol pol = null; String pixels = null; if(parser.sodaReq_hasSodaId()) { Loading @@ -80,10 +81,9 @@ public class UWSMergeWork extends JobThread band = parser.vlkbReq_getVelocity(); } Coord coord = new Coord(DEFAULT_SKY_SYSTEM, pos, DEFAULT_SPEC_SYSTEM, band, time, pol); Coord coord = new Coord(pos, band, time, pol); CutResult cutResult = datasets.doMerge(parseLegacyPubdidArr(id), coord, false);//countNullValues); DataLink dlk = new DataLink(cutResult); final String respFormat = "text/xml";// FIXME read from param RESPONSEFORMAT ? Loading @@ -97,12 +97,22 @@ public class UWSMergeWork extends JobThread if(contentType.equals("text/xml") || contentType.equals("application/xml")) { PrintWriter writer = new PrintWriter(new OutputStreamWriter(respOutputStream, respEncoding)); XmlSerializer.serializeToLegacyCutResults(writer, respEncoding, dlk, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); XmlSerializer.serializeToLegacyCutResult(writer, RESPONSE_ENCODING, cutResult, accessUrl, id, pos, band, time, pol, pixels, false,//countNullValues, showDuration, startTime_msec); writer.close(); } else if(contentType.equals("application/fits")) { File downloadFile = new File(dlk.absCutPathname); String absCutPathname = cutResult.fileName; File downloadFile = new File(absCutPathname); FileInputStream input = new FileInputStream(downloadFile); input.transferTo(respOutputStream); downloadFile.delete(); Loading Loading @@ -130,6 +140,23 @@ public class UWSMergeWork extends JobThread } private String convertLocalPathnameToRemoteUrl(String localPathname, String FITScutpath, String FITSRemoteUrlCutouts) { LOGGER.info("trace " + localPathname); String fileName = localPathname.replaceAll(FITScutpath + "/", ""); LOGGER.info("local filename: " + fileName); String remotefname = FITSRemoteUrlCutouts + "/" + fileName; LOGGER.info("remote url : " + remotefname); return remotefname; } /* semi-colon separated list of pudids convert to arra */ private String[] parseLegacyPubdidArr(String pubdids) { Loading data-access/servlet/src/main/java/webapi/UWSSodaWork.java +15 −10 Original line number Diff line number Diff line Loading @@ -46,8 +46,6 @@ public class UWSSodaWork extends JobThread @Override protected void jobWork() throws UWSException, InterruptedException { // result.setSize(size); // FIXME how to add this? not set in ServeltCutout either (only inside DataLink) long startTime_msec = System.currentTimeMillis(); boolean showDuration = true; Loading Loading @@ -105,10 +103,6 @@ public class UWSSodaWork extends JobThread CutResult cutResult = datasets.doCutoutFile(rsl.relPathname, rsl.hdunum, pos, band, time, pol, false, null); // DataLink respDataLink = new DataLink(cutResult); // respDataLink.inputs = new Inputs(id, coord, false);//countNullValues); /* send Results */ Result result = createResult("cutout"); Loading @@ -119,8 +113,6 @@ public class UWSSodaWork extends JobThread { PrintWriter writer = new PrintWriter(new OutputStreamWriter(respOutputStream, RESPONSE_ENCODING)); // XmlSerializer.serializeToLegacyCutResults(writer, RESPONSE_ENCODING, respDataLink, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); Loading @@ -130,13 +122,12 @@ public class UWSSodaWork extends JobThread id, pos, band, time, pol, null, false, showDuration, startTime_msec); writer.close(); } else if(respContentType.equals("application/fits")) { String absCutPathname = cutResult.fileName; File downloadFile = new File(/*respDataLink.*/absCutPathname); File downloadFile = new File(absCutPathname); FileInputStream input = new FileInputStream(downloadFile); input.transferTo(respOutputStream); Loading Loading @@ -164,6 +155,20 @@ public class UWSSodaWork extends JobThread } private String convertLocalPathnameToRemoteUrl(String localPathname, String FITScutpath, String FITSRemoteUrlCutouts) { LOGGER.info("trace " + localPathname); String fileName = localPathname.replaceAll(FITScutpath + "/", ""); LOGGER.info("local filename: " + fileName); String remotefname = FITSRemoteUrlCutouts + "/" + fileName; LOGGER.info("remote url : " + remotefname); return remotefname; } /* see UWSParameters::getAdditionalParameter -> UWSParameters.java.l465: ...returned value maybe an array... */ /* Object getAdditionalParameterValue(String paramName) --> calls UWSParameters::getAdditionalParameters() */ private Map<SodaParam, String[]> collectSodaParams(UWSJob job) Loading Loading
data-access/servlet/src/main/java/webapi/ServletCutout.java +0 −8 Original line number Diff line number Diff line Loading @@ -128,7 +128,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet //protected DataLink doCutoutFile(String id, Pos pos, Band band, Time time, Pol pol, String pixels, protected CutResult doCutoutFile(String id, Pos pos, Band band, Time time, Pol pol, String pixels, boolean countNullValues, String respFormat) throws IOException, InterruptedException Loading Loading @@ -174,8 +173,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet CutResult cutResult = cutout.doFile(relPathname, hdunum, pos, band, time, pol, pixels, false, null); //DataLink dlk = new DataLink(settings, cutResult, id, pos, band, time, pol, countNullValues); return cutResult; } Loading Loading @@ -286,8 +283,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet boolean countNullValues = vlkbReq_getNullValues(request); response.setContentType(respFormat); // DataLink respDataLink = doCutoutFile(id, pos, band, time, pol, pixels, countNullValues, // respFormat); CutResult cutResult = doCutoutFile(id, pos, band, time, pol, pixels, countNullValues, respFormat); Loading @@ -296,9 +291,6 @@ public class ServletCutout extends javax.servlet.http.HttpServlet PrintWriter writer =new PrintWriter(new OutputStreamWriter(respOutputStream, RESPONSE_ENCODING)); // XmlSerializer.serializeToLegacyCutResults(writer, // respEncoding, respDataLink, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); Loading
data-access/servlet/src/main/java/webapi/ServletMerge.java +35 −11 Original line number Diff line number Diff line Loading @@ -118,6 +118,7 @@ public class ServletMerge extends javax.servlet.http.HttpServlet Band band = null; Time time = null; Pol pol = null; String pixels = null; Loading @@ -135,8 +136,6 @@ public class ServletMerge extends javax.servlet.http.HttpServlet CutResult cutResult = datasets.doMerge(parseLegacyPubdidArr(id), coord, countNullValues); DataLink dlk = new DataLink(cutResult); String contentType = respContentType; String respEncoding = RESPONSE_ENCODING; Loading @@ -144,14 +143,24 @@ public class ServletMerge extends javax.servlet.http.HttpServlet { LOGGER.info("writing xml"); PrintWriter writer = new PrintWriter(new OutputStreamWriter(respOutputStream, respEncoding)); XmlSerializer.serializeToLegacyCutResults(writer, respEncoding, dlk, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); XmlSerializer.serializeToLegacyCutResult(writer, RESPONSE_ENCODING, cutResult, accessUrl, id, pos, band, time, pol, pixels, countNullValues, showDuration, startTime_msec); writer.close(); } else if(contentType.equals("application/fits")) { LOGGER.info("streaming the file"); File downloadFile = new File(dlk.absCutPathname); String absCutPathname = cutResult.fileName; File downloadFile = new File(absCutPathname); FileInputStream input = new FileInputStream(downloadFile); input.transferTo(respOutputStream); Loading Loading @@ -217,5 +226,20 @@ public class ServletMerge extends javax.servlet.http.HttpServlet } private String convertLocalPathnameToRemoteUrl(String localPathname, String FITScutpath, String FITSRemoteUrlCutouts) { LOGGER.info("trace " + localPathname); String fileName = localPathname.replaceAll(FITScutpath + "/", ""); LOGGER.info("local filename: " + fileName); String remotefname = FITSRemoteUrlCutouts + "/" + fileName; LOGGER.info("remote url : " + remotefname); return remotefname; } }
data-access/servlet/src/main/java/webapi/UWSMergeWork.java +31 −4 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class UWSMergeWork extends JobThread Band band = null; Time time = null; Pol pol = null; String pixels = null; if(parser.sodaReq_hasSodaId()) { Loading @@ -80,10 +81,9 @@ public class UWSMergeWork extends JobThread band = parser.vlkbReq_getVelocity(); } Coord coord = new Coord(DEFAULT_SKY_SYSTEM, pos, DEFAULT_SPEC_SYSTEM, band, time, pol); Coord coord = new Coord(pos, band, time, pol); CutResult cutResult = datasets.doMerge(parseLegacyPubdidArr(id), coord, false);//countNullValues); DataLink dlk = new DataLink(cutResult); final String respFormat = "text/xml";// FIXME read from param RESPONSEFORMAT ? Loading @@ -97,12 +97,22 @@ public class UWSMergeWork extends JobThread if(contentType.equals("text/xml") || contentType.equals("application/xml")) { PrintWriter writer = new PrintWriter(new OutputStreamWriter(respOutputStream, respEncoding)); XmlSerializer.serializeToLegacyCutResults(writer, respEncoding, dlk, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); XmlSerializer.serializeToLegacyCutResult(writer, RESPONSE_ENCODING, cutResult, accessUrl, id, pos, band, time, pol, pixels, false,//countNullValues, showDuration, startTime_msec); writer.close(); } else if(contentType.equals("application/fits")) { File downloadFile = new File(dlk.absCutPathname); String absCutPathname = cutResult.fileName; File downloadFile = new File(absCutPathname); FileInputStream input = new FileInputStream(downloadFile); input.transferTo(respOutputStream); downloadFile.delete(); Loading Loading @@ -130,6 +140,23 @@ public class UWSMergeWork extends JobThread } private String convertLocalPathnameToRemoteUrl(String localPathname, String FITScutpath, String FITSRemoteUrlCutouts) { LOGGER.info("trace " + localPathname); String fileName = localPathname.replaceAll(FITScutpath + "/", ""); LOGGER.info("local filename: " + fileName); String remotefname = FITSRemoteUrlCutouts + "/" + fileName; LOGGER.info("remote url : " + remotefname); return remotefname; } /* semi-colon separated list of pudids convert to arra */ private String[] parseLegacyPubdidArr(String pubdids) { Loading
data-access/servlet/src/main/java/webapi/UWSSodaWork.java +15 −10 Original line number Diff line number Diff line Loading @@ -46,8 +46,6 @@ public class UWSSodaWork extends JobThread @Override protected void jobWork() throws UWSException, InterruptedException { // result.setSize(size); // FIXME how to add this? not set in ServeltCutout either (only inside DataLink) long startTime_msec = System.currentTimeMillis(); boolean showDuration = true; Loading Loading @@ -105,10 +103,6 @@ public class UWSSodaWork extends JobThread CutResult cutResult = datasets.doCutoutFile(rsl.relPathname, rsl.hdunum, pos, band, time, pol, false, null); // DataLink respDataLink = new DataLink(cutResult); // respDataLink.inputs = new Inputs(id, coord, false);//countNullValues); /* send Results */ Result result = createResult("cutout"); Loading @@ -119,8 +113,6 @@ public class UWSSodaWork extends JobThread { PrintWriter writer = new PrintWriter(new OutputStreamWriter(respOutputStream, RESPONSE_ENCODING)); // XmlSerializer.serializeToLegacyCutResults(writer, RESPONSE_ENCODING, respDataLink, showDuration, startTime_msec); String accessUrl = convertLocalPathnameToRemoteUrl(cutResult.fileName, settings.fitsPaths.cutouts(), settings.fitsPaths.cutoutsUrl()); Loading @@ -130,13 +122,12 @@ public class UWSSodaWork extends JobThread id, pos, band, time, pol, null, false, showDuration, startTime_msec); writer.close(); } else if(respContentType.equals("application/fits")) { String absCutPathname = cutResult.fileName; File downloadFile = new File(/*respDataLink.*/absCutPathname); File downloadFile = new File(absCutPathname); FileInputStream input = new FileInputStream(downloadFile); input.transferTo(respOutputStream); Loading Loading @@ -164,6 +155,20 @@ public class UWSSodaWork extends JobThread } private String convertLocalPathnameToRemoteUrl(String localPathname, String FITScutpath, String FITSRemoteUrlCutouts) { LOGGER.info("trace " + localPathname); String fileName = localPathname.replaceAll(FITScutpath + "/", ""); LOGGER.info("local filename: " + fileName); String remotefname = FITSRemoteUrlCutouts + "/" + fileName; LOGGER.info("remote url : " + remotefname); return remotefname; } /* see UWSParameters::getAdditionalParameter -> UWSParameters.java.l465: ...returned value maybe an array... */ /* Object getAdditionalParameterValue(String paramName) --> calls UWSParameters::getAdditionalParameters() */ private Map<SodaParam, String[]> collectSodaParams(UWSJob job) Loading