remove demand for paging provider

This commit is contained in:
Tadgh 2021-06-30 18:21:08 -04:00
parent 9f3b262d6d
commit 950096d42f
2 changed files with 11 additions and 6 deletions

View File

@ -24,12 +24,17 @@ public class MdmPageRequest {
private final int myOffset;
private final int myCount;
public MdmPageRequest(@Nullable UnsignedIntType theOffset, @Nullable UnsignedIntType theCount, IPagingProvider thePagingProvider) {
public MdmPageRequest(@Nullable UnsignedIntType theOffset, @Nullable UnsignedIntType theCount, int theDefaultPageSize, int theMaximumPageSize) {
myOffset = theOffset == null ? 0 : theOffset.getValue();
myCount = theCount == null
? thePagingProvider.getDefaultPageSize() : theCount.getValue() > thePagingProvider.getMaximumPageSize()
? thePagingProvider.getMaximumPageSize() : theCount.getValue();
myCount = theCount == null ? theDefaultPageSize : Math.min(theCount.getValue(), theMaximumPageSize);
validatePagingParameters(myOffset, myCount);
this.myPage = myOffset / myCount;
}
public MdmPageRequest(@Nullable Integer theOffset, @Nullable Integer theCount, int theDefaultPageSize, int theMaximumPageSize) {
myOffset = theOffset == null ? 0 : theOffset;
myCount = theCount == null ? theDefaultPageSize : Math.min(theCount, theMaximumPageSize);
validatePagingParameters(myOffset, myCount);
this.myPage = myOffset / myCount;

View File

@ -213,7 +213,7 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider {
UnsignedIntType theCount,
ServletRequestDetails theRequestDetails) {
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, myPagingProvider);
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, myPagingProvider.getDefaultPageSize(), myPagingProvider.getMaximumPageSize());
Page<MdmLinkJson> mdmLinkJson = myMdmControllerSvc.queryLinks(extractStringOrNull(theGoldenResourceId),
extractStringOrNull(theResourceId), extractStringOrNull(theMatchResult), extractStringOrNull(theLinkSource),
createMdmContext(theRequestDetails, MdmTransactionContext.OperationType.QUERY_LINKS,
@ -233,7 +233,7 @@ public class MdmProviderDstu3Plus extends BaseMdmProvider {
UnsignedIntType theCount,
ServletRequestDetails theRequestDetails) {
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, myPagingProvider);
MdmPageRequest mdmPageRequest = new MdmPageRequest(theOffset, theCount, myPagingProvider.getDefaultPageSize(), myPagingProvider.getMaximumPageSize());
Page<MdmLinkJson> possibleDuplicates = myMdmControllerSvc.getDuplicateGoldenResources(createMdmContext(theRequestDetails, MdmTransactionContext.OperationType.DUPLICATE_GOLDEN_RESOURCES, (String) null), mdmPageRequest);