angry1980.audio.service.TrackSimilarityServiceImpl Maven / Gradle / Ivy
package angry1980.audio.service;
import angry1980.audio.dao.TrackDAO;
import angry1980.audio.dao.TrackSimilarityDAO;
import angry1980.audio.model.FingerprintType;
import angry1980.audio.model.Track;
import angry1980.audio.model.TrackSimilarity;
import angry1980.audio.similarity.FindSimilarTracks;
import angry1980.audio.similarity.TrackSimilarities;
import angry1980.audio.similarity.TracksToCalculate;
import angry1980.utils.ImmutableCollectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
public class TrackSimilarityServiceImpl implements TrackSimilarityService {
private static Logger LOG = LoggerFactory.getLogger(TrackSimilarityServiceImpl.class);
private TrackDAO trackDAO;
private TrackSimilarityDAO trackSimilarityDAO;
private List findSimilarTracks;
private TracksToCalculate tracksToCalculate;
public TrackSimilarityServiceImpl(TrackDAO trackDAO,
TrackSimilarityDAO trackSimilarityDAO,
List findSimilarTracks,
TracksToCalculate tracksToCalculate) {
this.trackDAO = Objects.requireNonNull(trackDAO);
this.trackSimilarityDAO = Objects.requireNonNull(trackSimilarityDAO);
this.findSimilarTracks = Objects.requireNonNull(findSimilarTracks);
this.tracksToCalculate = Objects.requireNonNull(tracksToCalculate);
}
@Override
public Observable