Refactoring/simplifying rest resources code (2) (#2444)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -42,11 +42,11 @@ public interface MgmtActionRestApi {
|
|||||||
/**
|
/**
|
||||||
* Handles the GET request of retrieving all actions.
|
* Handles the GET request of retrieving all actions.
|
||||||
*
|
*
|
||||||
|
* @param rsqlParam the search parameter in the request URL, syntax {@code q=distributionSet.id==1}
|
||||||
* @param pagingOffsetParam the offset of list of actions for pagination, might not be present in the rest request then default value will
|
* @param pagingOffsetParam the offset of list of actions for pagination, might not be present in the rest request then default value will
|
||||||
* be applied
|
* be applied
|
||||||
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
||||||
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
||||||
* @param rsqlParam the search parameter in the request URL, syntax {@code q=distributionSet.id==1}
|
|
||||||
* @param representationModeParam the representation mode parameter specifying whether a compact or a full representation shall be returned
|
* @param representationModeParam the representation mode parameter specifying whether a compact or a full representation shall be returned
|
||||||
* @return a list of all actions for a defined or default page request with status OK. The response is always paged. In any failure the
|
* @return a list of all actions for a defined or default page request with status OK. The response is always paged. In any failure the
|
||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
@@ -71,7 +71,11 @@ public interface MgmtActionRestApi {
|
|||||||
})
|
})
|
||||||
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
@GetMapping(value = MgmtRestConstants.ACTION_V1_REQUEST_MAPPING, produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtAction>> getActions(
|
ResponseEntity<PagedList<MgmtAction>> getActions(
|
||||||
@RequestParam(
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
|
@Schema(description = """
|
||||||
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
|
available fields.""")
|
||||||
|
String rsqlParam, @RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -88,11 +92,6 @@ public interface MgmtActionRestApi {
|
|||||||
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
||||||
in the result.""")
|
in the result.""")
|
||||||
String sortParam,
|
String sortParam,
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
|
||||||
@Schema(description = """
|
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
|
||||||
available fields.""")
|
|
||||||
String rsqlParam,
|
|
||||||
@RequestParam(
|
@RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE,
|
value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT)
|
||||||
|
|||||||
@@ -64,11 +64,11 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
/**
|
/**
|
||||||
* Handles the GET request of retrieving all DistributionSets .
|
* Handles the GET request of retrieving all DistributionSets .
|
||||||
*
|
*
|
||||||
|
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
||||||
* @param pagingOffsetParam the offset of list of sets for pagination, might not be present in the rest request then default value will
|
* @param pagingOffsetParam the offset of list of sets for pagination, might not be present in the rest request then default value will
|
||||||
* be applied
|
* be applied
|
||||||
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
||||||
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
||||||
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
|
||||||
* @return a list of all set for a defined or default page request with status OK. The response is always paged. In any failure the
|
* @return a list of all set for a defined or default page request with status OK. The response is always paged. In any failure the
|
||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
*/
|
*/
|
||||||
@@ -94,7 +94,11 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.DISTRIBUTIONSET_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
|
ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
|
||||||
@RequestParam(
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
|
@Schema(description = """
|
||||||
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
|
available fields.""")
|
||||||
|
String rsqlParam, @RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -110,12 +114,7 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
consists of the name of a field and the sort direction (ASC for ascending and DESC descending).
|
consists of the name of a field and the sort direction (ASC for ascending and DESC descending).
|
||||||
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
||||||
in the result.""")
|
in the result.""")
|
||||||
String sortParam,
|
String sortParam);
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
|
||||||
@Schema(description = """
|
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
|
||||||
available fields.""")
|
|
||||||
String rsqlParam);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the GET request of retrieving a single DistributionSet .
|
* Handles the GET request of retrieving a single DistributionSet .
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ public interface MgmtRolloutRestApi {
|
|||||||
/**
|
/**
|
||||||
* Handles the GET request of retrieving all rollouts.
|
* Handles the GET request of retrieving all rollouts.
|
||||||
*
|
*
|
||||||
|
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
||||||
* @param pagingOffsetParam the offset of list of rollouts for pagination, might not be present in the rest request then default value will
|
* @param pagingOffsetParam the offset of list of rollouts for pagination, might not be present in the rest request then default value will
|
||||||
* be applied
|
* be applied
|
||||||
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
||||||
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
||||||
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
|
||||||
* @param representationModeParam the representation mode parameter specifying whether a compact or a full representation shall be returned
|
* @param representationModeParam the representation mode parameter specifying whether a compact or a full representation shall be returned
|
||||||
* @return a list of all rollouts for a defined or default page request with status OK. The response is always paged. In any failure the
|
* @return a list of all rollouts for a defined or default page request with status OK. The response is always paged. In any failure the
|
||||||
* JsonResponseExceptionHandler is handling the response.
|
* JsonResponseExceptionHandler is handling the response.
|
||||||
@@ -82,7 +82,11 @@ public interface MgmtRolloutRestApi {
|
|||||||
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING,
|
@GetMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING,
|
||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
|
ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
|
||||||
@RequestParam(
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
|
@Schema(description = """
|
||||||
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
|
available fields.""")
|
||||||
|
String rsqlParam, @RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -99,11 +103,6 @@ public interface MgmtRolloutRestApi {
|
|||||||
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
||||||
in the result.""")
|
in the result.""")
|
||||||
String sortParam,
|
String sortParam,
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
|
||||||
@Schema(description = """
|
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
|
||||||
available fields.""")
|
|
||||||
String rsqlParam,
|
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE,
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT)
|
||||||
String representationModeParam);
|
String representationModeParam);
|
||||||
@@ -415,11 +414,11 @@ public interface MgmtRolloutRestApi {
|
|||||||
/**
|
/**
|
||||||
* Handles the GET request of retrieving all rollout groups referred to a rollout.
|
* Handles the GET request of retrieving all rollout groups referred to a rollout.
|
||||||
*
|
*
|
||||||
|
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
||||||
* @param pagingOffsetParam the offset of list of rollout groups for pagination, might not be present in the rest request then default value
|
* @param pagingOffsetParam the offset of list of rollout groups for pagination, might not be present in the rest request then default value
|
||||||
* will be applied
|
* will be applied
|
||||||
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
||||||
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
||||||
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
|
||||||
* @param representationModeParam the representation mode parameter specifying whether a compact or a full representation shall be returned
|
* @param representationModeParam the representation mode parameter specifying whether a compact or a full representation shall be returned
|
||||||
* @return a list of all rollout groups referred to a rollout for a defined or default page request with status OK. The response is always
|
* @return a list of all rollout groups referred to a rollout for a defined or default page request with status OK. The response is always
|
||||||
* paged. In any failure the JsonResponseExceptionHandler is handling the response.
|
* paged. In any failure the JsonResponseExceptionHandler is handling the response.
|
||||||
@@ -450,7 +449,11 @@ public interface MgmtRolloutRestApi {
|
|||||||
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
produces = { MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE })
|
||||||
ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(
|
ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(
|
||||||
@PathVariable("rolloutId") Long rolloutId,
|
@PathVariable("rolloutId") Long rolloutId,
|
||||||
@RequestParam(
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
|
@Schema(description = """
|
||||||
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
|
available fields.""")
|
||||||
|
String rsqlParam, @RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -467,11 +470,6 @@ public interface MgmtRolloutRestApi {
|
|||||||
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
||||||
in the result.""")
|
in the result.""")
|
||||||
String sortParam,
|
String sortParam,
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
|
||||||
@Schema(description = """
|
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
|
||||||
available fields.""")
|
|
||||||
String rsqlParam,
|
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE,
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_REPRESENTATION_MODE_DEFAULT)
|
||||||
String representationModeParam);
|
String representationModeParam);
|
||||||
@@ -516,11 +514,11 @@ public interface MgmtRolloutRestApi {
|
|||||||
*
|
*
|
||||||
* @param rolloutId the ID of the rollout
|
* @param rolloutId the ID of the rollout
|
||||||
* @param groupId the ID of the rollout group
|
* @param groupId the ID of the rollout group
|
||||||
|
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
||||||
* @param pagingOffsetParam the offset of list of rollout groups for pagination, might not be present in the rest request then default value
|
* @param pagingOffsetParam the offset of list of rollout groups for pagination, might not be present in the rest request then default value
|
||||||
* will be applied
|
* will be applied
|
||||||
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
* @param pagingLimitParam the limit of the paged request, might not be present in the rest request then default value will be applied
|
||||||
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
* @param sortParam the sorting parameter in the request URL, syntax {@code field:direction, field:direction}
|
||||||
* @param rsqlParam the search parameter in the request URL, syntax {@code q=name==abc}
|
|
||||||
* @return a paged list of targets related to a specific rollout and rollout group.
|
* @return a paged list of targets related to a specific rollout and rollout group.
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "Return all targets related to a specific rollout group",
|
@Operation(summary = "Return all targets related to a specific rollout group",
|
||||||
@@ -551,7 +549,11 @@ public interface MgmtRolloutRestApi {
|
|||||||
ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(
|
ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(
|
||||||
@PathVariable("rolloutId") Long rolloutId,
|
@PathVariable("rolloutId") Long rolloutId,
|
||||||
@PathVariable("groupId") Long groupId,
|
@PathVariable("groupId") Long groupId,
|
||||||
@RequestParam(
|
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
||||||
|
@Schema(description = """
|
||||||
|
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
||||||
|
available fields.""")
|
||||||
|
String rsqlParam, @RequestParam(
|
||||||
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
value = MgmtRestConstants.REQUEST_PARAMETER_PAGING_OFFSET,
|
||||||
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
defaultValue = MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET)
|
||||||
@Schema(description = "The paging offset (default is 0)")
|
@Schema(description = "The paging offset (default is 0)")
|
||||||
@@ -567,12 +569,7 @@ public interface MgmtRolloutRestApi {
|
|||||||
consists of the name of a field and the sort direction (ASC for ascending and DESC descending).
|
consists of the name of a field and the sort direction (ASC for ascending and DESC descending).
|
||||||
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
The sequence of the sort criteria (multiple can be used) defines the sort order of the entities
|
||||||
in the result.""")
|
in the result.""")
|
||||||
String sortParam,
|
String sortParam);
|
||||||
@RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false)
|
|
||||||
@Schema(description = """
|
|
||||||
Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for
|
|
||||||
available fields.""")
|
|
||||||
String rsqlParam);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the POST request to force trigger processing next group of a rollout even success threshold isn't yet met
|
* Handles the POST request to force trigger processing next group of a rollout even success threshold isn't yet met
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ public class MgmtActionResource implements MgmtActionRestApi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<PagedList<MgmtAction>> getActions(
|
public ResponseEntity<PagedList<MgmtAction>> getActions(
|
||||||
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam,
|
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam,
|
||||||
final String representationModeParam) {
|
final String representationModeParam) {
|
||||||
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeActionSortParam(sortParam));
|
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeActionSortParam(sortParam));
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
|
public ResponseEntity<PagedList<MgmtDistributionSet>> getDistributionSets(
|
||||||
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) {
|
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) {
|
||||||
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeDistributionSetSortParam(sortParam));
|
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeDistributionSetSortParam(sortParam));
|
||||||
final Slice<DistributionSet> findDsPage;
|
final Slice<DistributionSet> findDsPage;
|
||||||
final long countModulesAll;
|
final long countModulesAll;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
|
public ResponseEntity<PagedList<MgmtRolloutResponseBody>> getRollouts(
|
||||||
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam,
|
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam,
|
||||||
final String representationModeParam) {
|
final String representationModeParam) {
|
||||||
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeRolloutSortParam(sortParam));
|
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeRolloutSortParam(sortParam));
|
||||||
final boolean isFullMode = parseRepresentationMode(representationModeParam) == MgmtRepresentationMode.FULL;
|
final boolean isFullMode = parseRepresentationMode(representationModeParam) == MgmtRepresentationMode.FULL;
|
||||||
@@ -207,7 +207,7 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi {
|
|||||||
@Override
|
@Override
|
||||||
public ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(
|
public ResponseEntity<PagedList<MgmtRolloutGroupResponseBody>> getRolloutGroups(
|
||||||
final Long rolloutId,
|
final Long rolloutId,
|
||||||
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam,
|
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam,
|
||||||
final String representationModeParam) {
|
final String representationModeParam) {
|
||||||
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeRolloutSortParam(sortParam));
|
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeRolloutSortParam(sortParam));
|
||||||
final boolean isFullMode = parseRepresentationMode(representationModeParam) == MgmtRepresentationMode.FULL;
|
final boolean isFullMode = parseRepresentationMode(representationModeParam) == MgmtRepresentationMode.FULL;
|
||||||
@@ -249,7 +249,7 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi {
|
|||||||
@Override
|
@Override
|
||||||
public ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(
|
public ResponseEntity<PagedList<MgmtTarget>> getRolloutGroupTargets(
|
||||||
final Long rolloutId, final Long groupId,
|
final Long rolloutId, final Long groupId,
|
||||||
final int pagingOffsetParam, final int pagingLimitParam, final String sortParam, final String rsqlParam) {
|
final String rsqlParam, final int pagingOffsetParam, final int pagingLimitParam, final String sortParam) {
|
||||||
findRolloutOrThrowException(rolloutId);
|
findRolloutOrThrowException(rolloutId);
|
||||||
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeRolloutSortParam(sortParam));
|
final Pageable pageable = PagingUtility.toPageable(pagingOffsetParam, pagingLimitParam, sanitizeRolloutSortParam(sortParam));
|
||||||
final Page<Target> rolloutGroupTargets;
|
final Page<Target> rolloutGroupTargets;
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public final class MgmtRolloutMapper {
|
|||||||
body.add(linkTo(methodOn(MgmtRolloutRestApi.class).deny(rollout.getId(), null)).withRel("deny").expand());
|
body.add(linkTo(methodOn(MgmtRolloutRestApi.class).deny(rollout.getId(), null)).withRel("deny").expand());
|
||||||
body.add(linkTo(methodOn(MgmtRolloutRestApi.class).getRolloutGroups(
|
body.add(linkTo(methodOn(MgmtRolloutRestApi.class).getRolloutGroups(
|
||||||
rollout.getId(),
|
rollout.getId(),
|
||||||
REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET_VALUE, REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, null, null, null))
|
null, REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET_VALUE, REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE, null, null))
|
||||||
.withRel("groups").expand());
|
.withRel("groups").expand());
|
||||||
|
|
||||||
final DistributionSet distributionSet = rollout.getDistributionSet();
|
final DistributionSet distributionSet = rollout.getDistributionSet();
|
||||||
|
|||||||
@@ -73,9 +73,9 @@ public final class MgmtTargetFilterQueryMapper {
|
|||||||
if (isRepresentationFull && distributionSet != null) {
|
if (isRepresentationFull && distributionSet != null) {
|
||||||
targetRest.add(
|
targetRest.add(
|
||||||
linkTo(methodOn(MgmtDistributionSetRestApi.class).getDistributionSets(
|
linkTo(methodOn(MgmtDistributionSetRestApi.class).getDistributionSets(
|
||||||
Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET),
|
"name==" + distributionSet.getName() + ";version==" + distributionSet.getVersion(), Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET),
|
||||||
Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null,
|
Integer.parseInt(MgmtRestConstants.REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT), null
|
||||||
"name==" + distributionSet.getName() + ";version==" + distributionSet.getVersion())).withRel("DS").expand());
|
)).withRel("DS").expand());
|
||||||
}
|
}
|
||||||
|
|
||||||
return targetRest;
|
return targetRest;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class DistributionSetView extends TableView<MgmtDistributionSet, Long> {
|
|||||||
},
|
},
|
||||||
(query, rsqlFilter) -> Optional.ofNullable(
|
(query, rsqlFilter) -> Optional.ofNullable(
|
||||||
hawkbitClient.getDistributionSetRestApi()
|
hawkbitClient.getDistributionSetRestApi()
|
||||||
.getDistributionSets(query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter)
|
.getDistributionSets(rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC)
|
||||||
.getBody())
|
.getBody())
|
||||||
.stream().flatMap(body -> body.getContent().stream()),
|
.stream().flatMap(body -> body.getContent().stream()),
|
||||||
e -> new CreateDialog(hawkbitClient).result(),
|
e -> new CreateDialog(hawkbitClient).result(),
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
|||||||
(query, rsqlFilter) -> Optional.ofNullable(
|
(query, rsqlFilter) -> Optional.ofNullable(
|
||||||
hawkbitClient.getRolloutRestApi()
|
hawkbitClient.getRolloutRestApi()
|
||||||
.getRollouts(
|
.getRollouts(
|
||||||
query.getOffset(), query.getPageSize(), Constants.NAME_ASC, rsqlFilter, "full")
|
rsqlFilter, query.getOffset(), query.getPageSize(), Constants.NAME_ASC, "full")
|
||||||
.getBody()).stream().flatMap(page -> page.getContent().stream()),
|
.getBody()).stream().flatMap(page -> page.getContent().stream()),
|
||||||
selectionGrid -> new CreateDialog(hawkbitClient).result(),
|
selectionGrid -> new CreateDialog(hawkbitClient).result(),
|
||||||
selectionGrid -> {
|
selectionGrid -> {
|
||||||
@@ -243,8 +243,8 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
|||||||
hawkbitClient.getRolloutRestApi()
|
hawkbitClient.getRolloutRestApi()
|
||||||
.getRolloutGroups(
|
.getRolloutGroups(
|
||||||
rollout.getId(),
|
rollout.getId(),
|
||||||
query.getOffset(), query.getPageSize(),
|
null, query.getOffset(), query.getPageSize(),
|
||||||
null, null, "full")
|
null, "full")
|
||||||
.getBody())
|
.getBody())
|
||||||
.stream().flatMap(body -> body.getContent().stream())
|
.stream().flatMap(body -> body.getContent().stream())
|
||||||
.skip(query.getOffset())
|
.skip(query.getOffset())
|
||||||
@@ -294,7 +294,7 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
|||||||
this::readyToCreate,
|
this::readyToCreate,
|
||||||
Optional.ofNullable(
|
Optional.ofNullable(
|
||||||
hawkbitClient.getDistributionSetRestApi()
|
hawkbitClient.getDistributionSetRestApi()
|
||||||
.getDistributionSets(0, 30, Constants.NAME_ASC, null)
|
.getDistributionSets(null, 0, 30, Constants.NAME_ASC)
|
||||||
.getBody())
|
.getBody())
|
||||||
.map(body -> body.getContent().toArray(new MgmtDistributionSet[0]))
|
.map(body -> body.getContent().toArray(new MgmtDistributionSet[0]))
|
||||||
.orElseGet(() -> new MgmtDistributionSet[0]));
|
.orElseGet(() -> new MgmtDistributionSet[0]));
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
|||||||
this::readyToAssign,
|
this::readyToAssign,
|
||||||
Optional.ofNullable(
|
Optional.ofNullable(
|
||||||
hawkbitClient.getDistributionSetRestApi()
|
hawkbitClient.getDistributionSetRestApi()
|
||||||
.getDistributionSets(0, 30, Constants.NAME_ASC, null)
|
.getDistributionSets(null, 0, 30, Constants.NAME_ASC)
|
||||||
.getBody())
|
.getBody())
|
||||||
.map(body -> body.getContent().toArray(new MgmtDistributionSet[0]))
|
.map(body -> body.getContent().toArray(new MgmtDistributionSet[0]))
|
||||||
.orElseGet(() -> new MgmtDistributionSet[0])
|
.orElseGet(() -> new MgmtDistributionSet[0])
|
||||||
|
|||||||
Reference in New Issue
Block a user