All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.kemitix.itunes.medialibrary.MediaLibraryImpl Maven / Gradle / Ivy

The newest version!
package net.kemitix.itunes.medialibrary;

import java.io.File;
import java.sql.SQLException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
class MediaLibraryImpl implements MediaLibrary {

    private final AlbumDao albumDao;
    private final ArtistDao artistDao;
    private final ItemDao itemDao;
    private final AlbumTrackDao albumTracksDao;

    @Autowired
    public MediaLibraryImpl(
            AlbumDao albumDao,
            ArtistDao artistDao,
            ItemDao itemDao,
            AlbumTrackDao albumTracksDao
    ) {
        this.albumDao = albumDao;
        this.artistDao = artistDao;
        this.itemDao = itemDao;
        this.albumTracksDao = albumTracksDao;
    }

    @Override
    public List getAlbums() throws SQLException {
        return albumDao.selectAll();
    }

    @Override
    public List getArtists() throws SQLException {
        return artistDao.selectAll();
    }

    @Override
    public List getItems() throws SQLException {
        return itemDao.selectAll();
    }

    @Override
    public List getAlbumTracks() throws SQLException {
        return albumTracksDao.selectAll();
    }

    @Override
    public AlbumTrack findAlbumTrack(File file) {
        return albumTracksDao.find(file);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy