diff --git a/media-backend-api-client/src/main/java/nl/vpro/api/client/media/MediaRestClient.java b/media-backend-api-client/src/main/java/nl/vpro/api/client/media/MediaRestClient.java index 4412d7d2..f4fc270d 100644 --- a/media-backend-api-client/src/main/java/nl/vpro/api/client/media/MediaRestClient.java +++ b/media-backend-api-client/src/main/java/nl/vpro/api/client/media/MediaRestClient.java @@ -2,7 +2,6 @@ import lombok.*; -import java.io.IOException; import java.lang.reflect.Method; import java.time.Duration; import java.util.*; @@ -47,6 +46,7 @@ import nl.vpro.util.*; import static nl.vpro.domain.media.EntityType.AllMedia.valueOf; +import static nl.vpro.domain.media.search.Pager.Direction.ASC; /** * A client for RESTfull calls to a running MediaBackendRestService. @@ -120,32 +120,26 @@ public class MediaRestClient extends AbstractApiClient implements MediaRestClien @Getter @Setter - @lombok.Builder.Default protected boolean waitForRetry = false; - @lombok.Builder.Default @Getter @Setter protected boolean lookupCrids = true; - @lombok.Builder.Default @Getter @Setter private boolean validateInput = false; - @lombok.Builder.Default @Getter @Setter private AssemblageConfig.Steal stealCrids = AssemblageConfig.Steal.IF_DELETED; - @lombok.Builder.Default @Getter @Setter private boolean imageMetaData = false; - @lombok.Builder.Default @Getter @Setter private OwnerType owner = OwnerType.BROADCASTER; @@ -154,17 +148,14 @@ public class MediaRestClient extends AbstractApiClient implements MediaRestClien @Setter private Queue warnings = new ArrayDeque<>(100); - @lombok.Builder.Default @Getter @Setter private boolean publishImmediately = false; - @lombok.Builder.Default @Getter @Setter private Boolean deletes = null; - @lombok.Builder.Default @Getter @Setter private TriFunction headerLevel = DEFAULT_HEADER_LEVEL; @@ -699,7 +690,7 @@ public T getFull(String id) { @SneakyThrows public MediaUpdateList getGroupMembers(final String id, final int max, final long offset) { - return getBackendRestService().getGroupMembers(EntityType.NoSegments.media, id, offset, max, "ASC", followMerges, owner, deletes); + return getBackendRestService().getGroupMembers(EntityType.NoSegments.media, id, offset, max, ASC, followMerges, owner, deletes); } public MediaUpdateList getGroupMembers(String id) { @@ -708,7 +699,7 @@ public MediaUpdateList getGroupMembers(String id) { @SneakyThrows public MediaUpdateList getGroupEpisodes(final String id, final int max, final long offset) { - return getBackendRestService().getGroupEpisodes(id, offset, max, "ASC", followMerges, owner, deletes); + return getBackendRestService().getGroupEpisodes(id, offset, max, ASC, followMerges, owner, deletes); } public MediaUpdateList getGroupEpisodes(String id) { @@ -735,12 +726,7 @@ public Iterator getAllMembers(String mid) { return BatchedReceiver.builder() .batchSize(240) .batchGetter((offset, max) -> { - try { - return getBackendRestService().getGroupMembers(EntityType.NoSegments.media, mid, offset, max, "ASC", followMerges, owner, deletes).iterator(); - } catch (IOException e) { - log.error(e.getMessage(), e); - throw new RuntimeException(e); - } + return getBackendRestService().getGroupMembers(EntityType.NoSegments.media, mid, offset, max, ASC, followMerges, owner, deletes).iterator(); }) .build(); } @@ -749,12 +735,7 @@ public Iterator getAllEpisodes(String mid) { return BatchedReceiver.builder() .batchSize(defaultMax) .batchGetter((offset, max) -> { - try { - return getBackendRestService().getGroupEpisodes(mid, offset, max, "ASC", followMerges, owner, deletes).iterator(); - } catch (IOException e) { - log.error(e.getMessage(), e); - throw new RuntimeException(e); - } + return getBackendRestService().getGroupEpisodes(mid, offset, max, ASC, followMerges, owner, deletes).iterator(); }) .build(); } @@ -764,12 +745,7 @@ public Iterator getAllFullMembers(String mid) { return BatchedReceiver.builder() .batchSize(defaultMax) .batchGetter((offset, max) -> { - try { - return getBackendRestService().getFullGroupMembers(EntityType.NoSegments.media, mid, offset, max, "ASC", followMerges, deletes).iterator(); - } catch (IOException e) { - log.error(e.getMessage(), e); - throw new RuntimeException(e); - } + return getBackendRestService().getFullGroupMembers(EntityType.NoSegments.media, mid, offset, max, ASC, followMerges, deletes).iterator(); }) .build(); } @@ -778,12 +754,7 @@ public Iterator getAllFullEpisodes(String mid) { return BatchedReceiver.builder() .batchSize(defaultMax) .batchGetter((offset, max) -> { - try { - return getBackendRestService().getFullGroupEpisodes(mid, offset, max, "ASC", followMerges, deletes).iterator(); - } catch (IOException e) { - log.error(e.getMessage(), e); - throw new RuntimeException(e); - } + return getBackendRestService().getFullGroupEpisodes(mid, offset, max, ASC, followMerges, deletes).iterator(); }) .build(); }