Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/remove deprecated #461

Merged
merged 4 commits into from
Dec 4, 2023
Merged
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ eclipse {

allprojects {
group = 'mil.army.usace.hec.cwms'
version = '3.0-SNAPSHOT' // ApiServlet.VERSION should be updated to match MAJOR.MINOR changes.
version = '3.1-SNAPSHOT' // ApiServlet.VERSION should be updated to match MAJOR.MINOR changes.
}

// versions for shared dependencies
Expand Down
15 changes: 2 additions & 13 deletions cwms-data-api/src/main/java/cwms/cda/api/BlobController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import static cwms.cda.api.Controllers.LIKE;
import static cwms.cda.api.Controllers.OFFICE;
import static cwms.cda.api.Controllers.PAGE;
import static cwms.cda.api.Controllers.PAGESIZE2;
import static cwms.cda.api.Controllers.PAGESIZE3;
import static cwms.cda.api.Controllers.PAGE_SIZE;
import static cwms.cda.api.Controllers.RESULTS;
import static cwms.cda.api.Controllers.SIZE;
Expand Down Expand Up @@ -79,15 +77,6 @@ protected DSLContext getDslContext(Context ctx) {
+ " value, and can be obtained from the 'next-page' value in "
+ "the response."
),
@OpenApiParam(name = CURSOR,
deprecated = true,
description = "Deprecated. Use 'page' instead."
),
@OpenApiParam(name = PAGESIZE3,
deprecated = true,
type = Integer.class,
description = "Deprecated. Use page-size instead."
),
@OpenApiParam(name = PAGE_SIZE,
type = Integer.class,
description = "How many entries per page returned. Default "
Expand Down Expand Up @@ -126,8 +115,8 @@ public void getAll(Context ctx) {
return;
}

int pageSize = queryParamAsClass(ctx, new String[]{PAGE_SIZE, PAGESIZE3,
PAGESIZE2}, Integer.class, defaultPageSize, metrics,
int pageSize = queryParamAsClass(ctx, new String[]{PAGE_SIZE},
Integer.class, defaultPageSize, metrics,
name(BlobController.class.getName(), GET_ALL));

String like = ctx.queryParamAsClass(LIKE, String.class).getOrDefault(".*");
Expand Down
52 changes: 8 additions & 44 deletions cwms-data-api/src/main/java/cwms/cda/api/CatalogController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,16 @@
import static cwms.cda.api.Controllers.LIKE;
import static cwms.cda.api.Controllers.LOCATIONS;
import static cwms.cda.api.Controllers.LOCATION_CATEGORY_LIKE;
import static cwms.cda.api.Controllers.LOCATION_CATEGORY_LIKE2;
import static cwms.cda.api.Controllers.LOCATION_GROUP_LIKE;
import static cwms.cda.api.Controllers.LOCATION_GROUP_LIKE2;
import static cwms.cda.api.Controllers.OFFICE;
import static cwms.cda.api.Controllers.PAGE;
import static cwms.cda.api.Controllers.PAGESIZE2;
import static cwms.cda.api.Controllers.PAGESIZE3;
import static cwms.cda.api.Controllers.PAGE_SIZE;
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.TIMESERIES;
import static cwms.cda.api.Controllers.TIMESERIESCATEGORYLIKE2;
import static cwms.cda.api.Controllers.TIMESERIES_CATEGORY_LIKE;
import static cwms.cda.api.Controllers.TIMESERIES_GROUP_LIKE;
import static cwms.cda.api.Controllers.TIMESERIES_GROUP_LIKE2;
import static cwms.cda.api.Controllers.UNITSYSTEM2;
import static cwms.cda.api.Controllers.UNIT_SYSTEM;
import static cwms.cda.api.Controllers.queryParamAsClass;

Expand Down Expand Up @@ -101,24 +94,11 @@ public void getAll(Context ctx) {
description = "This end point can return a lot of data, this "
+ "identifies where in the request you are."
),
@OpenApiParam(name = CURSOR,
deprecated = true,
description = "Deprecated. Use 'page' instead."
),

@OpenApiParam(name = PAGE_SIZE,
type = Integer.class,
description = "How many entires per page returned. Default 500."
),
@OpenApiParam(name = PAGESIZE3,
deprecated = true,
type = Integer.class,
description = "Deprecated. Use page-size."
),
@OpenApiParam(name = UNITSYSTEM2,
deprecated = true,
type = UnitSystem.class,
description = "Deprecated. Use unit-system."
),
@OpenApiParam(name = UNIT_SYSTEM,
type = UnitSystem.class,
description = UnitSystem.DESCRIPTION
Expand All @@ -134,34 +114,18 @@ public void getAll(Context ctx) {
description = "Posix <a href=\"regexp.html\">regular expression</a> matching against the "
+ "timeseries category id"
),
@OpenApiParam(name = TIMESERIESCATEGORYLIKE2,
deprecated = true,
description = "Deprecated. Use timeseries-category-like."
),
@OpenApiParam(name = TIMESERIES_GROUP_LIKE,
description = "Posix <a href=\"regexp.html\">regular expression</a> matching against the "
+ "timeseries group id"
),
@OpenApiParam(name = TIMESERIES_GROUP_LIKE2,
deprecated = true,
description = "Deprecated. Use timeseries-group-like."
),
@OpenApiParam(name = LOCATION_CATEGORY_LIKE,
description = "Posix <a href=\"regexp.html\">regular expression</a> matching against the location"
+ " category id"
),
@OpenApiParam(name = LOCATION_CATEGORY_LIKE2,
deprecated = true,
description = "Deprecated. Use location-category-like."
),
@OpenApiParam(name = LOCATION_GROUP_LIKE,
description = "Posix <a href=\"regexp.html\">regular expression</a> matching against the location"
+ " group id"
),
@OpenApiParam(name = LOCATION_GROUP_LIKE2,
deprecated = true,
description = "Deprecated. Use location-group-like."
),
@OpenApiParam(name = BOUNDING_OFFICE_LIKE, description = "Posix <a href=\"regexp.html\">regular expression</a> "
+ "matching against the location bounding office. "
+ "When this field is used items with no bounding office set will not be present in results."),
Expand Down Expand Up @@ -196,12 +160,12 @@ public void getOne(Context ctx, @NotNull String dataSet) {
String cursor = queryParamAsClass(ctx, new String[]{PAGE, CURSOR},
String.class, "", metrics, name(CatalogController.class.getName(), GET_ONE));

int pageSize = queryParamAsClass(ctx, new String[]{PAGE_SIZE, PAGESIZE3,
PAGESIZE2}, Integer.class, defaultPageSize, metrics,
int pageSize = queryParamAsClass(ctx, new String[]{PAGE_SIZE },
Integer.class, defaultPageSize, metrics,
name(CatalogController.class.getName(), GET_ONE));

String unitSystem = queryParamAsClass(ctx,
new String[]{UNIT_SYSTEM, UNITSYSTEM2},
new String[]{UNIT_SYSTEM, },
String.class, UnitSystem.SI.getValue(), metrics,
name(CatalogController.class.getName(), GET_ONE));

Expand All @@ -211,16 +175,16 @@ public void getOne(Context ctx, @NotNull String dataSet) {

String like = ctx.queryParamAsClass(LIKE, String.class).getOrDefault(".*");

String tsCategoryLike = queryParamAsClass(ctx, new String[]{TIMESERIES_CATEGORY_LIKE, TIMESERIESCATEGORYLIKE2},
String tsCategoryLike = queryParamAsClass(ctx, new String[]{TIMESERIES_CATEGORY_LIKE},
String.class, null, metrics, name(CatalogController.class.getName(), GET_ONE));

String tsGroupLike = queryParamAsClass(ctx, new String[]{TIMESERIES_GROUP_LIKE, TIMESERIES_GROUP_LIKE2},
String tsGroupLike = queryParamAsClass(ctx, new String[]{TIMESERIES_GROUP_LIKE},
String.class, null, metrics, name(CatalogController.class.getName(), GET_ONE));

String locCategoryLike = queryParamAsClass(ctx, new String[]{LOCATION_CATEGORY_LIKE, LOCATION_CATEGORY_LIKE2},
String locCategoryLike = queryParamAsClass(ctx, new String[]{LOCATION_CATEGORY_LIKE},
String.class, null, metrics, name(CatalogController.class.getName(), GET_ONE));

String locGroupLike = queryParamAsClass(ctx, new String[]{LOCATION_GROUP_LIKE, LOCATION_GROUP_LIKE2},
String locGroupLike = queryParamAsClass(ctx, new String[]{LOCATION_GROUP_LIKE },
String.class, null, metrics, name(CatalogController.class.getName(), GET_ONE));

String boundingOfficeLike = queryParamAsClass(ctx, new String[]{BOUNDING_OFFICE_LIKE},
Expand Down
24 changes: 3 additions & 21 deletions cwms-data-api/src/main/java/cwms/cda/api/ClobController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
import static cwms.cda.api.Controllers.GET_ONE;
import static cwms.cda.api.Controllers.IGNORE_NULLS;
import static cwms.cda.api.Controllers.INCLUDE_VALUES;
import static cwms.cda.api.Controllers.INCLUDE_VALUES2;
import static cwms.cda.api.Controllers.LIKE;
import static cwms.cda.api.Controllers.OFFICE;
import static cwms.cda.api.Controllers.PAGE;
import static cwms.cda.api.Controllers.PAGESIZE2;
import static cwms.cda.api.Controllers.PAGESIZE3;
import static cwms.cda.api.Controllers.PAGE_SIZE;
import static cwms.cda.api.Controllers.RESULTS;
import static cwms.cda.api.Controllers.SIZE;
Expand Down Expand Up @@ -99,30 +96,16 @@ protected DSLContext getDslContext(Context ctx) {
+ " value, and can be obtained from the 'next-page' value in "
+ "the response."
),
@OpenApiParam(name = CURSOR,
deprecated = true,
description = "Deprecated. Use 'page' instead."
),
@OpenApiParam(name = PAGE_SIZE,
type = Integer.class,
description = "How many entries per page returned. Default "
+ defaultPageSize + "."
),
@OpenApiParam(name = PAGESIZE3,
deprecated = true,
type = Integer.class,
description = "Deprecated, use 'page-size' instead."
),
@OpenApiParam(name = INCLUDE_VALUES,
type = Boolean.class,
description = "Do you want the value associated with this particular "
+ "clob (default: false)"
),
@OpenApiParam(name = INCLUDE_VALUES2,
deprecated = true,
type = Boolean.class,
description = "Deprecated, use 'include-values' instead."
),
@OpenApiParam(name = LIKE,
description = "Posix <a href=\"regexp.html\">regular expression</a> matching against the id"
)
Expand Down Expand Up @@ -159,12 +142,11 @@ public void getAll(Context ctx) {
return;
}

int pageSize = queryParamAsClass(ctx, new String[]{PAGE_SIZE, PAGESIZE3,
PAGESIZE2}, Integer.class, defaultPageSize, metrics,
int pageSize = queryParamAsClass(ctx, new String[]{PAGE_SIZE}, Integer.class, defaultPageSize, metrics,
name(ClobController.class.getName(), GET_ALL));

boolean includeValues = queryParamAsClass(ctx, new String[]{INCLUDE_VALUES,
INCLUDE_VALUES2}, Boolean.class, false, metrics,
boolean includeValues = queryParamAsClass(ctx, new String[]{INCLUDE_VALUES},
Boolean.class, false, metrics,
name(ClobController.class.getName(), GET_ALL));
String like = ctx.queryParamAsClass(LIKE, String.class).getOrDefault(".*");

Expand Down
15 changes: 6 additions & 9 deletions cwms-data-api/src/main/java/cwms/cda/api/Controllers.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public final class Controllers {
public static final String PAGE_SIZE = "page-size";

// IF the constant has a number at the end its a deprecated variant
public static final String PAGESIZE2 = "pagesize"; // deprecated
public static final String PAGESIZE3 = "pageSize"; // deprecated

public static final String SIZE = "size";

public static final String OFFICE = "office";
Expand All @@ -60,20 +59,19 @@ public final class Controllers {
public static final String LIKE = "like";

public static final String UNIT_SYSTEM = "unit-system";
public static final String UNITSYSTEM2 = "unitSystem"; // deprecated

public static final String TIMESERIES_CATEGORY_LIKE = "timeseries-category-like";
public static final String TIMESERIESCATEGORYLIKE2 = "timeseriesCategoryLike"; // deprecated

public static final String LOCATION_CATEGORY_LIKE = "location-category-like";
public static final String LOCATION_GROUP_LIKE = "location-group-like";
public static final String TIMESERIES_GROUP_LIKE2 = "timeseriesGroupLike"; // deprecated
public static final String LOCATION_CATEGORY_LIKE2 = "locationCategoryLike"; // deprecated
public static final String LOCATION_GROUP_LIKE2 = "locationGroupLike"; // deprecated




public static final String TIMESERIES_GROUP_LIKE = "timeseries-group-like";
public static final String ACCEPT = "Accept";
public static final String CLOB_ID = "clob-id";
public static final String INCLUDE_VALUES = "include-values";
public static final String INCLUDE_VALUES2 = "includeValues"; // deprecated
public static final String FAIL_IF_EXISTS = "fail-if-exists";
public static final String IGNORE_NULLS = "ignore-nulls";
public static final String EFFECTIVE_DATE = "effective-date";
Expand Down Expand Up @@ -122,7 +120,6 @@ public final class Controllers {
public static final String TS_IDS = "ts-ids";
public static final String DATE_FORMAT = "YYYY-MM-dd'T'hh:mm:ss[Z'['VV']']";
public static final String INCLUDE_ASSIGNED = "include-assigned";
public static final String INCLUDE_ASSIGNED2 = "includeAssigned"; // deprecated
public static final String ANY_MASK = "*";
public static final String ID_MASK = "id-mask";
public static final String NAME_MASK = "name-mask";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ public void create(@NotNull Context ctx) {
+ "the location level whose data is to be deleted. If this field is "
+ "not specified, matching location level information will be deleted"
+ " from all offices."),

@OpenApiParam(name = DATE, deprecated = true, description = "Deprecated, use "
+ EFFECTIVE_DATE),
@OpenApiParam(name = EFFECTIVE_DATE, description = "Specifies the "
+ "effective date of the level to be deleted. If not provided will "
+ "delete all data and reference to the location level.")
Expand Down Expand Up @@ -193,8 +190,6 @@ public void delete(@NotNull Context ctx, @NotNull String levelId) {

@OpenApi(
queryParams = {
@OpenApiParam(name = NAME, deprecated = true, description = "Deprecated, use "
+ LEVEL_ID_MASK + ". "),
@OpenApiParam(name = LEVEL_ID_MASK, description = "Specifies the name(s) of "
+ "the location level(s) whose data is to be included in the response. "
+ "Uses * for all."),
Expand Down Expand Up @@ -352,8 +347,6 @@ public void getAll(Context ctx) {
queryParams = {
@OpenApiParam(name = OFFICE, required = true, description = "Specifies the "
+ "office of the Location Level to be returned"),
@OpenApiParam(name = DATE, deprecated = true, description = "Deprecated, use "
+ EFFECTIVE_DATE),
@OpenApiParam(name = EFFECTIVE_DATE, required = true, description = "Specifies "
+ "the effective date of Location Level to be returned"),
@OpenApiParam(name = UNIT, required = false, description = "Desired unit for "
Expand Down Expand Up @@ -401,8 +394,6 @@ String.class, null, metrics, name(LevelsController.class.getName(),
+ "location level id of the Location Level to be updated"),
},
queryParams = {
@OpenApiParam(name = DATE, deprecated = true, description = "Deprecated, use "
+ EFFECTIVE_DATE),
@OpenApiParam(name = EFFECTIVE_DATE, description = "Specifies "
+ "the effective date of Location Level that will be updated")
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ private Timer.Context markAndTime(String subject) {
+ "offices shall be returned."),
@OpenApiParam(name = INCLUDE_ASSIGNED, type = Boolean.class, description = "Include"
+ " the assigned locations in the returned location groups. (default: false)"),
@OpenApiParam(name = INCLUDE_ASSIGNED2, deprecated = true, type = Boolean.class,
description = "Deprecated. Use include-assigned instead."),

@OpenApiParam(name = LOCATION_CATEGORY_LIKE, description = "Posix <a href=\"regexp.html\">regular expression</a> "
+ "matching against the location category id"), },
responses = {
Expand All @@ -108,7 +107,7 @@ public void getAll(Context ctx) {

String office = ctx.queryParam(OFFICE);

boolean includeAssigned = queryParamAsClass(ctx, new String[]{INCLUDE_ASSIGNED, INCLUDE_ASSIGNED2},
boolean includeAssigned = queryParamAsClass(ctx, new String[]{INCLUDE_ASSIGNED},
Boolean.class, false, metrics, name(LocationGroupController.class.getName(),
GET_ALL));

Expand Down
Loading
Loading