Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void getAll(@NotNull Context ctx) {
@OpenApi(ignore = true)
@Override
public void getOne(@NotNull Context ctx, @NotNull String templateId) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down Expand Up @@ -232,7 +232,7 @@ public void create(@NotNull Context ctx) {
tags = {TAG}
)
@Override
public void update(@NotNull Context ctx, @NotNull String oldBinaryTimeSeriesId) {
public void update(@NotNull Context ctx, @NotNull String name) {

try (Timer.Context ignored = markAndTime(UPDATE)) {
boolean maxVersion = true;
Expand Down Expand Up @@ -276,7 +276,7 @@ public void update(@NotNull Context ctx, @NotNull String oldBinaryTimeSeriesId)
tags = {TAG}
)
@Override
public void delete(@NotNull Context ctx, @NotNull String binaryTimeSeriesId) {
public void delete(@NotNull Context ctx, @NotNull String name) {
try (Timer.Context ignored = markAndTime(DELETE)) {
DSLContext dsl = getDslContext(ctx);
String office = requiredParam(ctx, OFFICE);
Expand All @@ -289,7 +289,7 @@ public void delete(@NotNull Context ctx, @NotNull String binaryTimeSeriesId) {

TimeSeriesBinaryDao dao = getDao(dsl);

dao.delete(office, binaryTimeSeriesId, mask, begin, end, version);
dao.delete(office, name, mask, begin, end, version);

ctx.status(HttpServletResponse.SC_NO_CONTENT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.Map;
import java.util.Set;
import com.google.common.flogger.FluentLogger;
import javax.servlet.http.HttpServletResponse;
import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;
import org.owasp.html.PolicyFactory;
Expand Down Expand Up @@ -63,19 +64,19 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(tags = {TAG}, ignore = true)
@Override
public void create(Context ctx) {
ctx.status(HttpCode.NOT_IMPLEMENTED).result("cannot perform this action");
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(tags = {"Catalog"}, ignore = true)
@Override
public void delete(Context ctx, @NotNull String entry) {
ctx.status(HttpCode.NOT_IMPLEMENTED).result("cannot perform this action");
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(tags = {"Catalog"}, ignore = true)
@Override
public void getAll(Context ctx) {
ctx.status(HttpCode.NOT_IMPLEMENTED).result("cannot perform this action");
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down Expand Up @@ -311,7 +312,7 @@ private static void warnAboutNotSupported(@NotNull Context ctx, String[] warnAbo
@OpenApi(tags = {"Catalog"}, ignore = true)
@Override
public void update(Context ctx, @NotNull String entry) {
ctx.status(HttpCode.NOT_IMPLEMENTED).json(CdaError.notImplemented());
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.codahale.metrics.Histogram;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import cwms.cda.api.errors.CdaError;
import cwms.cda.data.dao.JooqDao;
import cwms.cda.data.dto.TimeSeries;
import cwms.cda.formatters.Formats;
Expand All @@ -13,6 +14,7 @@
import io.javalin.plugin.openapi.annotations.OpenApiContent;
import io.javalin.plugin.openapi.annotations.OpenApiParam;
import io.javalin.plugin.openapi.annotations.OpenApiRequestBody;
import javax.servlet.http.HttpServletResponse;
import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;

Expand Down Expand Up @@ -88,34 +90,25 @@ protected DSLContext getDslContext(Context ctx) {
@OpenApi(ignore = true)
@Override
public void delete(@NotNull Context ctx, @NotNull String forecastSpecId) {
try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void getAll(@NotNull Context ctx) {
try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void getOne(@NotNull Context ctx, @NotNull String id) {
try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void update(@NotNull Context ctx, @NotNull String id) {
try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}

ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.codahale.metrics.Histogram;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import cwms.cda.api.errors.CdaError;
import cwms.cda.data.dao.LookupTypeDao;
import cwms.cda.data.dto.LookupType;
import cwms.cda.data.dto.StatusResponse;
Expand Down Expand Up @@ -106,9 +107,7 @@ public void getAll(Context ctx) {
@OpenApi(ignore = true)
@Override
public void getOne(@NotNull Context context, @NotNull String s) {
try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
context.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import static cwms.cda.api.Controllers.queryParamAsInstant;
import static cwms.cda.api.Controllers.requiredParam;
import cwms.cda.api.enums.UnitSystem;
import cwms.cda.api.errors.CdaError;
import cwms.cda.data.dao.MeasurementDao;
import cwms.cda.data.dto.StatusResponse;
import cwms.cda.data.dto.measurement.Measurement;
Expand Down Expand Up @@ -165,10 +166,7 @@ public void getAll(@NotNull Context ctx) {
@OpenApi(ignore = true)
@Override
public void getOne(@NotNull Context ctx, @NotNull String locationId) {
try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}

ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down Expand Up @@ -208,9 +206,7 @@ public void create(Context ctx) {
@OpenApi(ignore = true)
@Override
public void update(@NotNull Context ctx, @NotNull String locationId) {
try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(ignore = true)
@Override
public void create(Context ctx) {
ctx.status(HttpServletResponse.SC_NOT_FOUND);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void delete(Context ctx, String id) {
ctx.status(HttpServletResponse.SC_NOT_FOUND);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());

}

Expand Down Expand Up @@ -131,16 +131,13 @@ public void getAll(Context ctx) {
@OpenApi(ignore = true)
@Override
public void getOne(Context ctx, String id) {
try (final Timer.Context timeContext = markAndTime(GET_ONE)) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void update(Context ctx, String id) {
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());

}

}
6 changes: 3 additions & 3 deletions cwms-data-api/src/main/java/cwms/cda/api/PoolController.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,18 @@ public void getOne(@NotNull Context ctx, @NotNull String poolId) {
@OpenApi(ignore = true)
@Override
public void create(@NotNull Context ctx) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void update(@NotNull Context ctx, @NotNull String locationCode) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void delete(@NotNull Context ctx, @NotNull String locationCode) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ public void getAll(Context ctx) {
@OpenApi(ignore = true)
@Override
public void getOne(Context ctx, String templateId) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET); //To change body of
// generated methods, choose Tools | Specs.
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import cwms.cda.api.errors.CdaError;
import cwms.cda.data.dao.DeleteRule;
import cwms.cda.data.dao.JooqDao;
import cwms.cda.data.dao.texttimeseries.StandardTextDao;
Expand Down Expand Up @@ -182,7 +183,7 @@ public void create(@NotNull Context ctx) {
@OpenApi(ignore = true)
@Override
public void update(@NotNull Context ctx, @NotNull String oldTextTimeSeriesId) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void getAll(@NotNull Context ctx) {
@OpenApi(ignore = true)
@Override
public void getOne(@NotNull Context ctx, @NotNull String templateId) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public void create(Context ctx) {
@OpenApi(ignore = true)
@Override
public void update(@NotNull Context ctx, @NotNull String locationCode) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ private void addLinkHeader(@NotNull Context ctx, TimeSeries ts, ContentType cont
public void getOne(@NotNull Context ctx, @NotNull String id) {

try (final Timer.Context ignored = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

}
Expand Down
11 changes: 5 additions & 6 deletions cwms-data-api/src/main/java/cwms/cda/api/TimeZoneController.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.codahale.metrics.Histogram;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import cwms.cda.api.errors.CdaError;
import cwms.cda.data.dao.TimeZoneDao;
import cwms.cda.data.dto.TimeZoneId;
import cwms.cda.data.dto.TimeZoneIds;
Expand Down Expand Up @@ -54,13 +55,13 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(ignore = true)
@Override
public void create(Context ctx) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void delete(Context ctx, String id) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(
Expand Down Expand Up @@ -130,15 +131,13 @@ public void getAll(Context ctx) {
@OpenApi(ignore = true)
@Override
public void getOne(Context ctx, String id) {
try (Timer.Context timeContext = markAndTime(GET_ONE)) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
}
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void update(Context ctx, String id) {
throw new UnsupportedOperationException(NOT_SUPPORTED_YET);
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import io.javalin.plugin.openapi.annotations.OpenApiSecurity;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.jetbrains.annotations.NotNull;
import org.jooq.DSLContext;

Expand Down Expand Up @@ -180,7 +181,7 @@ public void getOne(Context ctx, @NotNull String keyName) {
)
@Override
public void update(@NotNull Context ctx, @NotNull String arg1) {
throw new UnsupportedOperationException("Update is not implemented. Delete and create a new key.");
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.util.List;

import javax.servlet.http.HttpServletResponse;
import org.jooq.DSLContext;

import com.codahale.metrics.MetricRegistry;
Expand Down Expand Up @@ -63,14 +64,13 @@ private Timer.Context markAndTime(String subject) {
@OpenApi(ignore = true)
@Override
public void create(Context ctx) {
throw new UnsupportedOperationException("Unimplemented method 'create'");
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}

@OpenApi(ignore = true)
@Override
public void delete(Context ctx, String username) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'delete'");
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}


Expand Down Expand Up @@ -170,7 +170,7 @@ public void getOne(Context ctx, String userName) {
)
@Override
public void update(Context ctx, String arg1) {
throw new UnsupportedOperationException("Unimplemented method 'update'");
ctx.status(HttpServletResponse.SC_NOT_IMPLEMENTED).json(CdaError.notImplemented());
}


Expand Down
Loading
Loading