AbstractZoneScheduler.java 644 Bytes
package com.iot.scheduler.task;

import lombok.extern.slf4j.Slf4j;

/**
 * Base class for Zone Schedulers.
 * Provides common logging and helper methods.
 */
@Slf4j
public abstract class AbstractZoneScheduler {

    protected abstract String getZoneName();

    protected void logStart(String taskName) {
        log.info("[{}] Starting task: {}", getZoneName(), taskName);
    }

    protected void logEnd(String taskName) {
        log.info("[{}] Completed task: {}", getZoneName(), taskName);
    }

    protected void logError(String taskName, Exception e) {
        log.error("[{}] Error in task: {}", getZoneName(), taskName, e);
    }
}