All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
nl.vpro.api.client.utils.ApiClientMediaSearchRepository Maven / Gradle / Ivy
package nl.vpro.api.client.utils;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import nl.vpro.domain.api.media.*;
import nl.vpro.domain.api.profile.ProfileDefinition;
import nl.vpro.domain.media.MediaObject;
/**
* An implementation of {@link MediaSearchRepository}, but based on an api client.
*
* @author Michiel Meeuwissen
* @since 1.1
*/
@Named("npoApiMediaSearchRepository")
public class ApiClientMediaSearchRepository extends AbstractApiClientMediaRepository implements MediaSearchRepository {
@Inject
public ApiClientMediaSearchRepository(NpoApiMediaUtil util) {
super(util);
}
@Override
public MediaSearchResult find(ProfileDefinition profile, MediaForm form, long offset, Integer max) {
return clients.getMediaService().find(form != null ? form : MediaFormBuilder.emptyForm(), name(profile), null, offset, max);
}
@Override
public MediaSearchResult findMembers(MediaObject media, ProfileDefinition profile, MediaForm form, long offset, Integer max) {
return clients.getMediaService().findMembers(form != null ? form : MediaFormBuilder.emptyForm(), media.getMid(), name(profile), null, offset, max);
}
@Override
public ProgramSearchResult findEpisodes(MediaObject media, ProfileDefinition profile, MediaForm form, long offset, Integer max) {
return clients.getMediaService().findEpisodes(form != null ? form : MediaFormBuilder.emptyForm(), media.getMid(), name(profile), null, offset, max);
}
@Override
public MediaSearchResult findDescendants(MediaObject media, ProfileDefinition profile, MediaForm form, long offset, Integer max) {
return clients.getMediaService().findDescendants(form != null ? form : MediaFormBuilder.emptyForm(), media.getMid(), name(profile), null, offset, max);
}
@Override
public MediaSearchResult findRelated(MediaObject media, ProfileDefinition profile, MediaForm form, Integer max) {
return clients.getMediaService().findRelated(form != null ? form : MediaFormBuilder.emptyForm(), media.getMid(), name(profile), null, max, null);
}
}