diff --git a/cwms-data-api/src/main/java/cwms/cda/api/LocationController.java b/cwms-data-api/src/main/java/cwms/cda/api/LocationController.java
index f1610e113..0b2a56dea 100644
--- a/cwms-data-api/src/main/java/cwms/cda/api/LocationController.java
+++ b/cwms-data-api/src/main/java/cwms/cda/api/LocationController.java
@@ -25,8 +25,27 @@
package cwms.cda.api;
import static com.codahale.metrics.MetricRegistry.name;
-import static cwms.cda.api.Controllers.*;
+import static cwms.cda.api.Controllers.CASCADE_DELETE;
+import static cwms.cda.api.Controllers.CREATE;
+import static cwms.cda.api.Controllers.DATUM;
+import static cwms.cda.api.Controllers.DELETE;
+import static cwms.cda.api.Controllers.FAIL_IF_EXISTS;
+import static cwms.cda.api.Controllers.FORMAT;
+import static cwms.cda.api.Controllers.GET_ALL;
+import static cwms.cda.api.Controllers.GET_ONE;
+import static cwms.cda.api.Controllers.INCLUDE_ALIASES;
+import static cwms.cda.api.Controllers.LOCATION_ID;
+import static cwms.cda.api.Controllers.NAMES;
+import static cwms.cda.api.Controllers.OFFICE;
+import static cwms.cda.api.Controllers.RESULTS;
+import static cwms.cda.api.Controllers.SIZE;
+import static cwms.cda.api.Controllers.STATUS_200;
+import static cwms.cda.api.Controllers.STATUS_404;
+import static cwms.cda.api.Controllers.UNIT;
+import static cwms.cda.api.Controllers.UPDATE;
+import static cwms.cda.api.Controllers.VERSION;
import static cwms.cda.api.Controllers.addDeprecatedContentTypeWarning;
+import static cwms.cda.api.Controllers.requiredParam;
import static cwms.cda.data.dao.JooqDao.getDslContext;
import com.codahale.metrics.Histogram;
@@ -39,6 +58,7 @@
import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import com.google.common.flogger.FluentLogger;
import cwms.cda.api.enums.Nation;
import cwms.cda.api.enums.UnitSystem;
import cwms.cda.api.errors.CdaError;
@@ -63,7 +83,6 @@
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
-import com.google.common.flogger.FluentLogger;
import javax.servlet.http.HttpServletResponse;
import org.geojson.FeatureCollection;
import org.jetbrains.annotations.NotNull;
@@ -151,7 +170,6 @@ private Timer.Context markAndTime(String subject) {
)
@Override
public void getAll(@NotNull Context ctx) {
-
try (final Timer.Context ignored = markAndTime(GET_ALL)) {
DSLContext dsl = getDslContext(ctx);
@@ -199,17 +217,12 @@ public void getAll(@NotNull Context ctx) {
addDeprecatedContentTypeWarning(ctx, contentType);
ctx.status(HttpServletResponse.SC_OK);
-
- } catch (Exception ex) {
- CdaError re = new CdaError("failed to process request");
- logger.atSevere().withCause(ex).log("%s", re.toString());
- ctx.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).json(re);
}
}
@OpenApi(
pathParams = {
- @OpenApiParam(name = LOCATION_ID, description = "The ID of the location to get")
+ @OpenApiParam(name = LOCATION_ID, description = "The ID of the location to get")
},
queryParams = {
@OpenApiParam(name = OFFICE, required = true, description = "Specifies the "
@@ -311,14 +324,14 @@ public void create(@NotNull Context ctx) {
@OpenApi(
pathParams = {
- @OpenApiParam(name = LOCATION_ID, description = "The ID of the location to update")
+ @OpenApiParam(name = LOCATION_ID, description = "The ID of the location to update")
},
requestBody = @OpenApiRequestBody(
- content = {
- @OpenApiContent(from = Location.class, type = Formats.XML),
- @OpenApiContent(from = Location.class, type = Formats.JSON)
- },
- required = true),
+ content = {
+ @OpenApiContent(from = Location.class, type = Formats.XML),
+ @OpenApiContent(from = Location.class, type = Formats.JSON)
+ },
+ required = true),
description = "Update CWMS Location",
method = HttpMethod.PATCH,
path = "/locations",
@@ -367,7 +380,7 @@ public void update(@NotNull Context ctx, @NotNull String locationId) {
@OpenApi(
pathParams = {
- @OpenApiParam(name = LOCATION_ID, description = "The ID of the location to delete")
+ @OpenApiParam(name = LOCATION_ID, description = "The ID of the location to delete")
},
queryParams = {
@OpenApiParam(name = OFFICE, description = "Specifies the owning office of "
diff --git a/cwms-data-api/src/main/java/cwms/cda/api/ParametersController.java b/cwms-data-api/src/main/java/cwms/cda/api/ParametersController.java
index b3a103d45..d9cb74ead 100644
--- a/cwms-data-api/src/main/java/cwms/cda/api/ParametersController.java
+++ b/cwms-data-api/src/main/java/cwms/cda/api/ParametersController.java
@@ -4,7 +4,6 @@
import static cwms.cda.api.Controllers.ACCEPT;
import static cwms.cda.api.Controllers.FORMAT;
import static cwms.cda.api.Controllers.GET_ALL;
-import static cwms.cda.api.Controllers.GET_ONE;
import static cwms.cda.api.Controllers.OFFICE;
import static cwms.cda.api.Controllers.RESULTS;
import static cwms.cda.api.Controllers.SIZE;
@@ -28,12 +27,11 @@
import io.javalin.plugin.openapi.annotations.OpenApiParam;
import io.javalin.plugin.openapi.annotations.OpenApiResponse;
import java.util.List;
-import com.google.common.flogger.FluentLogger;
import javax.servlet.http.HttpServletResponse;
+import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;
public class ParametersController implements CrudHandler {
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final MetricRegistry metrics;
private final Histogram requestResultSize;
@@ -51,42 +49,42 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(ignore = true)
@Override
- public void create(Context ctx) {
+ public void create(@NotNull Context ctx) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(ignore = true)
@Override
- public void delete(Context ctx, String id) {
+ public void delete(@NotNull Context ctx, @NotNull String id) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(
- queryParams = {
- @OpenApiParam(name = FORMAT, deprecated = true, description = "Specifies the"
- + " encoding format of the response. Valid value for the format field"
- + " for this URI are:"
- + "\n* `tab` (deprecated)"
- + "\n* `csv` (deprecated)"
- + "\n* `xml`"
- + "\n* `json` (default)"
- + "\n\nSee this page for more information about accept header usage."),
- @OpenApiParam(name = OFFICE, description = "Specifies the"
- + " owning office of the parameters whose data is to be included in the "
- + "response. If this field is not specified, the session user's default office will be"
- + " used."),
- },
- responses = {
- @OpenApiResponse(status = STATUS_200, content = {
- @OpenApiContent(isArray = true, from = Parameter.class, type = Formats.JSONV2),
- @OpenApiContent(isArray = true, from = Parameter.class, type = Formats.JSON)
- }),
- },
- tags = {"Parameters"}
+ queryParams = {
+ @OpenApiParam(name = FORMAT, deprecated = true, description = "Specifies the"
+ + " encoding format of the response. Valid value for the format field"
+ + " for this URI are:"
+ + "\n* `tab` (deprecated)"
+ + "\n* `csv` (deprecated)"
+ + "\n* `xml`"
+ + "\n* `json` (default)"
+ + "\n\nSee this page for more information about accept header usage."),
+ @OpenApiParam(name = OFFICE, description = "Specifies the"
+ + " owning office of the parameters whose data is to be included in the "
+ + "response. If this field is not specified, the session user's default office will be"
+ + " used."),
+ },
+ responses = {
+ @OpenApiResponse(status = STATUS_200, content = {
+ @OpenApiContent(isArray = true, from = Parameter.class, type = Formats.JSONV2),
+ @OpenApiContent(isArray = true, from = Parameter.class, type = Formats.JSON)
+ }),
+ },
+ tags = {"Parameters"}
)
@Override
- public void getAll(Context ctx) {
+ public void getAll(@NotNull Context ctx) {
try (final Timer.Context timeContext = markAndTime(GET_ALL)) {
DSLContext dsl = getDslContext(ctx);
ParameterDao dao = new ParameterDao(dsl);
@@ -121,22 +119,18 @@ public void getAll(Context ctx) {
ctx.result(results);
addDeprecatedContentTypeWarning(ctx, contentType);
requestResultSize.update(results.length());
- } catch (Exception ex) {
- CdaError re = new CdaError("Failed to process request");
- logger.atSevere().withCause(ex).log("%s", re);
- ctx.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).json(re);
}
}
@OpenApi(ignore = true)
@Override
- public void getOne(Context ctx, String id) {
+ public void getOne(@NotNull Context ctx, @NotNull String id) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(ignore = true)
@Override
- public void update(Context ctx, String id) {
+ public void update(@NotNull Context ctx, @NotNull String id) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
diff --git a/cwms-data-api/src/main/java/cwms/cda/api/SpecifiedLevelController.java b/cwms-data-api/src/main/java/cwms/cda/api/SpecifiedLevelController.java
index 31638a5d4..f900e2756 100644
--- a/cwms-data-api/src/main/java/cwms/cda/api/SpecifiedLevelController.java
+++ b/cwms-data-api/src/main/java/cwms/cda/api/SpecifiedLevelController.java
@@ -24,6 +24,20 @@
package cwms.cda.api;
+import static com.codahale.metrics.MetricRegistry.name;
+import static cwms.cda.api.Controllers.CREATE;
+import static cwms.cda.api.Controllers.FAIL_IF_EXISTS;
+import static cwms.cda.api.Controllers.GET_ALL;
+import static cwms.cda.api.Controllers.OFFICE;
+import static cwms.cda.api.Controllers.RESULTS;
+import static cwms.cda.api.Controllers.SIZE;
+import static cwms.cda.api.Controllers.SPECIFIED_LEVEL_ID;
+import static cwms.cda.api.Controllers.STATUS_200;
+import static cwms.cda.api.Controllers.TEMPLATE_ID_MASK;
+import static cwms.cda.api.Controllers.UPDATE;
+import static cwms.cda.api.Controllers.requiredParam;
+import static cwms.cda.data.dao.JooqDao.getDslContext;
+
import com.codahale.metrics.Histogram;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
@@ -35,21 +49,19 @@
import io.javalin.apibuilder.CrudHandler;
import io.javalin.core.util.Header;
import io.javalin.http.Context;
-import io.javalin.plugin.openapi.annotations.*;
+import io.javalin.plugin.openapi.annotations.HttpMethod;
+import io.javalin.plugin.openapi.annotations.OpenApi;
+import io.javalin.plugin.openapi.annotations.OpenApiContent;
+import io.javalin.plugin.openapi.annotations.OpenApiParam;
+import io.javalin.plugin.openapi.annotations.OpenApiRequestBody;
+import io.javalin.plugin.openapi.annotations.OpenApiResponse;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-import com.google.common.flogger.FluentLogger;
-
-import static com.codahale.metrics.MetricRegistry.name;
-import static cwms.cda.api.Controllers.*;
-import static cwms.cda.data.dao.JooqDao.getDslContext;
-
public class SpecifiedLevelController implements CrudHandler {
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private static final String TAG = "Levels";
private final MetricRegistry metrics;
@@ -73,23 +85,24 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(
- queryParams = {
- @OpenApiParam(name = OFFICE, description = "Specifies the owning office of "
- + "the Specified Levels whose data is to be included in the response."
- + " If this field is not specified, matching rating information from "
- + "all offices shall be returned."),
- @OpenApiParam(name = TEMPLATE_ID_MASK, description = "Mask that specifies "
- + "the IDs to be included in the response. If this field is not "
- + "specified, all specified levels shall be returned."),
- },
- responses = {
- @OpenApiResponse(status = STATUS_200,
- content = {
- @OpenApiContent(type = Formats.JSONV2, from =
- SpecifiedLevel.class)
- }
- )},
- tags = {TAG}
+ queryParams = {
+ @OpenApiParam(name = OFFICE, description = "Specifies the owning office of "
+ + "the Specified Levels whose data is to be included in the response."
+ + " If this field is not specified, matching rating information from "
+ + "all offices shall be returned."),
+ @OpenApiParam(name = TEMPLATE_ID_MASK, description = "Mask that specifies "
+ + "the IDs to be included in the response. If this field is not "
+ + "specified, all specified levels shall be returned."),
+ },
+ responses = {
+ @OpenApiResponse(status = STATUS_200,
+ content = {
+ @OpenApiContent(type = Formats.JSONV2, from =
+ SpecifiedLevel.class)
+ }
+ )
+ },
+ tags = {TAG}
)
@Override
public void getAll(Context ctx) {
@@ -98,7 +111,7 @@ public void getAll(Context ctx) {
String formatHeader = ctx.header(Header.ACCEPT);
ContentType contentType = Formats.parseHeader(formatHeader, SpecifiedLevel.class);
- try (Timer.Context timeContext = markAndTime(GET_ALL)){
+ try (Timer.Context timeContext = markAndTime(GET_ALL)) {
DSLContext dsl = getDslContext(ctx);
SpecifiedLevelDao dao = getDao(dsl);
@@ -110,18 +123,13 @@ public void getAll(Context ctx) {
ctx.result(result);
requestResultSize.update(result.length());
ctx.status(HttpServletResponse.SC_OK);
- } catch (Exception ex) {
- CdaError re =
- new CdaError("Failed to process request: " + ex.getLocalizedMessage());
- logger.atSevere().withCause(ex).log("%s", re);
- ctx.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).json(re);
}
}
@OpenApi(ignore = true)
@Override
- public void getOne(Context ctx, String templateId) {
+ public void getOne(@NotNull Context ctx, @NotNull String templateId) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@@ -140,8 +148,8 @@ public void getOne(Context ctx, String templateId) {
tags = {TAG}
)
@Override
- public void create(Context ctx) {
- try (Timer.Context ignored = markAndTime(CREATE)){
+ public void create(@NotNull Context ctx) {
+ try (Timer.Context ignored = markAndTime(CREATE)) {
DSLContext dsl = getDslContext(ctx);
String formatHeader = ctx.req.getContentType();
@@ -169,8 +177,8 @@ public void create(Context ctx) {
tags = {TAG}
)
@Override
- public void update(Context ctx, @NotNull String oldSpecifiedLevelId) {
- try (Timer.Context ignored = markAndTime(UPDATE)){
+ public void update(@NotNull Context ctx, @NotNull String oldSpecifiedLevelId) {
+ try (Timer.Context ignored = markAndTime(UPDATE)) {
DSLContext dsl = getDslContext(ctx);
SpecifiedLevelDao dao = getDao(dsl);
@@ -196,8 +204,8 @@ public void update(Context ctx, @NotNull String oldSpecifiedLevelId) {
tags = {TAG}
)
@Override
- public void delete(Context ctx, String specifiedLevelId) {
- try (Timer.Context ignored = markAndTime(UPDATE)){
+ public void delete(@NotNull Context ctx, @NotNull String specifiedLevelId) {
+ try (Timer.Context ignored = markAndTime(UPDATE)) {
DSLContext dsl = getDslContext(ctx);
SpecifiedLevelDao dao = getDao(dsl);
diff --git a/cwms-data-api/src/main/java/cwms/cda/api/TimeZoneController.java b/cwms-data-api/src/main/java/cwms/cda/api/TimeZoneController.java
index 44cf6d9ff..996a09e8f 100644
--- a/cwms-data-api/src/main/java/cwms/cda/api/TimeZoneController.java
+++ b/cwms-data-api/src/main/java/cwms/cda/api/TimeZoneController.java
@@ -4,8 +4,6 @@
import static cwms.cda.api.Controllers.ACCEPT;
import static cwms.cda.api.Controllers.FORMAT;
import static cwms.cda.api.Controllers.GET_ALL;
-import static cwms.cda.api.Controllers.GET_ONE;
-import static cwms.cda.api.Controllers.NOT_SUPPORTED_YET;
import static cwms.cda.api.Controllers.RESULTS;
import static cwms.cda.api.Controllers.SIZE;
import static cwms.cda.api.Controllers.STATUS_200;
@@ -29,14 +27,11 @@
import io.javalin.plugin.openapi.annotations.OpenApiContent;
import io.javalin.plugin.openapi.annotations.OpenApiParam;
import io.javalin.plugin.openapi.annotations.OpenApiResponse;
-
-import com.google.common.flogger.FluentLogger;
import javax.servlet.http.HttpServletResponse;
+import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;
public class TimeZoneController implements CrudHandler {
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
-
private final MetricRegistry metrics;
private final Histogram requestResultSize;
@@ -54,40 +49,40 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(ignore = true)
@Override
- public void create(Context ctx) {
+ public void create(@NotNull Context ctx) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(ignore = true)
@Override
- public void delete(Context ctx, String id) {
+ public void delete(@NotNull Context ctx, @NotNull String id) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(
- queryParams = {
- @OpenApiParam(name = FORMAT, required = false, description = "Specifies the"
- + " encoding format of the response. Valid value for the format field"
- + " for this URI are:"
- + "\n* `tab` "
- + "\n* `csv` "
- + "\n* `xml` "
- + "\n* `json` (default)"
- + "\n\nSee this page for more "
- + "information about accept header usage.")
- },
- responses = {
- @OpenApiResponse(status = STATUS_200, content = {
- @OpenApiContent(from = TimeZoneIds.class, type = Formats.JSONV2),
- @OpenApiContent(from = TimeZoneIds.class, type = Formats.JSON)
- }),
- @OpenApiResponse(status = STATUS_501, description = "The format requested is not "
- + "implemented")
- },
- tags = {"TimeZones"}
+ queryParams = {
+ @OpenApiParam(name = FORMAT, description = "Specifies the"
+ + " encoding format of the response. Valid value for the format field"
+ + " for this URI are:"
+ + "\n* `tab` "
+ + "\n* `csv` "
+ + "\n* `xml` "
+ + "\n* `json` (default)"
+ + "\n\nSee this page for more "
+ + "information about accept header usage.")
+ },
+ responses = {
+ @OpenApiResponse(status = STATUS_200, content = {
+ @OpenApiContent(from = TimeZoneIds.class, type = Formats.JSONV2),
+ @OpenApiContent(from = TimeZoneIds.class, type = Formats.JSON)
+ }),
+ @OpenApiResponse(status = STATUS_501, description = "The format requested is not "
+ + "implemented")
+ },
+ tags = {"TimeZones"}
)
@Override
- public void getAll(Context ctx) {
+ public void getAll(@NotNull Context ctx) {
try (Timer.Context timeContext = markAndTime(GET_ALL)) {
DSLContext dsl = getDslContext(ctx);
TimeZoneDao dao = new TimeZoneDao(dsl);
@@ -121,22 +116,18 @@ public void getAll(Context ctx) {
requestResultSize.update(results.length());
ctx.status(HttpServletResponse.SC_OK);
ctx.result(results);
- } catch (Exception ex) {
- logger.atSevere().withCause(ex).log("Failed to process request");
- ctx.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- ctx.result("Failed to process request");
}
}
@OpenApi(ignore = true)
@Override
- public void getOne(Context ctx, String id) {
+ public void getOne(@NotNull Context ctx, @NotNull String id) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(ignore = true)
@Override
- public void update(Context ctx, String id) {
+ public void update(@NotNull Context ctx, @NotNull String id) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
diff --git a/cwms-data-api/src/main/java/cwms/cda/api/UnitsController.java b/cwms-data-api/src/main/java/cwms/cda/api/UnitsController.java
index 11f1b2aa8..fab490fa9 100644
--- a/cwms-data-api/src/main/java/cwms/cda/api/UnitsController.java
+++ b/cwms-data-api/src/main/java/cwms/cda/api/UnitsController.java
@@ -27,12 +27,11 @@
import io.javalin.plugin.openapi.annotations.OpenApiParam;
import io.javalin.plugin.openapi.annotations.OpenApiResponse;
import java.util.List;
-import com.google.common.flogger.FluentLogger;
import javax.servlet.http.HttpServletResponse;
+import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;
public class UnitsController implements CrudHandler {
- private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final MetricRegistry metrics;
private final Histogram requestResultSize;
@@ -50,37 +49,37 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(ignore = true)
@Override
- public void create(Context ctx) {
+ public void create(@NotNull Context ctx) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(ignore = true)
@Override
- public void delete(Context ctx, String unit) {
+ public void delete(@NotNull Context ctx, @NotNull String unit) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
@OpenApi(
- queryParams = {
- @OpenApiParam(name = FORMAT, required = false, description = "Specifies the"
- + " encoding format of the response. Valid value for the format field"
- + " for this URI are:"
- + "\n* `tab`"
- + "\n* `csv`"
- + "\n* `xml`"
- + "\n* `json` (default)"
- + "\n\nSee this page for more"
- + " information about accept header usage.")
- },
- responses = {
- @OpenApiResponse(status = STATUS_200),
- @OpenApiResponse(status = STATUS_501, description = "The format requested is not "
- + "implemented")
- },
- tags = {"Units"}
+ queryParams = {
+ @OpenApiParam(name = FORMAT, description = "Specifies the"
+ + " encoding format of the response. Valid value for the format field"
+ + " for this URI are:"
+ + "\n* `tab`"
+ + "\n* `csv`"
+ + "\n* `xml`"
+ + "\n* `json` (default)"
+ + "\n\nSee this page for more"
+ + " information about accept header usage.")
+ },
+ responses = {
+ @OpenApiResponse(status = STATUS_200),
+ @OpenApiResponse(status = STATUS_501, description = "The format requested is not "
+ + "implemented")
+ },
+ tags = {"Units"}
)
@Override
- public void getAll(Context ctx) {
+ public void getAll(@NotNull Context ctx) {
try (final Timer.Context timeContext = markAndTime(GET_ALL)) {
DSLContext dsl = getDslContext(ctx);
@@ -115,17 +114,13 @@ public void getAll(Context ctx) {
ctx.result(results);
addDeprecatedContentTypeWarning(ctx, contentType);
requestResultSize.update(results.length());
- } catch (Exception ex) {
- logger.atSevere().withCause(ex).log("Failed to process request");
- ctx.status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- ctx.result("Failed to process request");
}
}
@OpenApi(ignore = true)
@Override
- public void getOne(Context ctx, String unit) {
+ public void getOne(@NotNull Context ctx, @NotNull String unit) {
try (Timer.Context timeContext = markAndTime(GET_ONE)) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
@@ -134,7 +129,7 @@ public void getOne(Context ctx, String unit) {
@OpenApi(ignore = true)
@Override
- public void update(Context ctx, String unit) {
+ public void update(@NotNull Context ctx, @NotNull String unit) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
diff --git a/cwms-data-api/src/main/java/cwms/cda/datasource/ConnectionPreparingDataSource.java b/cwms-data-api/src/main/java/cwms/cda/datasource/ConnectionPreparingDataSource.java
index ab5270419..a21ebb9aa 100644
--- a/cwms-data-api/src/main/java/cwms/cda/datasource/ConnectionPreparingDataSource.java
+++ b/cwms-data-api/src/main/java/cwms/cda/datasource/ConnectionPreparingDataSource.java
@@ -21,7 +21,7 @@ public ConnectionPreparingDataSource() {
public Connection getConnection() throws SQLException {
Connection connection = getDelegate().getConnection();
- try{
+ try {
return getPreparer().prepare(connection);
} catch (Exception e) {
try {