Select Git revision
-
Giuseppe Carboni authored
* Moved some method from GenericDerotator to SRTKBandDerotator The methods were not generic, they were specific methods of the old SRTKBandDerotator decommissioned interface. These methods are not even called by the DewarPositioner component, therefore it was safe to remove them from the GenericDerotator interface. * Moved another unused method * Updated GenericDerotator interface * Fix #865, fix #869, updated SRTMinorServo component The component now handles correctly a SETUP command. The component is also capable of commanding the gregorian air blade with the 'setGregorianAirBladeStatus' command. A few bugs were fixed here and there. This branch MUST be tested with the real hardware before merging it onto the centos_7_compatibility branch. * Fixed small bug * Removed redundant script * Uploading files in order to test a clean repository * Updated PyDewarPositioner for Python 3 * First LDO Derotators working implementation This commit also brings some clean up inside the SRT test CDB. All the stuff that is not used in the production environment has been moved out of the production and test environment and into the Outdated CDB. * KBand derotator updates * Moved SRTDerotators out of SRTMinorServoBossCore Each derotator now has its thread for updating its status
Giuseppe Carboni authored* Moved some method from GenericDerotator to SRTKBandDerotator The methods were not generic, they were specific methods of the old SRTKBandDerotator decommissioned interface. These methods are not even called by the DewarPositioner component, therefore it was safe to remove them from the GenericDerotator interface. * Moved another unused method * Updated GenericDerotator interface * Fix #865, fix #869, updated SRTMinorServo component The component now handles correctly a SETUP command. The component is also capable of commanding the gregorian air blade with the 'setGregorianAirBladeStatus' command. A few bugs were fixed here and there. This branch MUST be tested with the real hardware before merging it onto the centos_7_compatibility branch. * Fixed small bug * Removed redundant script * Uploading files in order to test a clean repository * Updated PyDewarPositioner for Python 3 * First LDO Derotators working implementation This commit also brings some clean up inside the SRT test CDB. All the stuff that is not used in the production environment has been moved out of the production and test environment and into the Outdated CDB. * KBand derotator updates * Moved SRTDerotators out of SRTMinorServoBossCore Each derotator now has its thread for updating its status
VlkbServletFile.java 4.29 KiB
//
// return content of xml
// (used for VOSI capabilityVOSI and availability.xml)
//
import java.io.IOException;
import java.io.PrintWriter;
import java.io.File;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.*; // ArrayList<String>
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletOutputStream; // for SOOA
// from vlkb_mergefiles.java - dir & file handling
import java.io.*;
import java.nio.file.*;
import static java.nio.file.StandardCopyOption.*;
// serve VOSI resources from xml files (for now implemented as strings, not files FIXME)
public class VlkbServletFile
extends javax.servlet.http.HttpServlet
{
// for logs and debug
String className = this.getClass().getSimpleName();
// VOSI
// String accessURL = null; // FIXME now read from MERGEURL later introduce own param
// String funcName = "vlkb_cutout"; // FIXME read from config file
private static final String availStr =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<vosi:availability "
+ " xmlns:vosi=\"http://www.ivoa.net/xml/VOSIAvailability/v1.0\">"
+ " <vosi:available>true</vosi:available>"
+ " <vosi:note> VLKB-SODA " + Version.asString + " is accepting queries </vosi:note>"
+ "</vosi:availability>";
private String capsStr = null;
protected void SetCapsStr(String URL, String funcName)
{
if(URL != null)
{
String accessURL = stripTrailingSlash(URL);
capsStr =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<vosi:capabilities "
+ "xmlns:vosi=\"http://www.ivoa.net/xml/VOSICapabilities/v1.0\" "
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
+ "xmlns:vod=\"http://www.ivoa.net/xml/VODataService/v1.1\">"
+ " <capability standardID=\"ivo://ivoa.net/std/VOSI#capabilities\">"
+ " <interface xsi:type=\"vod:ParamHTTP\" version=\"1.0\">"
+ " <accessURL use=\"full\">"
+ accessURL + "/capabilities"
+ " </accessURL>"
+ " </interface>"
+ " </capability>"
+ " <capability standardID=\"ivo://ivoa.net/std/VOSI#availability\">"
+ " <interface xsi:type=\"vod:ParamHTTP\" version=\"1.0\">"
+ " <accessURL use=\"full\">"
+ accessURL + "/availability"
+ " </accessURL>"
+ " </interface>"
+ " </capability>"
+ " <capability standardID=\"ivo://ivoa.net/std/SODA#sync-1.0\">"
+ " <interface xsi:type=\"vod:ParamHTTP\" role=\"std\" version=\"1.0\">"
+ " <accessURL use=\"full\">"
+ accessURL + "/" + funcName
+ " </accessURL>"
+ " </interface>"
+ " </capability>"
+ " <capability standardID=\"ivo://ivoa.net/std/SODA#async-1.0\">"
+ " <interface xsi:type=\"vod:ParamHTTP\" role=\"std\" version=\"1.0\">"
+ " <accessURL use=\"full\">"
+ accessURL + "/" + funcName + "_uws/soda_cuts"
+ " </accessURL>"
+ " </interface>"
+ " </capability>"
+ "</vosi:capabilities>";
}
}
String stripTrailingSlash(String path)
{
if (path.endsWith("/"))
return path.substring(0,path.length()-1);
else
return path;
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
StringBuffer requestURL = request.getRequestURL();
System.out.println(className + " vlkb req from: " + request.getRemoteAddr()
+ " doGet: " + requestURL.toString());
PrintWriter writer = response.getWriter();
response.setContentType("text/xml");
if(-1 != requestURL.lastIndexOf("/capabilities"))
{
String fullURL = request.getRequestURL().toString();
String baseURL = fullURL.substring(0,requestURL.lastIndexOf("/"));
SetCapsStr(baseURL, "soda");
writer.println(capsStr);
}
else if(-1 != requestURL.lastIndexOf("/availability"))
{
writer.println(availStr);
}
// error FIXME what to do if none of above given ? e.g. misconfigured web.xml
writer.close();
return;
}
}