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

adds maven build; updates vlkb-volib to 0.9.5; disables legacy-param parsing in MCutout json-JDL

parent 40d759ea
No related branches found
No related tags found
No related merge requests found
Showing
with 412 additions and 37 deletions
mvn install:install-file \
-Dfile="../java-libs/lib/auth-lib-2.0.0-SNAPSHOT.jar" \
-DgroupId=auth \
-DartifactId=auth-lib \
-Dversion=2.0.0-SNAPSHOT \
-Dpackaging=jar \
-DgeneratePom=true
mvn install:install-file \
-Dfile="../java-libs/lib/rap-client-1.0-SNAPSHOT.jar" \
-DgroupId=auth \
-DartifactId=rap-client \
-Dversion=1.0-SNAPSHOT \
-Dpackaging=jar \
-DgeneratePom=true
mvn install:install-file \
-Dfile=target/vlkb-auth-0.1-SNAPSHOT.jar \
-DgroupId=auth \
-DartifactId=vlkb-auth \
-Dversion=0.1-SNAPSHOT \
-Dpackaging=jar \
-DgeneratePom=true
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>auth</groupId>
<artifactId>vlkb-auth</artifactId>
<packaging>jar</packaging>
<version>x.y.z</version>
<name>vlkb-auth Maven library</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.7</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-core -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.4.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-jackson -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.12.3</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.12.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.12.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt -->
<!-- dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.12.3</version>
</dependency -->
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>auth</groupId>
<artifactId>auth-lib</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>auth</groupId>
<artifactId>rap-client</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${git.buildnumber}</finalName>
<plugins>
<plugin>
<groupId>ru.concerteza.buildnumber</groupId>
<artifactId>maven-jgit-buildnumber-plugin</artifactId>
<version>1.2.7</version>
<executions>
<execution>
<id>git-buildnumber</id>
<goals>
<goal>extract-buildnumber</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<fork>true</fork>
<executable>/etc/alternatives/javac</executable>
<compilerArgument>-Xlint:unchecked</compilerArgument>
</configuration>
</plugin>
<!-- plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin -->
</plugins>
</build>
</project>
......@@ -38,7 +38,7 @@ import io.jsonwebtoken.Jwt;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.JwsHeader;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.jackson.io.JacksonDeserializer;
//import io.jsonwebtoken.jackson.io.JacksonDeserializer;
import io.jsonwebtoken.SigningKeyResolverAdapter;
import io.jsonwebtoken.security.Jwk;
import io.jsonwebtoken.security.Jwks;
......
......@@ -6,7 +6,7 @@ import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwt;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.jackson.io.JacksonDeserializer;
//import io.jsonwebtoken.jackson.io.JacksonDeserializer;
import java.security.spec.InvalidKeySpecException;
import java.security.NoSuchAlgorithmException;
......
......@@ -37,7 +37,7 @@ import io.jsonwebtoken.Jwt;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.JwsHeader;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.jackson.io.JacksonDeserializer;
//import io.jsonwebtoken.jackson.io.JacksonDeserializer;
import io.jsonwebtoken.SigningKeyResolverAdapter;
// only dbg: when keys taken from file, not URL
......
......@@ -6,7 +6,7 @@ import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwt;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.jackson.io.JacksonDeserializer;
//import io.jsonwebtoken.jackson.io.JacksonDeserializer;
import java.security.spec.InvalidKeySpecException;
import java.security.NoSuchAlgorithmException;
......
#!/bin/bash
VERSION=$(git describe)
echo "class Version { static String asString = \"${VERSION}\";}" > src/main/java/webapi/Version.java
mvn package
#JAVA_HOME=/usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc38.x86_64 mvn package
# java show class version:
# find . -name "*.class" -exec file -b {} \; | awk -F',' '{print $NF}' | sort -u
#!/bin/bash
rm -f src/main/java/webapi/Version.java
mvn clean
JARFILE=../../java-libs/lib/fits.jar
mvn install:install-file \
-Dfile="$JARFILE" \
-DgroupId=nom \
-DartifactId=tam-fits \
-Dversion=1.0 \
-Dpackaging=jar \
-DgeneratePom=true
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>vlkb</groupId>
<artifactId>vlkb-soda</artifactId>
<packaging>war</packaging>
<version>x.y.z</version>
<name>SODA webapp</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-compress -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.26.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.opencsv/opencsv -->
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>5.7.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.rabbitmq/amqp-client -->
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>3.6.6</version>
</dependency>
<!-- dependency>
<groupId>uk.ac.starlink</groupId>
<artifactId>stil</artifactId>
<version>4.3</version>
</dependency -->
<!-- vlkb-volib and its dependencies -->
<dependency>
<groupId>vo</groupId>
<artifactId>uws</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>vo</groupId>
<artifactId>vlkb-volib</artifactId>
<version>0.9.5</version>
</dependency>
<dependency>
<groupId>auth</groupId>
<artifactId>vlkb-auth</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
<!-- needed in Regrid for merge -->
<dependency>
<groupId>nom</groupId>
<artifactId>tam-fits</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${git.buildnumber}</finalName>
<plugins>
<plugin>
<groupId>ru.concerteza.buildnumber</groupId>
<artifactId>maven-jgit-buildnumber-plugin</artifactId>
<version>1.2.7</version>
<executions>
<execution>
<id>git-buildnumber</id>
<goals>
<goal>extract-buildnumber</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<!-- verbose>true</verbose -->
<fork>true</fork>
<executable>/etc/alternatives/javac</executable>
<compilerArgument>-Xlint:unchecked</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
</project>
......@@ -85,16 +85,18 @@ class CutArgs
// FIXME first check if array (or null?) and then cast
String defaultPosSystem = "GALACTIC";
Pos pos = Pos.parsePosCirclePolygonFromJson(jElem.toString(), defaultPosSystem);
Pos pos = Pos.parsePosCirclePolygonFromJson(jElem, defaultPosSystem);
args.pos = pos;
String defaultBandSystem = "VELO_LSRK";
Band band = Band.parseBandFromJson(jElem.toString(), defaultBandSystem);
Band band = Band.parseBandFromJson(jElem, defaultBandSystem);
args.band = band;
// TBD: * legacy is parsed inside POS and BAND, not here -> do modif
// * still missing TIME and POL and ID and (?)countNullValues
LOGGER.warning("VLKB: legacy param parasing from MCutout jsodn-JDL disbaled");
/* FIXME removes VLKB_legacy param parsing from MCutout JDL
// FIXME explicit converions: check if exists and then check type first
JSONObject jCoord = (JSONObject) jElem.get("coord");
......@@ -114,8 +116,8 @@ class CutArgs
}
// FIXME missing:
String skySystem = "GALACTIC";
String specSystem = "VELO_LSRK";
Pos.System skySystem = Pos.System.GALACTIC;//"GALACTIC";
Band.System specSystem = Band.System.VELO_LSRK;//"VELO_LSRK";
// convert:
......@@ -138,7 +140,7 @@ class CutArgs
{
args.band = new Band(args.vl, args.vu, specSystem);
}
*/
argsList.add(args);
}
}
......
......@@ -89,9 +89,11 @@ class SodaImpl implements Soda
{
boundsString = new String(bos.toByteArray());
/* FIXME disable GRID not supported
boundsString = replaceWithGrid(boundsString, pos, band, time, pol);
LOGGER.finest("boundsString(with GRID): " + boundsString);
*/
LOGGER.warning("GRID support was disabled");
has_overlap = !((boundsString != null) && boundsString.trim().isEmpty());
if( !has_overlap )
......@@ -183,8 +185,8 @@ class SodaImpl implements Soda
if(band != null)
{
String specSystem = band.system.name();
double vl = band.getMin();
double vu = band.getMax();
double vl = band.min;
double vu = band.max;
region =region + "specsystem=" + specSystem + "&vl=" + String.valueOf(vl) + "&vu=" + String.valueOf(vu);
}
......@@ -192,7 +194,7 @@ class SodaImpl implements Soda
return region;
}
/*
private String replaceWithGrid(String wcsBounds, Pos pos, Band band, Time time, Pol pol)
{
// remove end-of-line (was added by vlkb_ast.cpp: cout << ... << endl)
......@@ -263,6 +265,6 @@ class SodaImpl implements Soda
LOGGER.finest("normalize: " + other);
return other.split("\\s+");
}
*/
}
......@@ -57,8 +57,8 @@ public class JsonEncoder
j.put("system", band.system.toString());
JSONArray arr = new JSONArray();
arr.add(band.getMin());
arr.add(band.getMax());
arr.add(band.min);
arr.add(band.max);
j.put("interval",arr);
this.obj.put("band", j);
......@@ -74,8 +74,8 @@ public class JsonEncoder
j.put("system", time.system.toString());
JSONArray arr = new JSONArray();
arr.add(time.getMin());
arr.add(time.getMax());
arr.add(time.min);
arr.add(time.max);
j.put("interval",arr);
this.obj.put("time", j);
......
......@@ -86,16 +86,16 @@ public class JsonEncoderMerge
private static JSONArray arrJBand(Band band)
{
JSONArray arr = new JSONArray();
arr.add(band.getMin());
arr.add(band.getMax());
arr.add(band.min);
arr.add(band.max);
return arr;
}
private static JSONArray genTimeJsonArr(Time time)
{
JSONArray arr = new JSONArray();
arr.add(time.getMin());
arr.add(time.getMax());
arr.add(time.min);
arr.add(time.max);
return arr;
}
......
......@@ -57,16 +57,16 @@ public class ServletCutout extends HttpServlet
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_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
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 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"));
......@@ -240,9 +240,9 @@ public class ServletCutout extends HttpServlet
Map<String, String[]> params = request.getParameterMap();
String id = SingleStringParam.parseSingleStringParam(params, "ID");
Pos pos = Pos.parsePos(params, DEFAULT_SKY_SYSTEM);
Band band = Band.parseBand(params, DEFAULT_SPEC_SYSTEM);
Time time = Time.parseTime(params, DEFAULT_TIME_SYSTEM);
Pos pos = Pos.parsePos(params);
Band band = Band.parseBand(params);
Time time = Time.parseTime(params);
Pol pol = Pol.parsePol(params);
String pixels = SingleStringParam.parseSingleStringParam(params, "PIXELS");
......
......@@ -31,8 +31,6 @@ public class UWSMergeWork extends JobThread
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";
protected Vlkb vlkb = ( settings.amqpConn.isHostnameEmpty() ? new VlkbCli(settings): new VlkbAmqp(settings) );
......@@ -61,9 +59,9 @@ public class UWSMergeWork extends JobThread
Map<String, String[]> params = collectSodaParams(job);
String id = SingleStringParam.parseSingleStringParam(params, "ID");
Pos pos = Pos.parsePos(params, DEFAULT_SKY_SYSTEM);
Band band = Band.parseBand(params, DEFAULT_SPEC_SYSTEM);
Time time = Time.parseTime(params, DEFAULT_TIME_SYSTEM);
Pos pos = Pos.parsePos(params);
Band band = Band.parseBand(params);
Time time = Time.parseTime(params);
Pol pol = null;// FIXME Pol.parsePol(params);
String pixels = SingleStringParam.parseSingleStringParam(params, "PIXELS");
......
......@@ -149,8 +149,8 @@ public final class XmlSerializer
if(coord.band != null)
{
xml.append("<vl>" + String.valueOf(coord.band.getMin()) +"</vl>");
xml.append("<vu>" + String.valueOf(coord.band.getMax()) +"</vu>");
xml.append("<vl>" + String.valueOf(coord.band.min) +"</vl>");
xml.append("<vu>" + String.valueOf(coord.band.max) +"</vu>");
xml.append("<vtype>" + coord.specSystem + "</vtype>");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment