package de.ivu.elect.business.security.control;

import javax.inject.Inject;

import de.ivu.elect.business.mandant.boundary.AbstractMandantDAO;
import de.ivu.elect.business.mandant.entity.Mandant;
import de.ivu.elect.business.security.entity.ElectPricipalContext;
import de.ivu.elect.jee.faces.Escape;
import de.ivu.elect.jee.security.PrincipalLoginFilter;

public abstract class AbstractElectPricipalContext implements ElectPricipalContext {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient PrincipalLoginFilter principalLoginFilter;

  @Inject
  private transient Escape escape;

  protected abstract AbstractMandantDAO getMandantDao();

  @Override
  public Mandant getLogInMandant(Long mandantenNummer) {
    return getMandantDao().findByNummer(mandantenNummer);
  }

  @Override
  public PrincipalLoginFilter getPrincipalLoginFilter() {
    return principalLoginFilter;
  }

  @Override
  public Escape getEscape() {
    return escape;
  }
}
