2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.digitalstrom.internal.lib.sensorjobexecutor.sensorjob;
15 import org.openhab.binding.digitalstrom.internal.lib.serverconnection.DsAPI;
16 import org.openhab.binding.digitalstrom.internal.lib.structure.devices.deviceparameters.impl.DSID;
19 * The {@link SensorJob} represents an executable job to read out digitalSTROM-Sensors or device configurations like
21 * It can be added to an implementation of the {@link AbstractSensorJobExecutor} e.g. {@link SceneReadingJobExecutor} or
22 * {@link SensorJobExecutor}.
24 * @author Michael Ochel - Initial contribution
25 * @author Matthias Siegele - Initial contribution
27 public interface SensorJob {
30 * Returns the dSID of the {@link Device} for which this job is to be created.
32 * @return dSID from the device
37 * Returns the dSID of the digitalSTROM-Meter on which this job is to be created.
39 * @return dSID from the device meter
44 * Executes the SensorJob.
46 * @param dSAPI must not be null
47 * @param sessionToken to login
49 void execute(DsAPI dSAPI, String sessionToken);
52 * Returns the time when the {@link SensorJob} was initialized.
54 * @return the initialization time
56 long getInitalisationTime();
59 * Sets the time when the {@link SensorJob} was initialized e.g. to manages the priority of this {@link SensorJob}.
63 void setInitalisationTime(long time);
66 * Returns the id of this {@link SensorJob}.