class ProjectService {

  @Transactional
  public void archiveProject(String name) {
    Optional<Project> project = projectRepository.findById(name);
    if (!project.isPresent()) {
      throw new IllegalArgumentException(String.format("Could not find project: \"%s\"", name));
    }
    if (name.equals(Project.DEFAULT_NAME)) {
      throw new UnsupportedOperationException("Archiving the default project is not allowed.");
    }
    Project p = project.get();
    p.setArchived(true);
    projectRepository.saveAndFlush(p);
  }

  @Autowired public  ProjectService(ProjectRepository projectRepository);

}