class TimerLogic implements RunnableService {

	public Timer reactivateTimer(Timer timer) {
		if (!timer.isActive()) {
			timer.setActive(true);
			LocalDateTime current = LocalDateTime.now();
			int timertime = (int) (timer.duration().toMillis() / 1000);
			LocalDateTime newTimerTime = current.plusSeconds(timertime);
			timer.setTimerTime(newTimerTime);
			this.timerStorage.save(timer);
			Runnable timerRunnable = createTimerRunnable(timer);
			ZonedDateTime ringtime = this.environment.getCurrentDateTime().with(timer.getTimerTime());
			this.taskScheduler.schedule(timerRunnable, ringtime.toInstant());
			return timer;
		}
		throw new IllegalArgumentException("Timer is already active");
	}

}