Skip to content

Commit

Permalink
Merge branch 'Unidata:main' into metno
Browse files Browse the repository at this point in the history
  • Loading branch information
cskarby authored Jun 9, 2023
2 parents 4dfdb8c + 317a453 commit 25461bd
Show file tree
Hide file tree
Showing 34 changed files with 352 additions and 314 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ installed in any servlet container such as Apache Tomcat.

For more information about the TDS, see the TDS web page at

* https://docs.unidata.ucar.edu/tds/5.0/userguide/
* https://docs.unidata.ucar.edu/tds/current/userguide/

You can obtain a copy of the latest released version of TDS software from

Expand All @@ -39,11 +39,11 @@ data consumers find out what data is available from data providers.

THREDDS Catalog documentation (including the specification) is available at

* https://docs.unidata.ucar.edu/tds/4.6/adminguide/catalog/index.html
* https://docs.unidata.ucar.edu/tds/current/userguide/basic_client_catalog.html

## Licensing

The THREDDS Data Server is released under the BSD-3 licence, which can be found can be found [here](https://github.com/Unidata/tds/blob/master/LICENSE)
The THREDDS Data Server is released under the BSD-3 licence, which can be found can be found [here](https://github.com/Unidata/tds/blob/main/LICENSE)

Furthermore, this project includes code from third-party open-source software components:
* [Gretty](https://github.com/akhikhl/gretty): for details, see `buildSrc/README.md`
Expand Down
5 changes: 2 additions & 3 deletions dap4/d4servlet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ apply from: "$rootDir/gradle/any/java-published.gradle"
dependencies {
implementation enforcedPlatform(project(':tds-platform'))

compile 'edu.ucar:d4core'
compile 'edu.ucar:d4lib'
compile 'edu.ucar:dap4'
compile 'edu.ucar:httpservices'

compileOnly 'javax.servlet:javax.servlet-api'
compileOnly 'jakarta.servlet:jakarta.servlet-api'
compile 'org.slf4j:slf4j-api'
}
7 changes: 0 additions & 7 deletions dap4/d4servlet/src/main/java/dap4/servlet/DSPFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@

package dap4.servlet;

import dap4.core.data.DSP;
import dap4.core.util.DapContext;
import dap4.core.util.DapException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

/**
* Provide a factory for DSP instances
*/
Expand Down
4 changes: 1 addition & 3 deletions dap4/d4tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ dependencies {
compile enforcedPlatform(project(':tds-testing-platform'))

// A lot of these dependencies should be in the testRuntime config, not testCompile.
testCompile 'edu.ucar:d4core'
testCompile 'edu.ucar:d4lib'
testCompile 'edu.ucar:dap4'
testCompile project(':dap4:dap4-servlet')

testCompile(project(':dap4:d4ts')) {
exclude group: 'org.apache.logging.log4j'
}

testCompile 'edu.ucar:d4cdm'
testCompile 'edu.ucar:cdm-core'
testCompile 'edu.ucar:httpservices'

Expand Down
5 changes: 2 additions & 3 deletions dap4/d4ts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ apply from: "$rootDir/gradle/any/gretty.gradle"
dependencies {
compile enforcedPlatform(project(':tds-platform'))

compile 'edu.ucar:d4core'
compile 'edu.ucar:d4lib'
compile 'edu.ucar:dap4'
compile project(":dap4:dap4-servlet")
providedCompile "javax.servlet:javax.servlet-api:${depVersion.javaxServletApi}"
providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}"

compile 'org.slf4j:slf4j-api'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ JAVA_PREFS_ROOTS="-Djava.util.prefs.systemRoot=$CONTENT_ROOT/thredds/javaUtilPre
#
# Some commonly used JAVA_OPTS settings:
#
NORMAL="-d64 -Xmx4096m -Xms512m -server -ea"
NORMAL="-d64 -Xmx4096m -Xms512m -server"
HEAP_DUMP="-XX:+HeapDumpOnOutOfMemoryError"
HEADLESS="-Djava.awt.headless=true"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ If you're running Tomcat on an instance of Windows OS, you will want to create a
#
# Some commonly used JAVA_OPTS settings:
#
NORMAL="-d64 -Xmx4096m -Xms512m -server -ea"
NORMAL="-d64 -Xmx4096m -Xms512m -server"
HEAP_DUMP="-XX:+HeapDumpOnOutOfMemoryError"
HEADLESS="-Djava.awt.headless=true"
Expand Down Expand Up @@ -180,7 +180,7 @@ If you're running Tomcat on an instance of Windows OS, you will want to create a
~~~bash
# ps -ef | grep tomcat
root 7988 1 13 14:17 pts/2 00:00:05 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dtds.content.root.path=/data/content -d64 -Xmx4096m -Xms512m -server -ea -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djava.util.prefs.systemRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djava.util.prefs.userRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 7988 1 13 14:17 pts/2 00:00:05 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dtds.content.root.path=/data/content -d64 -Xmx4096m -Xms512m -server -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djava.util.prefs.systemRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djava.util.prefs.userRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 8279 23720 0 14:18 pts/2 00:00:00 grep tomcat
~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ If you're running Tomcat on an instance of Windows OS, you will want to create a
#
# Some commonly used JAVA_OPTS settings:
#
NORMAL="-d64 -Xmx4096m -Xms512m -server -ea"
NORMAL="-d64 -Xmx4096m -Xms512m -server"
HEAP_DUMP="-XX:+HeapDumpOnOutOfMemoryError"
HEADLESS="-Djava.awt.headless=true"
Expand Down Expand Up @@ -180,7 +180,7 @@ If you're running Tomcat on an instance of Windows OS, you will want to create a
~~~bash
# ps -ef | grep tomcat
root 7988 1 13 14:17 pts/2 00:00:05 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dtds.content.root.path=/data/content -d64 -Xmx4096m -Xms512m -server -ea -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djava.util.prefs.systemRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djava.util.prefs.userRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 7988 1 13 14:17 pts/2 00:00:05 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dtds.content.root.path=/data/content -d64 -Xmx4096m -Xms512m -server -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djava.util.prefs.systemRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djava.util.prefs.userRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 8279 23720 0 14:18 pts/2 00:00:00 grep tomcat
~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ If you're running Tomcat on an instance of Windows OS, you will want to create a
#
# Some commonly used JAVA_OPTS settings:
#
NORMAL="-d64 -Xmx4096m -Xms512m -server -ea"
NORMAL="-d64 -Xmx4096m -Xms512m -server"
HEAP_DUMP="-XX:+HeapDumpOnOutOfMemoryError"
HEADLESS="-Djava.awt.headless=true"
Expand Down Expand Up @@ -180,7 +180,7 @@ If you're running Tomcat on an instance of Windows OS, you will want to create a
~~~bash
# ps -ef | grep tomcat
root 7988 1 13 14:17 pts/2 00:00:05 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dtds.content.root.path=/usr/local/tomcat/content -d64 -Xmx4096m -Xms512m -server -ea -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djava.util.prefs.systemRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djava.util.prefs.userRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 7988 1 13 14:17 pts/2 00:00:05 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dtds.content.root.path=/usr/local/tomcat/content -d64 -Xmx4096m -Xms512m -server -XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true -Djava.util.prefs.systemRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djava.util.prefs.userRoot=/usr/local/tomcat/content/thredds/javaUtilPrefs -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 8279 23720 0 14:18 pts/2 00:00:00 grep tomcat
~~~
Expand Down
6 changes: 3 additions & 3 deletions gradle/any/shared-mvn-coords.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext {
buildPlugins.protobuf = 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
buildPlugins.nexus = 'edu.ucar.unidata:unidata-nexus-gradle:0.0.1'
buildPlugins.jekyll = 'edu.ucar.unidata.site:jekyll-plugin:0.0.4'
buildPlugins.depcheck = 'org.owasp:dependency-check-gradle:6.0.2'
buildPlugins.depcheck = 'org.owasp:dependency-check-gradle:8.2.1'

// slf4j version is declared in a place where we cannot use the tds-platform project to handle resolving versions
// (e.g. gradle/any/dependencies.gradle, for transitive dependency replacement purposes)
Expand All @@ -26,8 +26,8 @@ ext {
depVersion.netcdfJava = '5.5.4-SNAPSHOT'
// gradle seems to have issues with the compileOnly configuration, so we need to provide the full maven
// coordinates for javax.servlet-api if the gradle plugin in applied. If we don't, we see errors like this:
depVersion.javaxServletApi = '3.1.0'
depVersion.hibernateValidator = '6.1.5.Final'
depVersion.javaxServletApi = '4.0.3'
depVersion.hibernateValidator = '6.2.5.Final'
// TODO: figure out way to keep this version in sync with netcdf-java version
// It is included in the netcdf-java-bom (via netcdf-java-platform), but we can't
// reference that version in a gradle build script (see gradle/any/protobuf.gradle)
Expand Down
2 changes: 1 addition & 1 deletion opendap/dtswar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {
compile 'edu.ucar:opendap'
compile 'org.slf4j:slf4j-api'

providedCompile "javax.servlet:javax.servlet-api:${depVersion.javaxServletApi}"
providedCompile "jakarta.servlet:jakarta.servlet-api:${depVersion.javaxServletApi}"

runtime 'org.apache.taglibs:taglibs-standard-spec'
runtime 'org.apache.taglibs:taglibs-standard-impl'
Expand Down
115 changes: 53 additions & 62 deletions opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

package opendap.dts;

import javax.annotation.Nonnull;
import opendap.dap.*;
import opendap.dap.parsers.ParseException;
import opendap.servers.CEEvaluator;
Expand Down Expand Up @@ -1644,12 +1645,9 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
// probeRequest(System.out, rs);

rs = getRequestState(request, response);
assert (rs != null);
if (rs != null) {
String ds = rs.getDataSet();
String suff = rs.getRequestSuffix();
isDebug = ((ds != null) && ds.equals("debug") && (suff != null) && suff.equals(""));
}
String ds = rs.getDataSet();
String suff = rs.getRequestSuffix();
isDebug = ((ds != null) && ds.equals("debug") && (suff != null) && suff.equals(""));

synchronized (syncLock) {

Expand All @@ -1674,58 +1672,53 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
}
} // synch

if (rs != null) {
String dataSet = rs.getDataSet();
String requestSuffix = rs.getRequestSuffix();
rs.getResponse().setHeader("XDODS-Server", getServerVersion());// Make sure always set


if (dataSet == null || dataSet.equals("/") || dataSet.equals("")) {
doGetDIR(rs);
} else if (dataSet.equalsIgnoreCase("/version") || dataSet.equalsIgnoreCase("/version/")) {
doGetVER(rs);
} else if (dataSet.equalsIgnoreCase("/help") || dataSet.equalsIgnoreCase("/help/")) {
doGetHELP(rs);
} else if (dataSet.equalsIgnoreCase("/" + requestSuffix)) {
doGetHELP(rs);
} else if (requestSuffix.equalsIgnoreCase("dds")) {
doGetDDS(rs);
} else if (requestSuffix.equalsIgnoreCase("das")) {
doGetDAS(rs);
} else if (requestSuffix.equalsIgnoreCase("ddx")) {
doGetDDX(rs);
} else if (requestSuffix.equalsIgnoreCase("blob")) {
doGetBLOB(rs);
} else if (requestSuffix.equalsIgnoreCase("dods")) {
doGetDAP2Data(rs);
} else if (requestSuffix.equalsIgnoreCase("asc") || requestSuffix.equalsIgnoreCase("ascii")) {
doGetASC(rs);
} else if (requestSuffix.equalsIgnoreCase("info")) {
doGetINFO(rs);
} else if (requestSuffix.equalsIgnoreCase("html") || requestSuffix.equalsIgnoreCase("htm")) {
doGetHTML(rs);
} else if (requestSuffix.equalsIgnoreCase("ver") || requestSuffix.equalsIgnoreCase("version")) {
doGetVER(rs);
} else if (requestSuffix.equalsIgnoreCase("help")) {
doGetHELP(rs);

/*
* JC added
* } else if(dataSet.equalsIgnoreCase("catalog") && requestSuffix.equalsIgnoreCase("xml")) {
* doGetCatalog(rs);
* } else if(dataSet.equalsIgnoreCase("status")) {
* doGetStatus(rs);
* } else if(dataSet.equalsIgnoreCase("systemproperties")) {
* doGetSystemProps(rs);
* } else if(isDebug) {
* doDebug(rs);
*/
} else if (requestSuffix.equals("")) {
badURL(request, response);
} else {
badURL(request, response);
}
} else {// rs == null
String dataSet = rs.getDataSet();
String requestSuffix = rs.getRequestSuffix();
rs.getResponse().setHeader("XDODS-Server", getServerVersion());// Make sure always set

if (dataSet == null || dataSet.equals("/") || dataSet.equals("")) {
doGetDIR(rs);
} else if (dataSet.equalsIgnoreCase("/version") || dataSet.equalsIgnoreCase("/version/")) {
doGetVER(rs);
} else if (dataSet.equalsIgnoreCase("/help") || dataSet.equalsIgnoreCase("/help/")) {
doGetHELP(rs);
} else if (dataSet.equalsIgnoreCase("/" + requestSuffix)) {
doGetHELP(rs);
} else if (requestSuffix.equalsIgnoreCase("dds")) {
doGetDDS(rs);
} else if (requestSuffix.equalsIgnoreCase("das")) {
doGetDAS(rs);
} else if (requestSuffix.equalsIgnoreCase("ddx")) {
doGetDDX(rs);
} else if (requestSuffix.equalsIgnoreCase("blob")) {
doGetBLOB(rs);
} else if (requestSuffix.equalsIgnoreCase("dods")) {
doGetDAP2Data(rs);
} else if (requestSuffix.equalsIgnoreCase("asc") || requestSuffix.equalsIgnoreCase("ascii")) {
doGetASC(rs);
} else if (requestSuffix.equalsIgnoreCase("info")) {
doGetINFO(rs);
} else if (requestSuffix.equalsIgnoreCase("html") || requestSuffix.equalsIgnoreCase("htm")) {
doGetHTML(rs);
} else if (requestSuffix.equalsIgnoreCase("ver") || requestSuffix.equalsIgnoreCase("version")) {
doGetVER(rs);
} else if (requestSuffix.equalsIgnoreCase("help")) {
doGetHELP(rs);

/*
* JC added
* } else if(dataSet.equalsIgnoreCase("catalog") && requestSuffix.equalsIgnoreCase("xml")) {
* doGetCatalog(rs);
* } else if(dataSet.equalsIgnoreCase("status")) {
* doGetStatus(rs);
* } else if(dataSet.equalsIgnoreCase("systemproperties")) {
* doGetSystemProps(rs);
* } else if(isDebug) {
* doDebug(rs);
*/
} else if (requestSuffix.equals("")) {
badURL(request, response);
} else {
badURL(request, response);
}

Expand All @@ -1741,8 +1734,8 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) {
* @param request
* @return the request state
*/
@Nonnull
protected ReqState getRequestState(HttpServletRequest request, HttpServletResponse response) throws DAP2Exception {
ReqState rs = null;
// The url and query strings will come to us in encoded form
// (see HTTPmethod.newMethod())
String baseurl = request.getRequestURL().toString();
Expand All @@ -1751,9 +1744,7 @@ protected ReqState getRequestState(HttpServletRequest request, HttpServletRespon
String query = request.getQueryString();
query = EscapeStrings.unescapeURLQuery(query);

rs = new ReqState(this, request, response, rootpath, baseurl, query);

return rs;
return new ReqState(this, request, response, rootpath, baseurl, query);
}
// **************************************************************************

Expand Down
Binary file removed opendap/dtswar/src/main/java/opendap/dts/test.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion opendap/server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
compile 'edu.ucar:opendap'
compile 'org.slf4j:slf4j-api'

compileOnly 'javax.servlet:javax.servlet-api'
compileOnly 'jakarta.servlet:jakarta.servlet-api'

testImplementation project(':tds-test-utils');
testImplementation 'junit:junit'
Expand Down
7 changes: 4 additions & 3 deletions opendap/server/src/main/java/opendap/servers/parsers/AST.java
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,9 @@ SubClause translate()
subclause = getClauseFactory().newValueClause((BaseType) components.pop(), false);
} else if (fcn != null) {
subclause = fcn.translate();
} else
assert (false);
} else {
throw new IllegalStateException("Unexpected state in AST::translate");
}
return subclause;
}
}
Expand Down Expand Up @@ -473,7 +474,7 @@ SubClause translate()
}
break;
default:
assert (false);
throw new IllegalStateException("Unexpected tag = " + tag);
}
return subclause;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Object constant(Ceparse state, Object path, int tag) throws ParseException {
}
break;
default:
assert (false);
throw new IllegalStateException("Unexpected tag = " + tag);
}
return value;
}
Expand Down
Loading

0 comments on commit 25461bd

Please sign in to comment.