package cz.senslog.fetch.senslog.telemetry;

import cz.senslog.connector.fetch.api.ConnectorFetcher;
import cz.senslog.connector.fetch.api.FetchProxySession;
import cz.senslog.connector.model.api.GeoJsonModel;
import cz.senslog.connector.model.api.ProxySessionModel;

import java.util.Optional;

public class SensLogTelemetryProxySession extends FetchProxySession<SensLogTelemetrySession, GeoJsonModel> {

    protected SensLogTelemetryProxySession(ConnectorFetcher<SensLogTelemetrySession, GeoJsonModel> instance) {
        super(instance);
    }

    @Override
    protected SensLogTelemetrySession preProcessing(Optional<SensLogTelemetrySession> previousSession) {
        return previousSession.filter(ProxySessionModel::isActive).orElse(new SensLogTelemetrySession(true));
    }

    @Override
    protected void postProcessing(Optional<GeoJsonModel> model, Optional<SensLogTelemetrySession> session) {

    }
}