
package de.ivu.elect.presentation.system.menu;

import static java.util.Collections.singletonList;

import java.util.List;

import de.ivu.elect.business.security.UseCasePermission;

public class HibernateStatistikResetCacheMenuItemEntry extends AbstractHibernateStatistikMenuItemEntry {

  private static final long serialVersionUID = 1L;

  public HibernateStatistikResetCacheMenuItemEntry() {
    super();
  }

  @Override
  public String getTargetViewId() {
    return null; // and do action!
  }

  @Override
  public String doAction() {
    hibernateStatistik.resetCache();

    addInfoMessage("second.level.cache.reset");

    return null;
  }

  @Override
  public boolean isRendered() {
    return hasUseCasePermission(UseCasePermission.HIBERNATE_CACHE_RESET);
  }

  @Override
  public String getLabelKey() {
    return "hibernate.statistik.reset.cache.menu.item.label";
  }

  @Override
  public String getIcon() {
    return getIcons().getIconRecover();
  }

  @Override
  protected List<String> getAdditionalTopicViewIds() {
    return singletonList("");
  }
}
