/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.peetz.library.view;

import com.peetz.library.service.LibraryService;
import java.io.Serializable;
import java.util.logging.Logger;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author tpeetz
 */
@ManagedBean(name="LibraryView")
@RequestScoped
public class LibraryView implements Serializable {

	private static final long serialVersionUID = -6251848426914654974L;

	private static final Logger LOG = Logger.getLogger(LibraryView.class.getName());

    @EJB
    private LibraryService libraryService;

    public LibraryView() {
        LOG.info("LibraryView created");
    }

    public Integer getBookNumber() {
        return libraryService.getAllBooks().size();
    }
    
    public Integer getArticleNumber() {
        return libraryService.getAllArticles().size();
    }
}
